From 5f679df8e7c35127cd81c2620c2dabe0cdfbeb15 Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Thu, 30 Mar 2017 11:29:34 -0500 Subject: [PATCH 1/9] new css grill --- app/Resources/public/css/base.css | 65 +++++++++++++++++-- .../public/css/themes/chamilo/default.css | 2 +- main/auth/courses_categories.php | 31 ++++++++- 3 files changed, 89 insertions(+), 9 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index 11a6e6fd88..6dc7549255 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4763,26 +4763,29 @@ div#chat-remote-video video { /* position: relative; */ vertical-align: top; white-space: normal; - margin: 0px 5px 15px 0px; + margin: auto; box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); text-align: left; background-color: #fff; - min-height: 250px; border: 1px solid #DFDFDF; border-radius: 5px; margin-bottom: 20px; } .grid-courses .items.items-courses, .grid-courses .items.items-hotcourse{ - min-height: 300px; + min-height: 450px; + width: 310px; +} +.grid-courses .items .block-title{ + margin: 15px 10px 10px 10px; } .grid-courses .items .title{ line-height: 1.4; padding: 0px; - margin: 5px; - font-size: 14px; + font-size: 17px; font-weight: bold; - min-height: 40px; + height: 42px; + margin: 0; } .grid-courses .items .toolbar{ text-align: right; @@ -4808,6 +4811,7 @@ div#chat-remote-video video { } .grid-courses .items .ranking{ font-size: 10px; + margin: 10px; } .grid-courses .items .image .black-shadow{ top: 0px; @@ -4891,6 +4895,55 @@ div#chat-remote-video video { .grid-courses .items .author-card .teachers-details h5 a{ color: #fff; } + +/*---- */ +.grid-courses .items .block-author{ + display: flex; + margin-top: 5px; + margin-left: 5px; +} +.grid-courses .items .block-author img{ + border: 2px solid #fff; +} +.grid-courses .items .block-author .teachers-details{ + display: flex; + flex-direction: column; + justify-content: center; +} +.grid-courses .items .block-author .teachers-details p{ + font-size: 10px; + margin: 0 10px 0 10px; + padding: 0; +} +.grid-courses .items .block-author .teachers-details h5{ + font-size: 10px; + font-weight: bold; + margin: 0px; + margin-left: 10px; + margin-right: 10px; +} +.grid-courses .items .block-author .teachers-details h5 a{ + color: #666; +} +/* new grid catalog */ +.section-course-wrapper{ + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + margin: auto; + align-items: center; +} +.section-course-wrapper.show-section{ + /* display: -webkit-box !important; */ + /* display: -ms-flexbox !important; */ + display: flex !important; +} /* Catalog session */ .search-session{ diff --git a/app/Resources/public/css/themes/chamilo/default.css b/app/Resources/public/css/themes/chamilo/default.css index 5d26a7d118..e9ad9b3683 100755 --- a/app/Resources/public/css/themes/chamilo/default.css +++ b/app/Resources/public/css/themes/chamilo/default.css @@ -35,7 +35,7 @@ body { } a { - color: #07578A; + color: #0099FF; text-decoration: none; } a:hover, diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 35a07320ec..79e1a18e9b 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -173,7 +173,7 @@ if ($showCourses && $action != 'display_sessions') { $html = null; // display the course bloc - $html .= '
'; + $html .= '
'; $course['category_title'] = ''; if (isset($course['category'])) { @@ -210,6 +210,7 @@ if ($showCourses && $action != 'display_sessions') { // display course title and button bloc $html .= '
'; $html .= return_title($course); + $html .= return_teacher($course); // display button line $html .= '
'; @@ -321,6 +322,32 @@ function returnThumbnail($course) return $html; } +function return_teacher($course){ + //Info course + $courseInfo = api_get_course_info($course['code']); + $teachers = CourseManager::getTeachersFromCourse($courseInfo['real_id']); + //$count = 0; + $html = null; + $html .= '
'; + $length = count($teachers); + foreach ($teachers as $value) { + $name = $value['firstname'].' ' . $value['lastname']; + if ($length > 2) { + $html .= ' + '; + } else { + $html .= ' + '; + $html .= '
+ ' + . $name . '

'. get_lang('Teacher').'

