From c4962ac1e4b9074e5a53cc9076e1d1055a4f5179 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 21 Jul 2016 15:00:04 -0500 Subject: [PATCH 1/2] Minor - Format code --- .../default/user_portal/classic_courses.tpl | 145 ++++----- .../default/user_portal/classic_session.tpl | 207 +++++++------ .../default/user_portal/grid_courses.tpl | 284 +++++++++--------- .../default/user_portal/grid_session.tpl | 169 ++++++----- .../default/user_portal/session_category.tpl | 14 +- 5 files changed, 420 insertions(+), 399 deletions(-) diff --git a/main/template/default/user_portal/classic_courses.tpl b/main/template/default/user_portal/classic_courses.tpl index ca7844f431..2a2c88faf0 100644 --- a/main/template/default/user_portal/classic_courses.tpl +++ b/main/template/default/user_portal/classic_courses.tpl @@ -26,7 +26,7 @@ {{ item.document }} - + {% endif %} {% endif %} @@ -45,15 +45,16 @@ {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} + @@ -65,68 +66,69 @@
{% for category in courses.in_category %} -
-
- {{ category.title_category }} -
-
- {% for item in category.courses %} -
- -
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - +
+
+ {{ category.title_category }} +
+
+ {% for item in category.courses %} +
+
+ + {% if item.thumbnails != '' %} + {{ item.title }} {% else %} - +
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} - {{ item.document }} -
- {% endif %} -
- {% endif %} -

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - - {{ item.title }} {{ item.code_course }} - - {{ item.notifications }} + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +

