Minor - update from 1.11.x

pull/2635/head
Julio Montoya 7 years ago
parent a29a50dd78
commit 6b5d3d779a
  1. 117
      main/template/default/learnpath/list.html.twig
  2. 81
      main/template/default/learnpath/scorm_list.html.twig
  3. 15
      main/template/default/learnpath/view.html.twig

@ -7,9 +7,6 @@
} }
} }
</script> </script>
{{ introduction_section }}
{% set configuration = 'lp_category_accordion'|api_get_configuration_value %} {% set configuration = 'lp_category_accordion'|api_get_configuration_value %}
<div class="lp-accordion panel-group" id="lp-accordion" role="tablist" aria-multiselectable="true"> <div class="lp-accordion panel-group" id="lp-accordion" role="tablist" aria-multiselectable="true">
{% for lp_data in data %} {% for lp_data in data %}
@ -29,12 +26,14 @@
{% if lp_data.category.getId() > 0 %} {% if lp_data.category.getId() > 0 %}
{% if not _c.session_id %} {% if not _c.session_id %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Edit"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Edit"|get_lang }}">
<img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}"> <img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
</a> </a>
{% if subscription_settings.allow_add_users_to_lp_category %} {% if subscription_settings.allow_add_users_to_lp_category %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}" title="{{ "AddUsers"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}"
title="{{ "AddUsers"|get_lang }}">
<img src="{{ "user.png"|icon }}" alt="{{ "AddUsers"|get_lang }}"> <img src="{{ "user.png"|icon }}" alt="{{ "AddUsers"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -44,7 +43,8 @@
<img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% else %} {% else %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Move"|get_lang }}">
<img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -54,7 +54,8 @@
<img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% else %} {% else %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Move"|get_lang }}">
<img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -75,7 +76,8 @@
{% if lp_data.category_is_published == 0 %} {% if lp_data.category_is_published == 0 %}
<a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}" <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
title="{{ 'LearnpathPublish'|get_lang }}"> title="{{ 'LearnpathPublish'|get_lang }}">
<img src="{{ 'lp_publish_na.png'|icon }}" alt="{{ 'LearnpathPublish'|get_lang }}"> <img src="{{ 'lp_publish_na.png'|icon }}"
alt="{{ 'LearnpathPublish'|get_lang }}">
</a> </a>
{% else %} {% else %}
<a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}" <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
@ -84,7 +86,8 @@
</a> </a>
{% endif %} {% endif %}
{% if not _c.session_id %} {% if not _c.session_id %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Delete"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Delete"|get_lang }}">
<img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}"> <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -110,7 +113,6 @@
{% if not is_invitee %} {% if not is_invitee %}
<th>{{ "Progress"|get_lang }}</th> <th>{{ "Progress"|get_lang }}</th>
{% endif %} {% endif %}
<th>{{ "Actions"|get_lang }}</th> <th>{{ "Actions"|get_lang }}</th>
{% endif %} {% endif %}
</tr> </tr>
@ -162,6 +164,8 @@
{{ row.action_pdf }} {{ row.action_pdf }}
{{ row.action_delete }} {{ row.action_delete }}
{{ row.action_order }} {{ row.action_order }}
{{ row.action_update_scorm }}
{{ row.action_export_to_course_build }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -173,6 +177,7 @@
{% else %} {% else %}
<!-- new view block accordeon --> <!-- new view block accordeon -->
{% if lp_data.category.id == 0 %} {% if lp_data.category.id == 0 %}
{% if is_allowed_to_edit %}
{% if lp_data.lp_list %} {% if lp_data.lp_list %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
@ -241,6 +246,7 @@
{{ row.action_pdf }} {{ row.action_pdf }}
{{ row.action_delete }} {{ row.action_delete }}
{{ row.action_order }} {{ row.action_order }}
{{ row.action_update_scorm }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -248,25 +254,49 @@
</table> </table>
</div> </div>
{% endif %} {% endif %}
{% else %}
<div id="not-category" class="panel panel-default">
<div class="panel-body">
{% for row in lp_data.lp_list %}
<div class="lp-item">
<div class="row">
<div class="col-md-8">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
<a href="{{ row.url_start }}">
{{ row.title }}
{{ row.session_image }}
{{ row.extra }}
</a>
</div>
<div class="col-md-3">
{{ row.dsp_progress }}
</div>
<div class="col-md-1">
{{ row.action_pdf }}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endif %} {% endif %}
{% if categories|length > 1 and lp_data.category.id %} {% if categories|length > 1 and lp_data.category.id %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading-{{ lp_data.category.getId() }}"> <div class="panel-heading" role="tab" id="heading-{{ lp_data.category.getId() }}">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#lp-accordion" href="#collapse-{{ lp_data.category.getId() }}" aria-expanded="true" aria-controls="collapse-{{ lp_data.category.getId() }}">
{{ lp_data.category.getName() }}
</a>
</h4>
{% if is_allowed_to_edit %} {% if is_allowed_to_edit %}
<div class="tools-actions pull-right"> <div class="tools-actions pull-right">
{% if lp_data.category.getId() > 0 %} {% if lp_data.category.getId() > 0 %}
{% if not _c.session_id %} {% if not _c.session_id %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Edit"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Edit"|get_lang }}">
<img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}"> <img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
</a> </a>
{% if subscription_settings.allow_add_users_to_lp_category %} {% if subscription_settings.allow_add_users_to_lp_category %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}" title="{{ "AddUsers"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}"
title="{{ "AddUsers"|get_lang }}">
<img src="{{ "user.png"|icon }}" alt="{{ "AddUsers"|get_lang }}"> <img src="{{ "user.png"|icon }}" alt="{{ "AddUsers"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -276,7 +306,8 @@
<img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% else %} {% else %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Move"|get_lang }}">
<img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -286,7 +317,8 @@
<img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% else %} {% else %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_down_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Move"|get_lang }}">
<img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}"> <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
@ -304,10 +336,12 @@
</a> </a>
{% endif %} {% endif %}
{% if lp_data.category_visibility == 1 %}
{% if lp_data.category_is_published == 0 %} {% if lp_data.category_is_published == 0 %}
<a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}" <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
title="{{ 'LearnpathPublish'|get_lang }}"> title="{{ 'LearnpathPublish'|get_lang }}">
<img src="{{ 'lp_publish_na.png'|icon }}" alt="{{ 'LearnpathPublish'|get_lang }}"> <img src="{{ 'lp_publish_na.png'|icon }}"
alt="{{ 'LearnpathPublish'|get_lang }}">
</a> </a>
{% else %} {% else %}
<a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}" <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
@ -315,19 +349,35 @@
<img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}"> <img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
</a> </a>
{% endif %} {% endif %}
{% else %}
<img src="{{ 'lp_publish_na.png'|icon }}"
alt="{{ 'LearnpathPublish'|get_lang }}">
{% endif %}
{% if not _c.session_id %} {% if not _c.session_id %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Delete"|get_lang }}"> <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}"
title="{{ "Delete"|get_lang }}">
<img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}"> <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
</a> </a>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#lp-accordion"
href="#collapse-{{ lp_data.category.getId() }}" aria-expanded="true"
aria-controls="collapse-{{ lp_data.category.getId() }}">
{{ lp_data.category.getName() }}
</a>
</h4>
</div> </div>
<div id="collapse-{{ lp_data.category.getId() }}" class="panel-collapse collapse " role="tabpanel" aria-labelledby="heading-{{ lp_data.category.getId() }}">
<div id="collapse-{{ lp_data.category.getId() }}" class="panel-collapse collapse {{ (categories|length > 1 ? 'in':'') }}"
role="tabpanel" aria-labelledby="heading-{{ lp_data.category.getId() }}">
<div class="panel-body"> <div class="panel-body">
{% if lp_data.lp_list %} {% if lp_data.lp_list %}
{% if is_allowed_to_edit %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
<thead> <thead>
@ -395,12 +445,35 @@
{{ row.action_pdf }} {{ row.action_pdf }}
{{ row.action_delete }} {{ row.action_delete }}
{{ row.action_order }} {{ row.action_order }}
{{ row.action_update_scorm }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
{% else %}
{% for row in lp_data.lp_list %}
<div class="lp-item">
<div class="row">
<div class="col-md-8">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
<a href="{{ row.url_start }}">
{{ row.title }}
{{ row.session_image }}
{{ row.extra }}
</a>
</div>
<div class="col-md-3">
{{ row.dsp_progress }}
</div>
<div class="col-md-1">
{{ row.action_pdf }}
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>

@ -1,10 +1,12 @@
{% if data_list is not empty %} {% if data_list is not empty %}
<div id="learning_path_toc" class="scorm-list"> <div id="learning_path_toc" class="scorm-list">
<div class="scorm-title">
<h4>{{ lp_title_scorm }}</h4>
</div>
<div class="scorm-body"> <div class="scorm-body">
<h1 class="scorm-title">{{ lp_title_scorm }}</h1>
<div id="inner_lp_toc" class="inner_lp_toc scrollbar-light"> <div id="inner_lp_toc" class="inner_lp_toc scrollbar-light">
{% for item in data_list %} {% for item in data_list %}
<div id="toc_{{ item.id }}" class="{{ item.class }}"> <div id="toc_{{ item.id }}" class="{{ item.class }} item-{{ item.type }}">
{% if item.type == 'dir' %} {% if item.type == 'dir' %}
<div class="section {{ item.css_level }}" title="{{ item.description }}"> <div class="section {{ item.css_level }}" title="{{ item.description }}">
{{ item.title }} {{ item.title }}
@ -12,15 +14,86 @@
{% else %} {% else %}
<div class="item {{ item.css_level }}" title="{{ item.description }}"> <div class="item {{ item.css_level }}" title="{{ item.description }}">
<a name="atoc_{{ item.id }}"></a> <a name="atoc_{{ item.id }}"></a>
<a class="items-list" href="#" onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;" > <a class="items-list" href="#"
onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
{{ item.title }}
</a>
</div>
{% endif %}
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if data_panel is not empty %}
<div id="learning_path_toc" class="scorm-collapse">
<div class="scorm-title">
<h4>
{{ lp_title_scorm }}
</h4>
</div>
<div class="panel-group" role="tablist" aria-multiselectable="true">
{% if data_panel.not_parents %}
<ul class="scorm-collapse-list">
{% for item in data_panel.not_parents %}
<li id="toc_{{ item.id }}" class="{{ item.class }} item-{{ item.type }}">
<div class="sub-item type-{{ item.type }}">
<a name="atoc_{{ item.id }}"></a>
<a class="item-action" href="#"
onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
{{ item.title }} {{ item.title }}
</a> </a>
</div> </div>
</li>
{% endfor %}
</ul>
{% endif %} {% endif %}
{% for item in data_panel.are_parents %}
<div class="panel panel-default {{ item.parent ? 'lower':'higher' }}" data-lp-id="{{ item.id }}"
{{ item.parent ? 'data-lp-parent="' ~ item.parent ~ '"' : '' }}>
<div class="status-heading">
<div class="panel-heading" role="tab" id="heading-{{ item.id }}">
<h4>
<a class="item-header" role="button" data-toggle="collapse"
data-parent="#scorm-panel{{ item.parent ? '-' ~ item.parent : '' }}"
href="#collapse-{{ item.id }}" aria-expanded="true"
aria-controls="collapse-{{ item.id }}">
{{ item.title }}
</a>
</h4>
</div>
</div> </div>
<div id="collapse-{{ item.id }}" class="panel-collapse collapse {{ item.parent_current }}"
role="tabpanel" aria-labelledby="heading-{{ item.id }}">
<div class="panel-body">
<ul class="list">
{% set counter = 0 %}
{% set final = item.children|length %}
{% for subitem in item.children %}
{% set counter = counter + 1 %}
<li id="toc_{{ subitem.id }}"
class="{{ subitem.class }} {{ subitem.type }} {{ counter == final ? 'final':'' }}">
<div class="sub-item item-{{ subitem.type }}">
<a name="atoc_{{ subitem.id }}"></a>
<a class="item-action" href="#"
onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
{{ subitem.title }}
</a>
</div>
</li>
{% endfor %} {% endfor %}
</ul>
</div>
</div> </div>
</div> </div>
{% endfor %}
</div>
</div> </div>
{% endif %} {% endif %}
{{ accorden_toc }}

@ -146,11 +146,21 @@
$(document).on('ready', function () { $(document).on('ready', function () {
if (/iPhone|iPod|iPad/.test(navigator.userAgent)) { if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
// Fix an issue where you cannot scroll below first screen in
// learning paths on Apple devices
document.getElementById('wrapper-iframe') document.getElementById('wrapper-iframe')
.setAttribute( .setAttribute(
'style', 'style',
'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;' 'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;'
); );
// Fix another issue whereby buttons do not react to click below
// second screen in learning paths on Apple devices
document.getElementById('content_id')
.setAttribute(
'style',
'overflow: auto;'
);
} }
{% if lp_mode == 'embedframe' %} {% if lp_mode == 'embedframe' %}
@ -298,7 +308,10 @@
{type: 'stylesheet', id: '_fr5', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'}, {type: 'stylesheet', id: '_fr5', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'},
{type: 'stylesheet', id: '_fr6', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'}, {type: 'stylesheet', id: '_fr6', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'},
{type: 'script', id: '_fr2', src: '{{ _p.web_lib }}javascript/jquery.highlight.js'}, {type: 'script', id: '_fr2', src: '{{ _p.web_lib }}javascript/jquery.highlight.js'},
{type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php?{{ _p.web_cid_req }}'} {type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php?{{ _p.web_cid_query }}'},
{type: 'script', id: '_media1', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelement-and-player.min.js'},
{type: 'stylesheet', id: '_media2', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelementplayer.min.css'},
{type: 'script', id: '_media3', src: '{{ _p.web_lib }}javascript/iframe-js-loader.js'}
] ]
}); });
} }

Loading…
Cancel
Save