New Structure for User Sessions List - refs BT#11017

remotes/angel/1.11.x
Alex Aragon 9 years ago
parent eb52a24c7f
commit 558dc57153
  1. 46
      app/Resources/public/css/base.css
  2. 10
      main/inc/lib/course.lib.php
  3. 23
      main/inc/lib/display.lib.php
  4. 64
      main/inc/lib/userportal.lib.php
  5. 4
      main/template/default/auth/session_catalog.tpl
  6. 63
      main/template/default/user_portal/grid_session.tpl
  7. 3
      main/template/default/user_portal/index.tpl
  8. 5
      main/template/default/user_portal/index_grid.tpl

@ -4723,18 +4723,22 @@ div#chat-remote-video video {
}
.grid-courses .items .title{
line-height: 1.4;
font-size: 13px;
min-height: 40px;
font-size: 14px;
padding: 0px;
margin: 5px;
}
.grid-courses .items .toolbar{
text-align: right;
}
.grid-courses .session-date{
.grid-courses .items .toolbar .info{
float: left;
font-size: 12px;
}
.grid-courses .session-date,
.grid-courses .session-info{
color: #fff;
font-size: 12px;
padding: 10px;
padding: 5px 10px;
}
.grid-courses .items .image{
position: relative;
@ -4838,6 +4842,40 @@ div#chat-remote-video video {
color: #fff;
}
/* Catalog session */
.column-session{
column-count: 3;
-moz-column-count: 3;
-webkit-column-count: 3;
}
.column-session .items{
width: 100%;
display: inline-block;
margin-bottom: 1em;
border-radius: 5px;
border: 1px solid #dddddc;
overflow: hidden;
}
.column-session .items .items-header{
background-color: #ECF0F1;
}
.column-session .items .items-header .title{
font-size: 15px;
font-weight: bold;
margin-bottom: 5px;
}
.column-session .items .items-header .info,
.column-session .items .items-header .date{
font-size: 12px;
}
.column-session .items .items-header .info span{
margin-right: 5px;
}
.column-session .items .card-course .list-group .list-group-item{
border: none;
}
.column-session .items .card-course .list-group .list-group-item:first-child{
border-radius: 0;
}
.search-session{
margin-bottom: 30px;
margin-top: 25px;

@ -3958,7 +3958,7 @@ class CourseManager
if ($user_in_course_status == COURSEMANAGER || $sessionCourseAvailable) {
$session_url = $course_info['course_public_url'] . '?id_session=' . $course_info['id_session'];
$session_title = '<h4><a href="' . $session_url. '">'. $course_info['name'] . '</a>'.$notifications.'</h4>';
$session_title = '<a href="' . $session_url. '">'. $course_info['name'] . '</a>'.$notifications;
} else {
$session_title = $course_info['name'];
}
@ -3970,15 +3970,11 @@ class CourseManager
} else {
$session_title = $course_info['name'];
}
$showCustomIcon = api_get_setting('course_images_in_courses_list');
$iconName = basename($course_info['course_image']);
if ($showCustomIcon === 'true' && $iconName != 'course.png') {
$params['icon'] = Display::img(
$course_info['course_image'],
api_htmlentities($course_info['name']),
array()
);
$params['icon'] = $course_info['course_image_large'];
}
$params['link'] = $session_url;

@ -1523,9 +1523,11 @@ class Display
$rs = Database::query($sql);
$session_info = Database::store_result($rs, 'ASSOC');
$session_info = $session_info[0];
$session = array();
$session['category_id'] = $session_info['session_category_id'];
$session['title'] = $session_info['name'];
$session['id_coach'] = $session_info['id_coach'];
$session['coach'] = '';
$session['dates'] = '';
@ -1578,14 +1580,11 @@ class Display
$session_info['access_end_date'] = $session_info['access_end_date'];
}
if ($start && $stop) {
$session['dates'] = Display::tag(
'em',
sprintf(
$session['dates'] = sprintf(
get_lang('FromDateXToDateY'),
api_format_date($start_buffer),
api_format_date($stop_buffer)
)
);
);
} else {
$start_buffer = $stop_buffer = null;
@ -1603,14 +1602,12 @@ class Display
);
}
$session['dates'] = Display::tag(
'em',
"$start_buffer $stop_buffer"
);
$session['dates'] = $start_buffer . " " . $stop_buffer;
}
if ( api_get_setting('show_session_coach') === 'true' ) {
$session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name(
$session['coach'] = api_get_person_name(
$session_info['firstname'],
$session_info['lastname']
);
@ -1619,7 +1616,9 @@ class Display
}
$session['active'] = $active;
$session['session_category_id'] = $session_info['session_category_id'];
$session['visibility'] = $session_info['visibility'];
$session['num_users'] = $session_info['nbr_users'];
$session['num_courses'] = $session_info['nbr_courses'];
$session['description'] = $session_info['description'];
$session['show_description'] = $session_info['show_description'];

@ -1205,29 +1205,35 @@ class IndexManager
);
$session_box = Display::get_session_title_box($session_id);
$extra_info = !empty($session_box['coach']) ? $session_box['coach'] : null;
$extra_info .= !empty($session_box['coach'])
? ' - ' . $session_box['dates']
: $session_box['dates'];
$extra_info .= isset($session_box['duration'])
? ' ' . $session_box['duration']
: null;
$params['extra_fields'] = $session_box['extra_fields'];
$params['course_list_session_style'] = $coursesListSessionStyle;
$params['title'] = $session_box['title'];
$params['subtitle'] = $extra_info;
$params['show_actions'] = api_is_platform_admin() ? true : false;
if (api_get_setting('hide_courses_in_sessions') == 'false') {
// $params['extra'] .= $html_courses_session;
$actions = null;
if (api_is_platform_admin()) {
$actions = api_get_path(WEB_CODE_PATH) .'session/resume_session.php?id_session='.$session_id;
}
$params['description'] = $session_box['description'];
$coachId = $session_box['id_coach'];
$extraFieldValue = new ExtraFieldValue('session');
$imageField = $extraFieldValue->get_values_by_handler_and_field_variable($session_id, 'image');
$params['category_id'] = $session_box['category_id'];
$params['title'] = $session_box['title'];
//$params['subtitle'] = $extra_info;
$params['id_coach'] = $coachId;
$params['coach_url'] = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coachId;
$params['coach_name'] = !empty($session_box['coach']) ? $session_box['coach'] : null;
$params['coach_avatar'] =UserManager::getUserPicture($coachId, USER_IMAGE_SIZE_SMALL);
$params['date'] = $session_box['dates'];
$params['image'] = isset($imageField['value']) ? $imageField['value'] : null;
$params['duration'] = isset($session_box['duration']) ? ' ' . $session_box['duration'] : null;
$params['edit_actions'] = $actions;
$params['show_description'] = $session_box['show_description'];
$params['courses'] = $html_courses_session;
$params['description'] = $session_box['description'];
$params['visibility'] = $session_box['visibility'];
$params['show_simple_session_info'] = false;
$params['course_list_session_style'] = $coursesListSessionStyle;
$params['num_users'] = $session_box['num_users'];
$params['num_courses'] = $session_box['num_courses'];
$params['courses'] = $html_courses_session;
//$params['extra_fields'] = $session_box['extra_fields'];
if (
isset($_configuration['show_simple_session_info']) &&
@ -1241,14 +1247,20 @@ class IndexManager
$params['progress'] = GamificationUtils::getSessionProgress($params['id'], $this->user_id);
$params['points'] = GamificationUtils::getSessionPoints($params['id'], $this->user_id);
}
$this->tpl->assign('session', $params);
$listSession[] = $params;
$this->tpl->assign('session', $listSession);
$this->tpl->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false));
$this->tpl->assign('gamification_mode', $gamificationModeIsActive);
$sessions_with_no_category .= $this->tpl->fetch(
$this->tpl->get_template('/user_portal/session.tpl')
);
if (api_get_configuration_value('view_grid_courses')){
$sessions_with_no_category = $this->tpl->fetch(
$this->tpl->get_template('/user_portal/grid_session.tpl')
);
} else {
$sessions_with_no_category = $this->tpl->fetch(
$this->tpl->get_template('/user_portal/session.tpl')
);
}
$sessionCount++;
}
}