'; + } + //$count ++; + } + $html .= '
'; + return $html; +} + /** * Display the title of a course in course catalog * @param $course @@ -333,7 +360,7 @@ function return_title($course) $title = cut($course['title'], 70); $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); - $html .= '

' . cut($title, 60) . '

'; + $html .= ''; $html .= '
'. $rating . '
'; return $html; From f0734fecd021893e6d38a2f7a8127b7f0e0c26c7 Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Fri, 31 Mar 2017 17:49:33 -0500 Subject: [PATCH 2/9] Correction in link when the user is not registered --- app/Resources/public/css/base.css | 2 +- main/auth/courses_categories.php | 41 +++++++++++++++---------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index 6dc7549255..bd86a716dd 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4773,7 +4773,7 @@ div#chat-remote-video video { } .grid-courses .items.items-courses, .grid-courses .items.items-hotcourse{ - min-height: 450px; + min-height: 425px; width: 310px; } .grid-courses .items .block-title{ diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 79e1a18e9b..a17abe9a80 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -233,7 +233,7 @@ if ($showCourses && $action != 'display_sessions') { if ($course_unsubscribe_allowed) { $html .= return_unregister_button($course, $stok, $search_term, $code); } - $html .= return_already_registered_label('teacher'); + //$html .= return_already_registered_label('teacher'); } else { // if user not registered in the course @@ -280,6 +280,8 @@ function returnThumbnail($course) { $html = ''; $title = cut($course['title'], 70); + $linkCourse = api_get_course_url($course['code']); + // course path $course_path = api_get_path(SYS_COURSE_PATH).$course['directory']; @@ -291,30 +293,19 @@ function returnThumbnail($course) } $html .= '
'; - $html .= ''.api_htmlentities($title).''; + + if($course['visibility'] == COURSE_VISIBILITY_REGISTERED){ + $html .= ''.api_htmlentities($title).''; + }else{ + $html .= ''.api_htmlentities($title).''; + } + $categoryTitle = isset($course['category_title']) ? $course['category_title'] : ''; if (!empty($categoryTitle)) { $html .= ''. $categoryTitle.''; $html .= '
'; } - $courseInfo = api_get_course_info($course['code']); - $teachers = CourseManager::getTeachersFromCourse($courseInfo['real_id']); - $html .= '
'; - $html .= '
'; - $count = 0; - foreach ($teachers as $value) { - if ($count > 2) { - break; - } - $name = $value['firstname'].' ' . $value['lastname']; - $html .= ' - '; - $html .= ''; - $count ++; - } - $html .= '
'; + $html .= '
'; @@ -360,7 +351,15 @@ function return_title($course) $title = cut($course['title'], 70); $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); - $html .= ''; + $html .= '

'; + + if ($course['visibility'] == COURSE_VISIBILITY_REGISTERED){ + $html .= cut($title, 45); + } else { + $html .= '' . cut($title, 45) . ''; + } + + $html .= '

'; $html .= '
'. $rating . '
'; return $html; From 44b404a0ab1a403cdda68f7d734e0e57bbab129c Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Fri, 31 Mar 2017 18:30:15 -0500 Subject: [PATCH 3/9] Course Visibility Arrangement --- app/Resources/public/css/base.css | 6 ++++-- main/auth/courses_categories.php | 21 ++++++++++---------- main/template/default/layout/hot_courses.tpl | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index bd86a716dd..3340467a68 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4771,11 +4771,13 @@ div#chat-remote-video video { border-radius: 5px; margin-bottom: 20px; } -.grid-courses .items.items-courses, -.grid-courses .items.items-hotcourse{ +.grid-courses .items.items-courses{ min-height: 425px; width: 310px; } +.grid-courses .items.items-hotcourse{ + min-height: 360px; +} .grid-courses .items .block-title{ margin: 15px 10px 10px 10px; } diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index a17abe9a80..697b517c81 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -158,9 +158,10 @@ if ($showCourses && $action != 'display_sessions') { continue; } - $user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); - $user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']); - $user_registerd_in_course_as_student = ($user_registerd_in_course && !$user_registerd_in_course_as_teacher); + $userRegisterdInCourse = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); + $userRegisterdInCourseAsTeacher = CourseManager::is_course_teacher($user_id, $course['code']); + $userRegisterd = ($userRegisterdInCourse && $userRegisterdInCourseAsTeacher); + $course_public = ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD); $course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM); $course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED); @@ -181,7 +182,7 @@ if ($showCourses && $action != 'display_sessions') { } // display thumbnail - $html .= returnThumbnail($course); + $html .= returnThumbnail($course, $userRegisterd); $separator = '
 
