| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying the Users statistics dashboard tab. |
| 4 |
* |
| 5 |
* Data is rendered by assets/src/js/admin/statistics/tab-users.js from the |
| 6 |
* `dashboard` key of the user-statistics endpoint. |
| 7 |
* |
| 8 |
* @since 4.4.2 |
| 9 |
*/ |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || exit(); |
| 12 |
|
| 13 |
$kpi_cards = array( |
| 14 |
'users-activated' => __( 'Users activated', 'learnpress' ), |
| 15 |
'students' => __( 'Students', 'learnpress' ), |
| 16 |
'instructors' => __( 'Instructors', 'learnpress' ), |
| 17 |
'not-started' => __( 'Not started', 'learnpress' ), |
| 18 |
'in-progress' => __( 'In progress', 'learnpress' ), |
| 19 |
'finished' => __( 'Finished', 'learnpress' ), |
| 20 |
); |
| 21 |
|
| 22 |
$funnel_steps = array( |
| 23 |
'registered' => __( 'Registered', 'learnpress' ), |
| 24 |
'enrolled' => __( 'Enrolled', 'learnpress' ), |
| 25 |
'started' => __( 'Started learning', 'learnpress' ), |
| 26 |
'completed' => __( 'Completed', 'learnpress' ), |
| 27 |
'failed' => __( 'Failed', 'learnpress' ), |
| 28 |
); |
| 29 |
|
| 30 |
// Section config filters — add/remove/relabel cards and lists. @since 4.4.2 |
| 31 |
$kpi_cards = (array) apply_filters( 'learn-press/statistics/users/kpi-cards', $kpi_cards ); |
| 32 |
$funnel_steps = (array) apply_filters( 'learn-press/statistics/users/funnel-steps', $funnel_steps ); |
| 33 |
?> |
| 34 |
<div class="lp-admin-statistics-tab-content lp-stats-tab-users"> |
| 35 |
<?php |
| 36 |
/** |
| 37 |
* Fires at the top of the Users statistics tab, inside the tab container. |
| 38 |
* |
| 39 |
* @since 4.4.2 |
| 40 |
*/ |
| 41 |
do_action( 'learn-press/statistics/users/before' ); |
| 42 |
|
| 43 |
learn_press_admin_view( 'statistics/parts/filter-bar' ); |
| 44 |
?> |
| 45 |
|
| 46 |
<div class="lp-stats-dashboard-body"> |
| 47 |
<div class="lp-stats-kpi-grid"> |
| 48 |
<?php |
| 49 |
foreach ( $kpi_cards as $key => $title ) { |
| 50 |
learn_press_admin_view( |
| 51 |
'statistics/parts/kpi-card', |
| 52 |
array( |
| 53 |
'key' => $key, |
| 54 |
'title' => $title, |
| 55 |
) |
| 56 |
); |
| 57 |
} |
| 58 |
?> |
| 59 |
</div> |
| 60 |
|
| 61 |
<div class="lp-stats-overview-grid lp-stats-overview-grid--chart"> |
| 62 |
<div class="lp-stats-section statistics-content"> |
| 63 |
<div class="lp-stats-section__header"> |
| 64 |
<div> |
| 65 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Learner registration and progress', 'learnpress' ); ?></h3> |
| 66 |
<p class="lp-stats-section__description"><?php esc_html_e( 'Registration, enrollment, and graduation activity across the learning lifecycle.', 'learnpress' ); ?></p> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
<div id="user-chart" class="statistics-chart-wrapper"> |
| 70 |
<?php lp_skeleton_animation_html( 10, 100 ); ?> |
| 71 |
<canvas id="user-chart-content" style="display: none;"></canvas> |
| 72 |
</div> |
| 73 |
</div> |
| 74 |
|
| 75 |
<div class="lp-stats-section"> |
| 76 |
<div class="lp-stats-section__header"> |
| 77 |
<div> |
| 78 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Learner funnel', 'learnpress' ); ?></h3> |
| 79 |
<p class="lp-stats-section__description"><?php esc_html_e( 'Registered users to completed courses.', 'learnpress' ); ?></p> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
<?php lp_skeleton_animation_html( 5, 100 ); ?> |
| 83 |
<div class="lp-stats-funnel"> |
| 84 |
<?php foreach ( $funnel_steps as $step => $label ) : ?> |
| 85 |
<div class="lp-stats-funnel__step" data-step="<?php echo esc_attr( $step ); ?>"> |
| 86 |
<span class="lp-stats-funnel__label"><?php echo esc_html( $label ); ?></span> |
| 87 |
<span class="lp-stats-funnel__track"><span class="lp-stats-funnel__bar" style="width: 0;"></span></span> |
| 88 |
<span class="lp-stats-funnel__count">–</span> |
| 89 |
</div> |
| 90 |
<?php endforeach; ?> |
| 91 |
</div> |
| 92 |
</div> |
| 93 |
</div> |
| 94 |
|
| 95 |
<div class="lp-stats-overview-grid lp-stats-overview-grid--tables"> |
| 96 |
<div class="lp-stats-section"> |
| 97 |
<div class="lp-stats-section__header"> |
| 98 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Top students', 'learnpress' ); ?></h3> |
| 99 |
<button type="button" class="button-link lp-stats-section__action lp-stats-view-all-students"><?php esc_html_e( 'Open report', 'learnpress' ); ?></button> |
| 100 |
</div> |
| 101 |
<?php lp_skeleton_animation_html( 5, 100 ); ?> |
| 102 |
<div class="lp-stats-table-top-students"></div> |
| 103 |
</div> |
| 104 |
|
| 105 |
<div class="lp-stats-section"> |
| 106 |
<div class="lp-stats-section__header"> |
| 107 |
<h3 class="lp-stats-section__title"><?php esc_html_e( 'Top courses by students', 'learnpress' ); ?></h3> |
| 108 |
<button type="button" class="button-link lp-stats-section__action lp-stats-view-all-courses-by-students"><?php esc_html_e( 'Open report', 'learnpress' ); ?></button> |
| 109 |
</div> |
| 110 |
<?php lp_skeleton_animation_html( 5, 100 ); ?> |
| 111 |
<div class="lp-stats-table-courses-by-students"></div> |
| 112 |
</div> |
| 113 |
</div> |
| 114 |
</div> |
| 115 |
|
| 116 |
<?php |
| 117 |
learn_press_admin_view( 'statistics/parts/report-modal' ); |
| 118 |
|
| 119 |
/** |
| 120 |
* Fires at the bottom of the Users statistics tab, inside the tab container. |
| 121 |
* |
| 122 |
* @since 4.4.2 |
| 123 |
*/ |
| 124 |
do_action( 'learn-press/statistics/users/after' ); |
| 125 |
?> |
| 126 |
</div> |
| 127 |
|