{% endif %} - -
- {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} - + {{ item.notifications }} + {% endif %} + +
+ {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} + +
-
- {% endfor %} + {% endfor %} +
-
{% endfor %} @@ -156,7 +158,7 @@ {{ item.document }} -
+
{% endif %}
{% endif %} @@ -174,15 +176,16 @@ {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} +
diff --git a/main/template/default/user_portal/classic_session.tpl b/main/template/default/user_portal/classic_session.tpl index ace02ddc7c..1c062e0195 100644 --- a/main/template/default/user_portal/classic_session.tpl +++ b/main/template/default/user_portal/classic_session.tpl @@ -1,119 +1,126 @@ {% for row in session %} -
- {% if not row.show_simple_session_info %} - {% set collapsable = '' %} -
- {% if row.course_list_session_style == 1 %} - {# Classic #} - - {{ row.title }} +
+ {% if not row.show_simple_session_info %} + {% set collapsable = '' %} +
+ {% if row.course_list_session_style == 1 %} + {# Classic #} + + {{ row.title }} + {{ row.title }} + + {% elseif row.course_list_session_style == 2 %} + {# No link #} + {{ row.title }} {{ row.title }} - - {% elseif row.course_list_session_style == 2 %} - {# No link #} - {{ row.title }} - {{ row.title }} - {% elseif row.course_list_session_style == 3 %} - {# Foldable #} - - {% set collapsable = 'collapse' %} - {% endif %} - - {% if row.show_actions %} - - {% endif %} -
- {% endif %} + {% set collapsable = 'collapse' %} + {% endif %} -
- {% if row.show_simple_session_info %} -
-
- {% if row.description != '' %} - {{ row.description }} + {% if row.show_actions %} +
+ + {{ + +
{% endif %} -
- {% if row.coach_name != '' %} - - {{ row.coach_name }} +
+ {% endif %} + +
+ {% if row.show_simple_session_info %} +
+
+ {% if row.description != '' %} + {{ row.description }} + {% endif %} +
+ {% if row.coach_name != '' %} + + {{ row.coach_name }} - {% endif %} - - {{ row.date }} + {% endif %} + + {{ row.date }} -
+
- {% if row.coaches %} -
{{ "teacher.png"|icon(16) ~ row.coaches }}
- {% endif %} -
+ {% if row.coaches %} +
{{ "teacher.png"|icon(16) ~ row.coaches }}
+ {% endif %} +
- {% if row.show_actions %} -
- - {{ - + {% if row.show_actions %} +
+ + {{ + +
+ {% endif %}
- {% endif %} -
- {% else %} -
-
- {% if row.description != '' %} - {{ row.description }} - {% endif %} -
- {% if row.coach_name != '' %} - - {{ row.coach_name }} + {% else %} +
+
+ {% if row.description != '' %} + {{ row.description }} + {% endif %} +
+ {% if row.coach_name != '' %} + + {{ row.coach_name }} - {% endif %} - - {{ row.date }} + {% endif %} + + {{ row.date }} -
-
- {% for item in row.courses %} -
-
-
- {% if item.link %} - - - - {% else %} - {{ 'blackboard.png' | img(48, item.title ) }} - {% endif %} -
-
-

{{ item.title }}

-
- {% if item.teachers|length > 0 %} - - {% for coach in item.teachers %} - {{ loop.index > 1 ? ' | ' }} - - {{ coach.firstname }}, - {{ coach.lastname }} - - {% endfor %} - {% endif %} +
+
+ {% for item in row.courses %} +
+
+
+ {% if item.link %} + + + + {% else %} + {{ 'blackboard.png' | img(48, item.title ) }} + {% endif %} +
+
+

{{ item.title }}

+
+ {% if item.teachers|length > 0 %} + + {% for coach in item.teachers %} + {{ loop.index > 1 ? ' | ' }} + + {{ coach.firstname }}, + {{ coach.lastname }} + + {% endfor %} + {% endif %} +
+
+
-
+ {% endfor %}
- {% endfor %}
-
+ {% endif %}
- {% endif %}
-
{% endfor %} \ No newline at end of file diff --git a/main/template/default/user_portal/grid_courses.tpl b/main/template/default/user_portal/grid_courses.tpl index 51d2253bc6..59bdbc4c80 100644 --- a/main/template/default/user_portal/grid_courses.tpl +++ b/main/template/default/user_portal/grid_courses.tpl @@ -1,144 +1,148 @@
-
- {% for item in special_courses %} -
-
-
-
{{ item.icon }}
- - {% if item.category != '' %} - {{ item.category }} -
- {% endif %} -
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - +
+ {% for item in special_courses %} +
+
+
+
{{ item.icon }}
+ + {% if item.category != '' %} + {{ item.category }} +
{% endif %} - {% endfor %} -
-
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
+
+
+ {% for teacher in item.teachers %} + {% set counter = counter + 1 %} + {% if counter <= 3 %} + + + + + {% endif %} + {% endfor %} +
+
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
{% endif %}
- {% endif %} -
-
-

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - {{ item.title }} {{ item.code_course }} - {% endif %} -

-
{{ item.notifications }}
- +
+

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + {{ item.title }} {{ item.code_course }} + {% endif %} +

+
{{ item.notifications }}
+ +
+
-
-
- {% endfor %} + {% endfor %}
- -{% for category in courses.in_category %} - {% set nameCategory = category.title_category %} - {% set idCategory = category.id_category %} -
-
- {{ nameCategory }} -
-
-
- {% for item in category.courses %} -
-
-
- - {% if item.category != '' %} - {{ item.category }} -
- {% endif %} -
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - - {% endif %} - {% endfor %} + + {% for category in courses.in_category %} + {% set nameCategory = category.title_category %} + {% set idCategory = category.id_category %} +
+
+ {{ nameCategory }} +
+
+
+ {% for item in category.courses %} +
+
+
+ + {% if item.category != '' %} + {{ item.category }} +
+ {% endif %} +
+
+ {% for teacher in item.teachers %} + {% set counter = counter + 1 %} + {% if counter <= 3 %} + + + + + {% endif %} + {% endfor %} +
-
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} - {{ item.document }} -
- {% endif %} -
- {% endif %} -
-
-

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - {{ item.title }} {{ item.code_course }} + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +

{% endif %} - -
{{ item.notifications }}
+
+
+

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + {{ item.title }} {{ item.code_course }} + {% endif %} +

+
{{ item.notifications }}
+
-
- {% endfor %} + {% endfor %} +
-
-{% endfor %} - + {% endfor %} +
{% for item in courses.not_category %}
@@ -146,26 +150,28 @@
{% if item.category != '' %} - {{ item.category }} -
+ {{ item.category }} +
{% endif %}
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - - {% endif %} - {% endfor %} + + {% endif %} + {% endfor %}
{% if item.edit_actions != '' %} @@ -180,7 +186,7 @@ {{ item.document }} -
+
{% endif %}
{% endif %} diff --git a/main/template/default/user_portal/grid_session.tpl b/main/template/default/user_portal/grid_session.tpl index 6699cba4f6..74b9d3137a 100644 --- a/main/template/default/user_portal/grid_session.tpl +++ b/main/template/default/user_portal/grid_session.tpl @@ -1,94 +1,97 @@ {% for row in session %} -
-
- {{ row.title }} {{ row.title }} - - {% if row.edit_actions != '' %} -
- - - +
+
+ {{ row.title }} {{ row.title }} + + {% if row.edit_actions != '' %} +
+ + + +
+ {% endif %}
- {% endif %} -
-
- {% if row.description != '' %} - {{ row.description }} - {% endif %} -
- {% if row.coach_name != '' %} - - {{ row.coach_name }} - +
+ {% if row.description != '' %} + {{ row.description }} {% endif %} +
+ {% if row.coach_name != '' %} + + {{ row.coach_name }} + + {% endif %} + + + {{ row.date }} - - {{ row.date }} - -
-
-
- {% for item in row.courses %} -
-
-
- - {% if item.category != '' %} - {{ item.category }} -
- {% endif %} -
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - - {% endif %} - {% endfor %} +
+
+
+ {% for item in row.courses %} +
+
+
+ + {% if item.category != '' %} + {{ item.category }} +
+ {% endif %} +
+
+ {% for teacher in item.teachers %} + {% set counter = counter + 1 %} + {% if counter <= 3 %} + + + + + {% endif %} + {% endfor %} +
+
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
+ {% endif %} +
+
+

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + {{ item.title }} {{ item.code_course }} + {% endif %} +

+
{{ item.notifications }}
+ +
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -
-
-

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - {{ item.title }} {{ item.code_course }} - {% endif %} -

-
{{ item.notifications }}
- -
+ {% endfor %}
- {% endfor %} -
-
{% endfor %} diff --git a/main/template/default/user_portal/session_category.tpl b/main/template/default/user_portal/session_category.tpl index 7fc384d098..d11f66829a 100644 --- a/main/template/default/user_portal/session_category.tpl +++ b/main/template/default/user_portal/session_category.tpl @@ -3,18 +3,22 @@
{% if session_category.show_actions %} - - {{ session_category.title }} + + {{ session_category.title }} {% else %} - {{ session_category.title }} + {{ session_category.title }} {% endif %}
{% if session_category.show_actions %} {% endif %} @@ -29,7 +33,5 @@ {# session_category.sessions is generated with the session.tpl #} {{ session_category.sessions }} - -
From 99b68ac1d9ec5f3b790589b8194a91291f18252b Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 21 Jul 2016 17:06:43 -0500 Subject: [PATCH 2/2] Show special courses on top in user_portal.php --- main/inc/lib/course.lib.php | 22 +- main/inc/lib/userportal.lib.php | 42 +++- .../default/user_portal/classic_courses.tpl | 196 ---------------- .../classic_courses_with_category.tpl | 71 ++++++ .../classic_courses_without_category.tpl | 68 ++++++ .../default/user_portal/grid_courses.tpl | 210 ------------------ .../grid_courses_with_category.tpl | 76 +++++++ .../grid_courses_without_category.tpl | 71 ++++++ 8 files changed, 322 insertions(+), 434 deletions(-) delete mode 100644 main/template/default/user_portal/classic_courses.tpl create mode 100644 main/template/default/user_portal/classic_courses_with_category.tpl create mode 100644 main/template/default/user_portal/classic_courses_without_category.tpl delete mode 100644 main/template/default/user_portal/grid_courses.tpl create mode 100644 main/template/default/user_portal/grid_courses_with_category.tpl create mode 100644 main/template/default/user_portal/grid_courses_without_category.tpl diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index d054d066f9..175adaa010 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3444,7 +3444,7 @@ class CourseManager $special_course_list = self::get_special_course_list(); - $with_special_courses = $without_special_courses = ''; + $with_special_courses = ''; if (!empty($special_course_list)) { $with_special_courses = ' course.code IN ("' . implode('","', $special_course_list) . '")'; } @@ -3527,6 +3527,8 @@ class CourseManager $params['notifications'] = $show_notification; } + $params['is_special_course'] = true; + $courseList[] = $params; } @@ -3668,7 +3670,6 @@ class CourseManager $thumbnails = null; $image = null; - if ($showCustomIcon === 'true' && $iconName != 'course.png') { $thumbnails = $course_info['course_image']; $image = $course_info['course_image_large']; @@ -3693,7 +3694,6 @@ class CourseManager $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container')); } - $courseUrl = ''; $courseUrl = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0'; if (api_get_setting('display_teacher_in_courselist') === 'true') { @@ -3714,23 +3714,14 @@ class CourseManager $params['category'] = $course_info['categoryName']; $params['teachers'] = $teachers; - if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) { $params['notifications'] = $showNotification; } - $isSubContent = true; - if (empty($user_category_id)) { - $isSubContent = false; - } - $courseList[] = $params; - } return $courseList; - - } /** @@ -3831,8 +3822,6 @@ class CourseManager $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container')); } - - $course_title_url = ''; $course_title_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0'; $teachers = ''; @@ -3858,11 +3847,6 @@ class CourseManager $params['notifications'] = $showNotification; } - $isSubContent = true; - if (empty($user_category_id)) { - $isSubContent = false; - } - $courseList[] = $params; } diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 9577a4ceca..4ebb28385e 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -1090,7 +1090,14 @@ class IndexManager $gamificationModeIsActive = api_get_setting('gamification_mode'); $listCourse = ''; + $specialCourseList = ''; $load_history = (isset($_GET['history']) && intval($_GET['history']) == 1) ? true : false; + + $viewGridCourses = api_get_configuration_value('view_grid_courses'); + + $coursesWithoutCategoryTemplate = '/user_portal/classic_courses_without_category.tpl'; + $coursesWithCategoryTemplate = '/user_portal/classic_courses_with_category.tpl'; + if ($load_history) { // Load sessions in category in *history* $session_categories = UserManager::get_sessions_by_category($user_id, true); @@ -1112,6 +1119,8 @@ class IndexManager $sessionCount = 0; $courseCount = 0; + $template = new Template(null, false, false, false, false, false, false); + // If we're not in the history view... if (!isset($_GET['history'])) { // Display special courses. @@ -1126,15 +1135,30 @@ class IndexManager $this->load_directories_preview ); - $this->tpl->assign('special_courses', $specialCourses); - $this->tpl->assign('courses', $courses); - if (api_get_configuration_value('view_grid_courses') && ($courses || $specialCourses)) { - $listCourse = $this->tpl->fetch( - $this->tpl->get_template('/user_portal/grid_courses.tpl')); - } else if ($courses || $specialCourses) { - $listCourse = $this->tpl->fetch( - $this->tpl->get_template('/user_portal/classic_courses.tpl')); + if ($viewGridCourses) { + $coursesWithoutCategoryTemplate = '/user_portal/grid_courses_without_category.tpl'; + $coursesWithCategoryTemplate = '/user_portal/grid_courses_with_category.tpl'; + } + + if ($specialCourses) { + $template->assign('courses', $specialCourses); + + $specialCourseList = $template->fetch( + $this->tpl->get_template($coursesWithoutCategoryTemplate) + ); + } + + if ($courses) { + $template->assign('courses', $courses['not_category']); + $template->assign('categories', $courses['in_category']); + + $listCourse = $template->fetch( + $this->tpl->get_template($coursesWithCategoryTemplate) + ); + $listCourse .= $template->fetch( + $this->tpl->get_template($coursesWithoutCategoryTemplate) + ); } $courseCount = count($specialCourses) + count($courses['in_category']) + count($courses['not_category']); @@ -1470,7 +1494,7 @@ class IndexManager } return [ - 'html' => $sessions_with_category.$sessions_with_no_category.$listCourse, + 'html' => $specialCourseList . $sessions_with_category.$sessions_with_no_category.$listCourse, 'session_count' => $sessionCount, 'course_count' => $courseCount ]; diff --git a/main/template/default/user_portal/classic_courses.tpl b/main/template/default/user_portal/classic_courses.tpl deleted file mode 100644 index 2a2c88faf0..0000000000 --- a/main/template/default/user_portal/classic_courses.tpl +++ /dev/null @@ -1,196 +0,0 @@ - -
- {% for item in special_courses %} -
-
-
- -
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - - {{ item.title }} {{ item.code_course }} - - {{ item.notifications }} - {{ 'klipper.png' | img(22, 'CourseAutoRegister'|get_lang ) }} - {% endif %} -

-
- {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} - -
-
-
-
-
- {% endfor %} -
- -
- - {% for category in courses.in_category %} -
-
- {{ category.title_category }} -
-
- {% for item in category.courses %} -
- -
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - - {{ item.title }} {{ item.code_course }} - - {{ item.notifications }} - {% endif %} -

-
- {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} - -
-
-
- {% endfor %} -
-
- {% endfor %} - - - {% for item in courses.not_category %} -
-
-
- -
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - - {{ item.title }} {{ item.code_course }} - - {{ item.notifications }} - {% endif %} -

-
- {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} - -
-
-
-
-
- {% endfor %} - -
diff --git a/main/template/default/user_portal/classic_courses_with_category.tpl b/main/template/default/user_portal/classic_courses_with_category.tpl new file mode 100644 index 0000000000..f3aa21a0e0 --- /dev/null +++ b/main/template/default/user_portal/classic_courses_with_category.tpl @@ -0,0 +1,71 @@ +{% if not categories is empty %} +
+ {% for category in categories %} +
+
+ {{ category.title_category }} +
+
+ {% for item in category.courses %} +
+ +
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
+ {% endif %} +

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + + {{ item.title }} {{ item.code_course }} + + {{ item.notifications }} + {% endif %} +

+
+ {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} + +
+
+
+ {% endfor %} +
+
+ {% endfor %} +
+{% endif %} + diff --git a/main/template/default/user_portal/classic_courses_without_category.tpl b/main/template/default/user_portal/classic_courses_without_category.tpl new file mode 100644 index 0000000000..f5da2ef264 --- /dev/null +++ b/main/template/default/user_portal/classic_courses_without_category.tpl @@ -0,0 +1,68 @@ +{% if not courses is empty %} +
+ {% for item in courses %} +
+
+
+ +
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
+ {% endif %} +

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + + {{ item.title }} {{ item.code_course }} + + {{ item.notifications }} + + {% if item.is_special_course %} + {{ 'klipper.png' | img(22, 'CourseAutoRegister'|get_lang ) }} + {% endif %} + {% endif %} +

+
+ {{ 'teacher.png' | img(16, 'Professor'|get_lang ) }} + +
+
+
+
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/main/template/default/user_portal/grid_courses.tpl b/main/template/default/user_portal/grid_courses.tpl deleted file mode 100644 index 59bdbc4c80..0000000000 --- a/main/template/default/user_portal/grid_courses.tpl +++ /dev/null @@ -1,210 +0,0 @@ - -
-
- {% for item in special_courses %} -
-
-
-
{{ item.icon }}
- - {% if item.category != '' %} - {{ item.category }} -
- {% endif %} -
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - - {% endif %} - {% endfor %} -
-
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -
-
-

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - {{ item.title }} {{ item.code_course }} - {% endif %} -

-
{{ item.notifications }}
- -
-
-
- {% endfor %} -
-
- -
- - {% for category in courses.in_category %} - {% set nameCategory = category.title_category %} - {% set idCategory = category.id_category %} -
-
- {{ nameCategory }} -
-
-
- {% for item in category.courses %} -
-
-
- - {% if item.category != '' %} - {{ item.category }} -
- {% endif %} -
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - - {% endif %} - {% endfor %} -
-
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -
-
-

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - {{ item.title }} {{ item.code_course }} - {% endif %} -

-
{{ item.notifications }}
- -
-
-
- {% endfor %} -
-
-
- {% endfor %} - -
- {% for item in courses.not_category %} -
-
-
- - {% if item.category != '' %} - {{ item.category }} -
- {% endif %} -
-
- {% for teacher in item.teachers %} - {% set counter = counter + 1 %} - {% if counter <= 3 %} - - - - - {% endif %} - {% endfor %} -
-
- {% if item.edit_actions != '' %} -
- {% if item.document == '' %} - - - - {% else %} -
- - - - {{ item.document }} -
- {% endif %} -
- {% endif %} -
-
-

- {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} - {{ item.title }} {{ item.code_course }} - {% else %} - {{ item.title }} {{ item.code_course }} - {% endif %} -

-
{{ item.notifications }}
- -
-
-
- {% endfor %} -
-
- diff --git a/main/template/default/user_portal/grid_courses_with_category.tpl b/main/template/default/user_portal/grid_courses_with_category.tpl new file mode 100644 index 0000000000..489af21afb --- /dev/null +++ b/main/template/default/user_portal/grid_courses_with_category.tpl @@ -0,0 +1,76 @@ +
+ {% for category in courses.in_category %} + {% set nameCategory = category.title_category %} + {% set idCategory = category.id_category %} +
+
+ {{ nameCategory }} +
+
+
+ {% for item in category.courses %} +
+
+
+ + {% if item.category != '' %} + {{ item.category }} +
+ {% endif %} +
+
+ {% for teacher in item.teachers %} + {% set counter = counter + 1 %} + {% if counter <= 3 %} + + + + + {% endif %} + {% endfor %} +
+
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
+ {% endif %} +
+
+

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + {{ item.title }} {{ item.code_course }} + {% endif %} +

+
{{ item.notifications }}
+ +
+
+
+ {% endfor %} +
+
+
+ {% endfor %} +
diff --git a/main/template/default/user_portal/grid_courses_without_category.tpl b/main/template/default/user_portal/grid_courses_without_category.tpl new file mode 100644 index 0000000000..daebb54455 --- /dev/null +++ b/main/template/default/user_portal/grid_courses_without_category.tpl @@ -0,0 +1,71 @@ +{% if not courses is empty %} +
+
+ {% for item in courses %} +
+
+
+ {% if item.is_special_course %} +
{{ item.icon }}
+ {% endif %} + + + {% if item.category != '' %} + {{ item.category }} +
+ {% endif %} +
+
+ {% for teacher in item.teachers %} + {% set counter = counter + 1 %} + {% if counter <= 3 %} + + + + + {% endif %} + {% endfor %} +
+
+ {% if item.edit_actions != '' %} +
+ {% if item.document == '' %} + + + + {% else %} +
+ + + + {{ item.document }} +
+ {% endif %} +
+ {% endif %} +
+
+

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %} + {{ item.title }} {{ item.code_course }} + {% else %} + {{ item.title }} {{ item.code_course }} + {% endif %} +

+
{{ item.notifications }}
+ +
+
+
+ {% endfor %} +
+
+{% endif %}