'; $subscribeButton = return_register_button($course, $stok, $code, $search_term); @@ -209,7 +210,7 @@ if ($showCourses && $action != 'display_sessions') { // display course title and button bloc $html .= '
'; - $html .= return_title($course); + $html .= return_title($course, $userRegisterd); $html .= return_teacher($course); // display button line @@ -276,7 +277,7 @@ echo $cataloguePagination; * * @return string HTML string */ -function returnThumbnail($course) +function returnThumbnail($course, $registeredUser) { $html = ''; $title = cut($course['title'], 70); @@ -294,7 +295,7 @@ function returnThumbnail($course) $html .= '
'; - if($course['visibility'] == COURSE_VISIBILITY_REGISTERED){ + if(!$registeredUser){ $html .= ''.api_htmlentities($title).''; }else{ $html .= ''.api_htmlentities($title).''; @@ -344,7 +345,7 @@ function return_teacher($course){ * @param $course * @return string HTML string */ -function return_title($course) +function return_title($course, $registeredUser) { $html = ''; $linkCourse = api_get_course_url($course['code']); @@ -353,7 +354,7 @@ function return_title($course) $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); $html .= '

'; - if ($course['visibility'] == COURSE_VISIBILITY_REGISTERED){ + if (!$registeredUser){ $html .= cut($title, 45); } else { $html .= '' . cut($title, 45) . ''; @@ -431,7 +432,7 @@ function return_already_registered_label($in_status) function return_register_button($course, $stok, $code, $search_term) { $html = ' ' . - Display::returnFontAwesomeIcon('sign-in') . ''; + get_lang('Subscribe') .' '. Display::returnFontAwesomeIcon('sign-in') . ''; return $html; } diff --git a/main/template/default/layout/hot_courses.tpl b/main/template/default/layout/hot_courses.tpl index f7c66df3aa..64d1d017e1 100755 --- a/main/template/default/layout/hot_courses.tpl +++ b/main/template/default/layout/hot_courses.tpl @@ -33,7 +33,7 @@ $(document).ready( function() { {% endif %}