@ -99,6 +99,10 @@
</a>
</h4>
<div class="toolbar">
<div class="info">
<span><i class="fa fa-book" aria-hidden="true"></i> {{ item.nbr_courses }} {{ 'Courses'|get_lang }}</span>
<span><i class="fa fa-user" aria-hidden="true"></i> {{ item.nbr_users }} {{ 'NbUsers'|get_lang }} </span>
</div>
{% if not _u.logged %}
&nbsp;
{% else %}

@ -0,0 +1,63 @@
{% for row in session %}
<div id="session-{{ item.id }}" class="panel panel-default">
<div class="panel-heading">
<img id="session_img_{{ row.id }}" src="{{ "window_list.png"|icon(32) }}" width="32" height="32" alt="{{ row.title }}" title="{{ row.title }}" /> {{ row.title }}
{% if row.edit_actions != '' %}
<div class="pull-right">
<a class="btn btn-default btn-sm" href="{{ row.edit_actions }}">
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
</div>
{% endif %}
</div>
<div class="panel-body">
<div class="grid-courses">
<div class="row">
{% for item in row.courses %}
<div class="col-md-4 col-sm-4 col-xs-6">
<div class="items">
<div class="image">
<img src="{{ item.icon }}" class="img-responsive">
{% if item.category != '' %}
<span class="category">{{ item.category }}</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>
</div>
</div>
<div class="description">
<h4 class="title">
{% if item.visibility == constant('COURSE_VISIBILITY_CLOSED') %}
{{ item.title }} {{ item.code_course }}
{% else %}
<a href="{{ item.link }}">{{ item.title }} {{ item.code_course }}</a>
{% endif %}
</h4>
<div class="notifications">{{ item.notifications }}</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}

@ -1,3 +0,0 @@
{% for item in items %}
{{ item }}
{% endfor %}

@ -1,5 +0,0 @@
{% for item in items %}
<div class="well">
{{ item }}
</div>
{% endfor %}
Loading…
Cancel
Save