fix css grid hot courses BT#11017

ofaj
Alex Aragon 9 years ago
parent 73b76c5a93
commit 75813e6d20
  1. 3
      app/Resources/public/css/base.css
  2. 24
      main/inc/lib/course.lib.php
  3. 72
      main/template/default/layout/hot_course_item.tpl
  4. 2
      main/template/default/layout/hot_courses.tpl

@ -4896,6 +4896,9 @@ div#chat-remote-video video {
right: -10px;
z-index: 2;
}
.grid-courses .items .ranking{
font-size: 10px;
}
.grid-courses .items .image .black_shadow{
top: 0px;
left: 0px;

@ -4867,7 +4867,7 @@ class CourseManager
* @param int $limit number of hottest courses
* @return array
*/
public static function return_hot_courses($days = 30, $limit = 5)
public static function return_hot_courses($days = 30, $limit = 6)
{
if (api_is_invitee()) {
return array();
@ -4919,7 +4919,7 @@ class CourseManager
$courses = Database::store_result($result, 'ASSOC');
$courses = self::process_hot_course_item($courses, $my_course_code_list);
}
return $courses;
}
@ -4940,9 +4940,9 @@ class CourseManager
$course_info = api_get_course_info_by_id($courseId['c_id']);
$courseCode = $course_info['code'];
$categoryCode = !empty($course_info['categoryCode']) ? $course_info['categoryCode'] : "";
$my_course['extra_info'] = $course_info;
$my_course['extra_info']['go_to_course_button'] = '';
$my_course['extra_info']['register_button'] = '';
$my_course = $course_info;
$my_course['go_to_course_button'] = '';
$my_course['register_button'] = '';
$access_link = self::get_access_link_by_user(
api_get_user_id(),
@ -4952,7 +4952,7 @@ class CourseManager
//Course visibility
if ($access_link && in_array('register', $access_link)) {
$my_course['extra_info']['register_button'] = Display::url(
$my_course['register_button'] = Display::url(
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')));
@ -4961,25 +4961,25 @@ class CourseManager
if ($access_link && in_array('enter',
$access_link) || $course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD
) {
$my_course['extra_info']['go_to_course_button'] = Display::url(
$my_course['go_to_course_button'] = Display::url(
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')));
}
if ($access_link && in_array('unsubscribe', $access_link)) {
$my_course['extra_info']['unsubscribe_button'] = Display::url(
$my_course['unsubscribe_button'] = Display::url(
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')));
}
//Description
$my_course['extra_info']['description_button'] = '';
$my_course['description_button'] = '';
/* if ($course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || in_array($course_info['real_id'],
$my_course_code_list)
) { */
$my_course['extra_info']['description_button'] = Display::url(
$my_course['description_button'] = Display::url(
Display::returnFontAwesomeIcon('info-circle'),
api_get_path(WEB_AJAX_PATH) . 'course_home.ajax.php?a=show_course_information&code=' . $course_info['code'],
[
@ -4990,9 +4990,9 @@ class CourseManager
);
//}
/* get_lang('Description') */
$my_course['extra_info']['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($course_info['code']);
$my_course['teachers'] = CourseManager::getTeacheCourseCode($course_info['code']);
$point_info = self::get_course_ranking($course_info['real_id'], 0);
$my_course['extra_info']['rating_html'] = Display::return_rating_system('star_' . $course_info['real_id'],
$my_course['rating_html'] = Display::return_rating_system('star_' . $course_info['real_id'],
$ajax_url . '&course_id=' . $course_info['real_id'], $point_info);
$hotCourses[] = $my_course;

@ -1,27 +1,49 @@
{% for hot_course in hot_courses %}
{% if hot_course.extra_info.title %}
<div class="col-md-4">
<div class="items-course">
<div class="items-course-image">
<a href="{{ hot_course.extra_info.course_public_url }}"><img class="img-responsive" src="{{ hot_course.extra_info.course_image_large }}" alt="{{ hot_course.extra_info.title|e }}"/></a>
</div>
<div class="items-course-info">
<h4 class="title">
<a title="{{ hot_course.extra_info.title}}" href="{{ hot_course.extra_info.course_public_url }}">{{ hot_course.extra_info.title}}</a>
</h4>
<div class="teachers">{{ hot_course.extra_info.teachers }}</div>
<div class="ranking">
{{ hot_course.extra_info.rating_html }}
</div>
<div class="toolbar">
<div class="btn-group" role="group">
{{ hot_course.extra_info.description_button }}
{{ hot_course.extra_info.register_button }}
{{ hot_course.extra_info.unsubscribe_button }}
</div>
</div>
</div>
</div>
{% for item in hot_courses %}
{% if item.title %}
<div class="col-md-4 col-sm-4 col-xs-6">
<div class="items">
<div class="image">
<img src="{{ item.course_image_large }}" class="img-responsive">
{% if item.categoryName != '' %}
<span class="category">{{ item.categoryName }}</span>
<div class="cribbon"></div>
{% endif %}
<div class="black_shadow">
<div class="author-card">
{% for teacher in item.teachers %}
{% set counter = counter + 1 %}
{% if counter <= 3 %}
<a href="{{ teacher.url }}" class="ajax" data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
<img src="{{ teacher.avatar }}"/>
</a>
<div class="teachers-details">
<h5>
<a href="{{ teacher.url }}" class="ajax" data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
{{ teacher.firstname }} {{ teacher.lastname }}
</a>
</h5>
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="description">
<h4 class="title">
<a title="{{ item.title}}" href="{{ item.course_public_url }}">{{ item.title}}</a>
</h4>
<div class="ranking">
{{ item.rating_html }}
</div>
<div class="toolbar">
<div class="btn-group" role="group">
{{ item.description_button }}
{{ item.register_button }}
{{ item.unsubscribe_button }}
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}

@ -33,7 +33,7 @@ $(document).ready( function() {
{% endif %}
</h4>
</div>
<div id="hot-course">
<div class="grid-courses">
<div class="row">
{% include template ~ '/layout/hot_course_item.tpl' %}
</div>

Loading…
Cancel
Save