-
+
{% include template ~ '/layout/hot_course_item.tpl' %}
From e473bd26e371f3033dae9635cfee8cc58475e13a Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Thu, 6 Apr 2017 17:03:55 -0500 Subject: [PATCH 4/9] grid fix student course list --- app/Resources/public/css/base.css | 42 +++++------ main/auth/courses_categories.php | 4 +- main/inc/lib/course.lib.php | 3 +- .../grid_courses_without_category.tpl | 73 +++++++++++-------- 4 files changed, 64 insertions(+), 58 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index d75ecf3e31..eb9edcc315 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4796,13 +4796,23 @@ div#chat-remote-video video { border-radius: 5px; margin-bottom: 20px; } +.grid-courses .items.my-courses{ + min-height: 320px; + box-shadow: 2px 4px 15px 0 rgba(46,61,73,.1); + transition: box-shadow .3s ease , border .3s ease; +} +.grid-courses .items.my-courses .title{ + font-size: 14px; +} .grid-courses .items.items-courses{ min-height: 425px; width: 310px; box-shadow: 2px 4px 15px 0 rgba(46,61,73,.1); transition: box-shadow .3s ease , border .3s ease; } -.grid-courses .items.items-courses:hover{ +.grid-courses .items.items-courses:hover, +.grid-courses .items.my-courses:hover, +.grid-courses .items.items-hotcourse:hover{ box-shadow: 4px 5px 20px 0 rgba(46,61,73,.15); transition: box-shadow .3s ease , border .3s ease; } @@ -4811,10 +4821,6 @@ div#chat-remote-video video { box-shadow: 2px 4px 15px 0 rgba(46,61,73,.1); transition: box-shadow .3s ease , border .3s ease; } -.grid-courses .items.items-hotcourse:hover{ - box-shadow: 4px 5px 20px 0 rgba(46,61,73,.15); - transition: box-shadow .3s ease , border .3s ease; -} .grid-courses .items .block-title{ margin: 15px 10px 10px 10px; } @@ -4860,32 +4866,18 @@ div#chat-remote-video video { font-size: 10px; margin: 10px; } -.grid-courses .items .image .black-shadow{ - top: 0px; - left: 0px; - width: 100%; - height: 100%; - padding-top: 40px; - opacity: 0; - box-sizing: border-box; - position: absolute; - background: rgba(0, 0, 0, 0.7) none repeat scroll 0% 0%; - padding: 10px; -} -.grid-courses .items .image .hovered-course{ - opacity: 1; - transition: all 0.3s ease 0s; -} .grid-courses .items .notifications{ padding-top: 5px; text-align: center; } -.grid-courses .items .admin-actions, .grid-courses .items .user-actions{ +.grid-courses .items .admin-actions, +.grid-courses .items .user-actions{ position: absolute; bottom: 0px; left: 0px; } -.grid-courses .items .admin-actions .btn-sm,.grid-courses .items .user-actions .btn-sm{ +.grid-courses .items .admin-actions .btn-sm, +.grid-courses .items .user-actions .btn-sm{ border-radius: 0; border: none; } @@ -4945,7 +4937,6 @@ div#chat-remote-video video { .grid-courses .items .author-card .teachers-details h5 a{ color: #fff; } - /*---- */ .grid-courses .items .block-author{ display: flex; @@ -6337,6 +6328,9 @@ ul#toolnavbox-two li a.btn{ .navbar-nav{ margin: -2.5px -15px; } + .grid-courses .items.my-courses{ + width: 310px; + } } @media (min-width:320px) and (max-width: 479px){ footer { diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 685f331280..5d109e8c0d 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -221,7 +221,7 @@ if ($showCourses && $action != 'display_sessions') { $html .= '
'; $html .= '
'; // if user registered as student - if ($user_registerd_in_course_as_student) { + if ($userRegisterdInCourse) { $html .= return_already_registered_label('student'); if (!$course_closed) { @@ -229,7 +229,7 @@ if ($showCourses && $action != 'display_sessions') { $html .= return_unregister_button($course, $stok, $search_term, $code); } } - } elseif ($user_registerd_in_course_as_teacher) { + } elseif ($userRegisterdInCourseAsTeacher) { // if user registered as teacher if ($course_unsubscribe_allowed) { $html .= return_unregister_button($course, $stok, $search_term, $code); diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index b25c714f41..de5cc1097c 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3673,7 +3673,7 @@ class CourseManager if ($coursesNotCategory) { $listItems['not_category'] = $coursesNotCategory; } - + return $listItems; } @@ -3818,6 +3818,7 @@ class CourseManager $params['thumbnails'] = $thumbnails; $params['image'] = $image; $params['title'] = $course_info['title']; + $params['title_cut'] = cut($course_info['title'],45); $params['category'] = $course_info['categoryName']; $params['teachers'] = $teachers; diff --git a/main/template/default/user_portal/grid_courses_without_category.tpl b/main/template/default/user_portal/grid_courses_without_category.tpl index 4278655010..5ab36d86bf 100644 --- a/main/template/default/user_portal/grid_courses_without_category.tpl +++ b/main/template/default/user_portal/grid_courses_without_category.tpl @@ -3,38 +3,23 @@
{% for item in courses %}
-
+
{% if item.is_special_course %}
{{ item.icon }}
{% endif %} - - + {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') and not item.current_user_is_teacher %} + + {% else %} + + {{ item.title }} + + {% 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 == '' %} @@ -53,13 +38,39 @@ {% endif %}
-

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

+
+

+ {% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') and not item.current_user_is_teacher %} + {{ item.title_cut }} {{ item.code_course }} + {% else %} + {{ item.title_cut }} {{ item.code_course }} + {% endif %} +

+
+
+ {% for teacher in item.teachers %} + {% if item.teachers | length > 2 %} + + + + {% else %} + + + +
+
+ + {{ teacher.firstname }} {{ teacher.lastname }} + +
+

{{ 'Teacher' | get_lang }}

+
+ {% endif %} + {% endfor %} +
{{ item.notifications }}
{% if item.student_info %} From 8b0e4189c87886e9ed9c82c0b568746cc24900dd Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Thu, 6 Apr 2017 17:59:25 -0500 Subject: [PATCH 5/9] label already registered user --- main/auth/courses_categories.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 5d109e8c0d..776c5a03b2 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -404,16 +404,16 @@ function return_goto_button($course) */ function return_already_registered_label($in_status) { - $icon = ''; + $icon = ''; $title = get_lang("YouAreATeacherOfThisCourse"); if ($in_status == 'student') { - $icon = ''; - $title = get_lang("AlreadyRegisteredToCourse"); + $icon = ''; + $title = get_lang("AlreadySubscribed"); } $html = Display::tag( 'button', - $icon, + $icon . ' ' . $title, array('id' => 'register', 'class' => 'btn btn-default btn-sm', 'title' => $title) ); From 4345978251078bd69206830b967d72a174a43c9a Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Fri, 7 Apr 2017 18:29:17 -0500 Subject: [PATCH 6/9] fix for code climate --- main/auth/courses_categories.php | 24 ++++++++++++++---------- main/inc/lib/course.lib.php | 20 +++++++++++++------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 776c5a03b2..403bee1631 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -295,15 +295,19 @@ function returnThumbnail($course, $registeredUser) $html .= '
'; - if(!$registeredUser){ - $html .= ''.api_htmlentities($title).''; - }else{ - $html .= ''.api_htmlentities($title).''; + if (!$registeredUser) { + $html .= ''.api_htmlentities($title).''; + } else { + $html .= '' + .''; } $categoryTitle = isset($course['category_title']) ? $course['category_title'] : ''; if (!empty($categoryTitle)) { - $html .= ''. $categoryTitle.''; + $html .= ''.$categoryTitle.''; $html .= '
'; } @@ -314,7 +318,7 @@ function returnThumbnail($course, $registeredUser) return $html; } -function return_teacher($course){ +function return_teacher($course) { //Info course $courseInfo = api_get_course_info($course['code']); $teachers = CourseManager::getTeachersFromCourse($courseInfo['real_id']); @@ -332,7 +336,7 @@ function return_teacher($course){ '; $html .= '
' - . $name . '

'. get_lang('Teacher').'

'; + . $name . '

'. get_lang('Teacher').'

'; } //$count ++; } @@ -354,10 +358,10 @@ function return_title($course, $registeredUser) $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); $html .= '

'; - if (!$registeredUser){ - $html .= $title; + if (!$registeredUser) { + $html .= $title; } else { - $html .= '' . $title . ''; + $html .= '' . $title . ''; } $html .= '

'; diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index de5cc1097c..bfa0fe2130 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3818,7 +3818,7 @@ class CourseManager $params['thumbnails'] = $thumbnails; $params['image'] = $image; $params['title'] = $course_info['title']; - $params['title_cut'] = cut($course_info['title'],45); + $params['title_cut'] = cut($course_info['title'], 45); $params['category'] = $course_info['categoryName']; $params['teachers'] = $teachers; @@ -4868,26 +4868,32 @@ class CourseManager //Course visibility if ($access_link && in_array('register', $access_link)) { - $my_course['register_button'] = Display::url(get_lang('Subscribe') . ' ' . + $my_course['register_button'] = Display::url( + get_lang('Subscribe') . ' ' . Display::returnFontAwesomeIcon('sign-in'), api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok, - array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe'))); + array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe')) + ); } if ($access_link && in_array('enter', $access_link) || $course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD ) { - $my_course['go_to_course_button'] = Display::url(get_lang('GoToCourse'). ' ' . + $my_course['go_to_course_button'] = Display::url( + get_lang('GoToCourse'). ' ' . Display::returnFontAwesomeIcon('share'), api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php', - array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse'))); + array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse')) + ); } if ($access_link && in_array('unsubscribe', $access_link)) { - $my_course['unsubscribe_button'] = Display::url(get_lang('Unreg') . ' ' . + $my_course['unsubscribe_button'] = Display::url( + get_lang('Unreg') . ' ' . Display::returnFontAwesomeIcon('sign-out'), api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode, - array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg'))); + array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg')) + ); } // start buycourse validation From ed4ad6cf6e21039d93c4ca339de1ce10d70212bf Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Mon, 10 Apr 2017 14:12:05 -0500 Subject: [PATCH 7/9] fix course student info --- app/Resources/public/css/base.css | 10 ++++++++-- main/inc/lib/course.lib.php | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index a776ffcf3f..bb4624976e 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4797,13 +4797,20 @@ div#chat-remote-video video { margin-bottom: 20px; } .grid-courses .items.my-courses{ - min-height: 320px; + min-height: 340px; box-shadow: 2px 4px 15px 0 rgba(46,61,73,.1); transition: box-shadow .3s ease , border .3s ease; } +.grid-courses .items.my-courses .course-student-info{ + font-size: 10px; + text-align: center; +} .grid-courses .items.my-courses .title{ font-size: 14px; } +.grid-courses .items.my-courses .block-title{ + margin: 10px; +} .grid-courses .items.items-courses{ min-height: 425px; width: 310px; @@ -4867,7 +4874,6 @@ div#chat-remote-video video { margin: 10px; } .grid-courses .items .notifications{ - padding-top: 5px; text-align: center; } .grid-courses .items .admin-actions, diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index bfa0fe2130..7db6e1d915 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3603,6 +3603,7 @@ class CourseManager } $params['title'] = $course_info['title']; + $params['title_cut'] = cut($course_info['title'], 45); $params['link'] = $course_info['course_public_url'].'?id_session=0&autoreg=1'; if (api_get_setting('display_teacher_in_courselist') === 'true') { $params['teachers'] = self::getTeachersFromCourse($courseId, true); From f1d54c7496868acd10b4095269fdf9a766deaca7 Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Mon, 10 Apr 2017 15:02:31 -0500 Subject: [PATCH 8/9] fix course progress info student --- app/Resources/public/css/base.css | 5 ++++- .../default/user_portal/grid_courses_with_category.tpl | 5 ++++- .../default/user_portal/grid_courses_without_category.tpl | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index cad99ca67b..4dd10cb7a3 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4755,7 +4755,7 @@ div#chat-remote-video video { padding-top: 10px; border-bottom: 1px solid #ECF0F1; } -.course-student-info{ +.grid-courses .items .course-student-info{ background-color: #d9edf7; border: 1px solid #bce8f1; padding: 5px; @@ -4781,6 +4781,9 @@ div#chat-remote-video video { .grid-courses .items.my-courses .course-student-info{ font-size: 10px; text-align: center; + background: none; + border:none; + padding: 0; } .grid-courses .items.my-courses .title{ font-size: 14px; diff --git a/main/template/default/user_portal/grid_courses_with_category.tpl b/main/template/default/user_portal/grid_courses_with_category.tpl index f26e04a627..310d7629bc 100644 --- a/main/template/default/user_portal/grid_courses_with_category.tpl +++ b/main/template/default/user_portal/grid_courses_with_category.tpl @@ -79,7 +79,10 @@ {% endif %} {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + + + {{ item.student_info.certificate }} + {% endif %}
diff --git a/main/template/default/user_portal/grid_courses_without_category.tpl b/main/template/default/user_portal/grid_courses_without_category.tpl index cd52bcf6d7..f971f62f87 100644 --- a/main/template/default/user_portal/grid_courses_without_category.tpl +++ b/main/template/default/user_portal/grid_courses_without_category.tpl @@ -87,7 +87,10 @@ {% endif %} {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + + + {{ item.student_info.certificate }} + {% endif %}
From dc63518ac55f57a6bd2982288325fedfed29d3eb Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Wed, 12 Apr 2017 17:28:45 -0500 Subject: [PATCH 9/9] fix code climate --- main/auth/courses_categories.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 403bee1631..1421e4670c 100755 --- a/main/auth/courses_categories.php +++ b/main/auth/courses_categories.php @@ -318,7 +318,8 @@ function returnThumbnail($course, $registeredUser) return $html; } -function return_teacher($course) { +function return_teacher($course) +{ //Info course $courseInfo = api_get_course_info($course['code']); $teachers = CourseManager::getTeachersFromCourse($courseInfo['real_id']); @@ -355,7 +356,11 @@ function return_title($course, $registeredUser) $linkCourse = api_get_course_url($course['code']); $title = cut($course['title'], 45); $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; - $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); + $rating = Display::return_rating_system( + 'star_'.$course['real_id'], + $ajax_url.'&course_id='.$course['real_id'], + $course['point_info'] + ); $html .= '

'; if (!$registeredUser) {