Improve the design of the most popular session and course

pull/2483/head
Alex Aragón 8 years ago
parent dc5ddfaeb5
commit b45fbc4e7a
  1. 3
      app/Resources/public/css/base.css
  2. 2
      main/inc/lib/course.lib.php
  3. 11
      main/inc/lib/sessionmanager.lib.php
  4. 52
      main/template/default/layout/hot_course_item.tpl
  5. 34
      main/template/default/session/sessions_current.tpl

@ -5174,7 +5174,6 @@ div#chat-remote-video video {
.hot-courses .grid-courses .items .title{
padding: 0px;
font-size: 15px;
font-weight: bold;
margin: 0;
}
@ -5262,7 +5261,7 @@ div#chat-remote-video video {
right: -10px;
}
.grid-courses .items .description{
padding: 5px 10px;
padding: 5px 10px 15px;
}
.grid-courses .items .description .text{
font-size: 12px;

@ -6590,7 +6590,7 @@ class CourseManager
$title = $course['title'];
$url = api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'];
$html = Display::url(
Display::returnFontAwesomeIcon('info-circle', 2),
Display::returnFontAwesomeIcon('info-circle', 'lg'),
$url,
[
'class' => 'ajax btn btn-default btn-sm',

@ -3253,11 +3253,20 @@ class SessionManager
ORDER BY 9 DESC
LIMIT 8";
$result = Database::query($sql);
$plugin = BuyCoursesPlugin::create();
$checker = $plugin->isEnabled();
if (Database::num_rows($result) > 0) {
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($checker) {
$row['on_sale'] = $plugin->getItemByProduct(
$row['id'],
BuyCoursesPlugin::PRODUCT_TYPE_SESSION
);
}
$sessions[] = $row;
}
return $sessions;
} else {
return false;

@ -19,11 +19,11 @@
<div class="description">
<div class="block-title">
{% if item.is_registered or _u.is_admin %}
<h4 class="title">
<h5 class="title">
<a alt="{{ item.title }}" title="{{ item.title }}" href="{{ item.course_public_url }}">
{{ item.title_cut}}
</a>
</h4>
</h5>
{% else %}
<h4 class="title" title="{{ item.title }}">
{{ item.title_cut}}
@ -33,54 +33,6 @@
<div class="ranking">
{{ item.rating_html }}
</div>
<div class="block-author">
{% if item.teachers | length > 6 %}
<a id="plist-{{ loop.index }}" data-trigger="focus" tabindex="0" role="button" class="btn btn-default panel_popover" data-toggle="popover" title="{{ 'CourseTeachers' | get_lang }}" data-html="true">
<em class="fa fa-graduation-cap" aria-hidden="true"></em>
</a>
<div id="popover-content-plist-{{ loop.index }}" class="hide">
{% for teacher in item.teachers %}
<div class="popover-teacher">
<a href="{{ teacher.url }}" class="ajax"
data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
<img src="{{ teacher.avatar }}" alt="{{ teacher.fullname }}"/>
</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>
</div>
{% endfor %}
</div>
{% else %}
{% for teacher in item.teachers %}
{% if item.teachers | length <= 2 %}
<a href="{{ teacher.url }}" class="ajax"
data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
<img src="{{ teacher.avatar }}" alt="{{ teacher.fullname }}"/>
</a>
<div class="teachers-details">
<h5>
<a href="{{ teacher.url }}" class="ajax"
data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
{{ teacher.firstname }} {{ teacher.lastname }}
</a>
</h5>
<p>{{ 'Teacher' | get_lang }}</p>
</div>
{% elseif item.teachers | length <= 6 %}
<a href="{{ teacher.url }}" class="ajax"
data-title="{{ teacher.firstname }} {{ teacher.lastname }}">
<img src="{{ teacher.avatar }}" alt="{{ teacher.fullname }}"/>
</a>
{% endif %}
{% endfor %}
{% endif %}
</div>
<div class="toolbar row">
<div class="col-sm-4">
{% if item.price %}

@ -6,7 +6,6 @@
</h4>
</div>
<div class="row">
<!-- Esto repite para mostar 8 sessiones recientes -->
{% for session in hot_sessions %}
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="items items-hotcourse">
@ -24,31 +23,34 @@
title="title-session">{{ session.name }}</a>
</h5>
</div>
<div class="block-author">
{{ dump(session) }}
<a href="{{ _p.web_main }}inc/ajax/user_manager.ajax.php?a=get_user_popup&user_id={{ session.id_coach }}"
class="ajax" data-title="{{ session.firstname }} {{ session.lastname }}">
<img src="{{ session.avatar }}"/>
</a>
<div class="teachers-details">
<h5>
<a href="#">{{ session.firstname }} {{ session.lastname }}</a>
</h5>
<p>{{ 'Teacher'|get_lang }}</p>
</div>
</div>
<div class="block-info">
<i class="fa fa-user"></i> {{ session.users }} {{ "Users"|get_lang }}
&nbsp;
&nbsp;
<i class="fa fa-book"></i> {{ session.lessons }} {{ "Learnpaths"|get_lang }}
</div>
{% if session.on_sale != false %}
<div class="toolbar">
<div class="buycourses-price">
<span class="label label-primary label-price">
<strong>{{ session.on_sale.iso_code }} {{ session.on_sale.price }}</strong>
</span>
</div>
</div>
{% else %}
<div class="toolbar">
<div class="buycourses-price">
<span class="label label-primary label-free">
<strong>{{ 'Free'|get_plugin_lang('BuyCoursesPlugin') }}</strong>
</span>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
<!-- Fin de 8 sessiones recientes -->
</div>
</section>
{% endif %}
Loading…
Cancel
Save