PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / admin / views / course / curriculum.php

curriculum.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at inc/admin/views/course/curriculum.php

58 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template curriculum course.
4 *
5 * @since 3.0.0
6 */
7
8 learn_press_admin_view( 'course/sections' );
9 ?>
10
11 <script type="text/x-template" id="tmpl-lp-course-curriculum">
12 <div class="lp-course-curriculum">
13 <div class="heading">
14 <h4><?php esc_html_e( 'Details', 'learnpress' ); ?> <span :class="['status', status]"></span></h4>
15 <div class="section-item-counts"><span>{{countAllItems()}}</span></div>
16 <span class="collapse-sections" @click="toggle" :class="isOpen ? 'open' : 'close'"></span>
17 </div>
18 <lp-list-sections></lp-list-sections>
19 </div>
20 </script>
21
22 <script type="text/javascript">
23
24 window.$Vue = window.$Vue = Vue;
25
26 jQuery( function( $ ) {
27 ( function( $store ) {
28 $Vue.component( 'lp-curriculum', {
29 template: '#tmpl-lp-course-curriculum',
30 computed: {
31 status: function() {
32 return $store.getters.status;
33 },
34 isOpen: function() {
35 return ! $store.getters['ss/isHiddenAllSections'];
36 }
37 },
38 methods: {
39 toggle: function() {
40 $store.dispatch( 'ss/toggleAllSections' );
41 },
42 countAllItems: function() {
43 var count = 0,
44 labels = $store.getters['i18n/all'].item_labels;
45
46 $.each( $store.getters['ss/sections'], function ( i, section ) {
47 count += section.items.length;
48 });
49
50 return count + ' ' + (count <= 1 ? labels.singular : labels.plural);
51 }
52 }
53 });
54
55 })( LP_Curriculum_Store );
56 });
57 </script>
58