Skip to content

Commit 5b5b30f

Browse files
committed
new: qna and lesson comment replies template added
1 parent 142892b commit 5b5b30f

File tree

3 files changed

+116
-10
lines changed

3 files changed

+116
-10
lines changed

templates/dashboard/discussions.php

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
defined( 'ABSPATH' ) || exit;
1717

1818
$current_tab = Input::get( 'tab' );
19+
$replies = Input::get( 'replies', 0, Input::TYPE_INT );
1920
$order_filter = Input::get( 'order', 'DESC' );
2021
$current_page = max( 1, Input::get( 'current_page', 1, Input::TYPE_INT ) );
2122
$item_per_page = tutor_utils()->get_option( 'pagination_per_page', 10 );
@@ -40,18 +41,29 @@
4041
);
4142
?>
4243
<div class="tutor-dashboard-discussions tutor-surface-l1 tutor-border tutor-rounded-2xl" x-data="tutorDiscussions()">
43-
<div class="tutor-p-6 tutor-border-b">
44-
<?php Nav::make()->items( $page_nav_items )->render(); ?>
45-
</div>
46-
<div class="tutor-sm-border tutor-sm-rounded-2xl tutor-sm-mt-4">
47-
<?php
44+
<?php
45+
if ( $replies ) {
46+
$template = tutor()->path . 'templates/dashboard/discussions/qna-replies.php';
4847
if ( 'lesson-comments' === $current_tab ) {
49-
$template = tutor()->path . 'templates/dashboard/discussions/lesson-comment-list.php';
50-
} else {
51-
$template = tutor()->path . 'templates/dashboard/discussions/qna-list.php';
48+
$template = tutor()->path . 'templates/dashboard/discussions/lesson-comment-replies.php';
5249
}
53-
5450
require_once $template;
51+
} else {
5552
?>
56-
</div>
53+
<div class="tutor-p-6 tutor-border-b">
54+
<?php Nav::make()->items( $page_nav_items )->render(); ?>
55+
</div>
56+
<div class="tutor-sm-border tutor-sm-rounded-2xl tutor-sm-mt-4">
57+
<?php
58+
$template = tutor()->path . 'templates/dashboard/discussions/qna-list.php';
59+
if ( 'lesson-comments' === $current_tab ) {
60+
$template = tutor()->path . 'templates/dashboard/discussions/lesson-comment-list.php';
61+
}
62+
63+
require_once $template;
64+
?>
65+
</div>
66+
<?php
67+
}
68+
?>
5769
</div>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Lesson comment replies template.
4+
*
5+
* @package Tutor\Templates
6+
* @subpackage Dashboard
7+
* @author Themeum <support@themeum.com>
8+
* @link https://themeum.com
9+
* @since 4.0.0
10+
*/
11+
12+
use Tutor\Components\Button;
13+
use Tutor\Components\Constants\Size;
14+
use Tutor\Components\Constants\Variant;
15+
use TUTOR\Icon;
16+
17+
defined( 'ABSPATH' ) || exit;
18+
?>
19+
20+
<div class="tutor-p-6 tutor-border-b">
21+
<div class="tutor-flex tutor-justify-between">
22+
<div>
23+
<?php
24+
Button::make()
25+
->variant( Variant::SECONDARY )
26+
->tag( 'a' )
27+
->attr( 'href', $discussion_url )
28+
->label( __( 'Back', 'tutor' ) )
29+
->icon( Icon::BACK )
30+
->size( Size::SM )
31+
->render();
32+
?>
33+
</div>
34+
<div></div>
35+
</div>
36+
</div>
37+
38+
<div class="tutor-sm-border tutor-sm-rounded-2xl tutor-sm-mt-4">
39+
</div>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Q&A replies template.
4+
*
5+
* @package Tutor\Templates
6+
* @subpackage Dashboard
7+
* @author Themeum <support@themeum.com>
8+
* @link https://themeum.com
9+
* @since 4.0.0
10+
*/
11+
12+
use Tutor\Components\Button;
13+
use Tutor\Components\Constants\Size;
14+
use Tutor\Components\Constants\Variant;
15+
use Tutor\Components\Nav;
16+
use TUTOR\Icon;
17+
18+
defined( 'ABSPATH' ) || exit;
19+
?>
20+
<div class="tutor-p-6 tutor-border-b">
21+
<div class="tutor-flex tutor-justify-between">
22+
<div>
23+
<?php
24+
Button::make()
25+
->variant( Variant::SECONDARY )
26+
->tag( 'a' )
27+
->attr( 'href', $discussion_url )
28+
->label( __( 'Back', 'tutor' ) )
29+
->icon( Icon::BACK, 'left' )
30+
->size( Size::SM )
31+
->render();
32+
?>
33+
</div>
34+
<?php
35+
Nav::make()->items(
36+
array(
37+
array(
38+
'type' => 'link',
39+
'label' => __( 'Solved', 'tutor' ),
40+
'icon' => Icon::CHECK,
41+
'url' => '#',
42+
),
43+
array(
44+
'type' => 'link',
45+
'label' => __( 'Important', 'tutor' ),
46+
'icon' => Icon::BOOKMARK,
47+
'url' => '#',
48+
),
49+
)
50+
)->render();
51+
?>
52+
</div>
53+
54+
<div class="tutor-sm-border tutor-sm-rounded-2xl tutor-sm-mt-4">
55+
</div>

0 commit comments

Comments
 (0)