lessons with accordion mode category - refs BT#12880

pull/2487/head
Alex Aragon 9 years ago
parent aa9d72f9c5
commit baf6811153
  1. 377
      main/template/default/learnpath/list.tpl

@ -11,7 +11,7 @@
{{ introduction_section }} {{ introduction_section }}
{% set configuration = 'lp_category_accordeon'|api_get_configuration_value %} {% set configuration = 'lp_category_accordeon'|api_get_configuration_value %}
<div class="lp-accordeon panel-group" id="lp-accordion" role="tablist" aria-multiselectable="true">
{% for lp_data in data %} {% for lp_data in data %}
{% set show_category = true %} {% set show_category = true %}
@ -173,167 +173,246 @@
{% endif %} {% endif %}
<!--- end old view --> <!--- end old view -->
{% else %} {% else %}
<!-- new view block accordeon -->
<div class="lp-accordeon panel-group" id="lp-accordion-{{ lp_data.category.getId() }}" role="tablist" aria-multiselectable="true"> {% if lp_data.category.id == 0 %}
<div class="panel panel-default"> {% if lp_data.lp_list %}
<div class="panel-heading" role="tab" id="heading-{{ lp_data.category.getId() }}"> <div class="table-responsive">
<h4 class="panel-title"> <table class="table table-hover table-striped">
<a role="button" data-toggle="collapse" data-parent="#lp-accordion-{{ lp_data.category.getId() }}" href="#collapse-{{ lp_data.category.getId() }}" aria-expanded="true" aria-controls="collapse-{{ lp_data.category.getId() }}"> <thead>
{{ lp_data.category.getName() }} <tr>
</a> <th>{{ "Title"|get_lang }}</th>
</h4> {% if is_allowed_to_edit %}
{% if is_allowed_to_edit %} <th>{{ "PublicationDate"|get_lang }}</th>
<div class="tools-actions pull-right"> <th>{{ "ExpirationDate"|get_lang }}</th>
{% if lp_data.category.getId() > 0 %} <th>{{ "Progress"|get_lang }}</th>
{% if not _c.session_id %} <th>{{ "AuthoringOptions"|get_lang }}</th>
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Edit"|get_lang }}"> {% else %}
<img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}"> {% if not is_invitee %}
</a> <th>{{ "Progress"|get_lang }}</th>
{% endif %}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}" title="{{ "AddUser"|get_lang }}"> <th>{{ "Actions"|get_lang }}</th>
<img src="{{ "user.png"|icon }}" alt="{{ "AddUser"|get_lang }}"> {% endif %}
</a> </tr>
</thead>
<tbody>
{% for row in lp_data.lp_list %}
<tr>
<td>
{{ row.learnpath_icon }}
<a href="{{ row.url_start }}">
{{ row.title }}
{{ row.session_image }}
{{ row.extra }}
</a>
</td>
{% if is_allowed_to_edit %}
<td>
{% if row.start_time %}
<span class="small">{{ row.start_time }}</span>
{% endif %}
</td>
<td>
<span class="small">{{ row.end_time }}</span>
</td>
<td>
{{ row.dsp_progress }}
</td>
{% else %}
{% if not is_invitee %}
<td>
{{ row.dsp_progress }}
</td>
{% endif %}
{% endif %}
{% if loop.index0 == 1 %} <td>
<a href="#"> {{ row.action_build }}
<img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}"> {{ row.action_edit }}
</a> {{ row.action_visible }}
{% else %} {{ row.action_tracking }}
<a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=move_up_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}"> {{ row.action_publish }}
<img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}"> {{ row.action_subscribe_users }}
</a> {{ row.action_serious_game }}
{% endif %} {{ row.action_reinit }}
{{ row.action_default_view }}
{{ row.action_debug }}
{{ row.action_export }}
{{ row.action_copy }}
{{ row.action_auto_launch }}
{{ row.action_pdf }}
{{ row.action_delete }}
{{ row.action_order }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% endif %}
{% if categories|length > 1 and lp_data.category.id %}
<div class="panel panel-default">
<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 %}
<div class="tools-actions pull-right">
{% if lp_data.category.getId() > 0 %}
{% 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 }}">
<img src="{{ "edit.png"|icon }}" alt="{{ "Edit"|get_lang }}">
</a>
{% if (data|length - 1) == loop.index0 %} <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=add_users_to_category&id=' ~ lp_data.category.getId() }}" title="{{ "AddUser"|get_lang }}">
<a href="#"> <img src="{{ "user.png"|icon }}" alt="{{ "AddUser"|get_lang }}">
<img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|get_lang }}"> </a>
</a>
{% else %}
<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 }}">
</a>
{% endif %}
{% endif %}
{% if lp_data.category_visibility == 0 %} {% if loop.index0 == 1 %}
<a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':1}|url_encode }}" <a href="#">
title="{{ 'Show'|get_lang }}"> <img src="{{ "up_na.png"|icon }}" alt="{{ "Move"|get_lang }}">
<img src="{{ 'invisible.png'|icon }}" alt="{{ 'Show'|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':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':0}|url_encode }}" <img src="{{ "up.png"|icon }}" alt="{{ "Move"|get_lang }}">
title="{{ 'Hide'|get_lang }}"> </a>
<img src="{{ 'visible.png'|icon }}" alt="{{ 'Hide'|get_lang }}"> {% endif %}
</a>
{% endif %}
{% if lp_data.category_is_published == 0 %} {% if (data|length - 1) == loop.index0 %}
<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="#">
title="{{ 'LearnpathPublish'|get_lang }}"> <img src="{{ "down_na.png"|icon }}" alt="{{ "Move"|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=move_down_category&id=' ~ lp_data.category.getId() }}" title="{{ "Move"|get_lang }}">
<a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}" <img src="{{ "down.png"|icon }}" alt="{{ "Move"|get_lang }}">
title="{{ 'LearnpathDoNotPublish'|get_lang }}"> </a>
<img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}"> {% endif %}
</a> {% endif %}
{% endif %}
{% if not _c.session_id %} {% if lp_data.category_visibility == 0 %}
<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':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
<img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}"> title="{{ 'Show'|get_lang }}">
</a> <img src="{{ 'invisible.png'|icon }}" alt="{{ 'Show'|get_lang }}">
{% endif %} </a>
{% endif %} {% else %}
</div> <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_visibility', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
{% endif %} title="{{ 'Hide'|get_lang }}">
</div> <img src="{{ 'visible.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
<div id="collapse-{{ lp_data.category.getId() }}" class="panel-collapse collapse " role="tabpanel" aria-labelledby="heading-{{ lp_data.category.getId() }}"> </a>
<div class="panel-body"> {% endif %}
{% if lp_data.lp_list %}
<div class="table-responsive">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ "Title"|get_lang }}</th>
{% if is_allowed_to_edit %}
<th>{{ "PublicationDate"|get_lang }}</th>
<th>{{ "ExpirationDate"|get_lang }}</th>
<th>{{ "Progress"|get_lang }}</th>
<th>{{ "AuthoringOptions"|get_lang }}</th>
{% else %}
{% if not is_invitee %}
<th>{{ "Progress"|get_lang }}</th>
{% endif %}
<th>{{ "Actions"|get_lang }}</th> {% if lp_data.category_is_published == 0 %}
{% endif %} <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':1}|url_encode }}"
</tr> title="{{ 'LearnpathPublish'|get_lang }}">
</thead> <img src="{{ 'lp_publish_na.png'|icon }}" alt="{{ 'LearnpathPublish'|get_lang }}">
<tbody> </a>
{% for row in lp_data.lp_list %} {% else %}
<tr> <a href="lp_controller.php?{{ _p.web_cid_query ~ '&' ~ {'action':'toggle_category_publish', 'id':lp_data.category.id, 'new_status':0}|url_encode }}"
<td> title="{{ 'LearnpathDoNotPublish'|get_lang }}">
{{ row.learnpath_icon }} <img src="{{ 'lp_publish.png'|icon }}" alt="{{ 'Hide'|get_lang }}">
<a href="{{ row.url_start }}"> </a>
{{ row.title }} {% endif %}
{{ row.session_image }}
{{ row.extra }}
</a>
</td>
{% if is_allowed_to_edit %}
<td>
{% if row.start_time %}
<span class="small">{{ row.start_time }}</span>
{% endif %}
</td>
<td>
<span class="small">{{ row.end_time }}</span>
</td>
<td>
{{ row.dsp_progress }}
</td>
{% else %}
{% if not is_invitee %}
<td>
{{ row.dsp_progress }}
</td>
{% endif %}
{% endif %}
<td> {% if not _c.session_id %}
{{ row.action_build }} <a href="{{ 'lp_controller.php?' ~ _p.web_cid_query ~ '&action=delete_lp_category&id=' ~ lp_data.category.getId() }}" title="{{ "Delete"|get_lang }}">
{{ row.action_edit }} <img src="{{ "delete.png"|icon }}" alt="{{ "Delete"|get_lang }}">
{{ row.action_visible }} </a>
{{ row.action_tracking }} {% endif %}
{{ row.action_publish }} {% endif %}
{{ row.action_subscribe_users }} </div>
{{ row.action_serious_game }} {% endif %}
{{ row.action_reinit }} </div>
{{ row.action_default_view }} <div id="collapse-{{ lp_data.category.getId() }}" class="panel-collapse collapse " role="tabpanel" aria-labelledby="heading-{{ lp_data.category.getId() }}">
{{ row.action_debug }} <div class="panel-body">
{{ row.action_export }} {% if lp_data.lp_list %}
{{ row.action_copy }} <div class="table-responsive">
{{ row.action_auto_launch }} <table class="table table-hover table-striped">
{{ row.action_pdf }} <thead>
{{ row.action_delete }} <tr>
{{ row.action_order }} <th>{{ "Title"|get_lang }}</th>
</td> {% if is_allowed_to_edit %}
</tr> <th>{{ "PublicationDate"|get_lang }}</th>
{% endfor %} <th>{{ "ExpirationDate"|get_lang }}</th>
</tbody> <th>{{ "Progress"|get_lang }}</th>
</table> <th>{{ "AuthoringOptions"|get_lang }}</th>
{% else %}
{% if not is_invitee %}
<th>{{ "Progress"|get_lang }}</th>
{% endif %}
<th>{{ "Actions"|get_lang }}</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for row in lp_data.lp_list %}
<tr>
<td>
{{ row.learnpath_icon }}
<a href="{{ row.url_start }}">
{{ row.title }}
{{ row.session_image }}
{{ row.extra }}
</a>
</td>
{% if is_allowed_to_edit %}
<td>
{% if row.start_time %}
<span class="small">{{ row.start_time }}</span>
{% endif %}
</td>
<td>
<span class="small">{{ row.end_time }}</span>
</td>
<td>
{{ row.dsp_progress }}
</td>
{% else %}
{% if not is_invitee %}
<td>
{{ row.dsp_progress }}
</td>
{% endif %}
{% endif %}
<td>
{{ row.action_build }}
{{ row.action_edit }}
{{ row.action_visible }}
{{ row.action_tracking }}
{{ row.action_publish }}
{{ row.action_subscribe_users }}
{{ row.action_serious_game }}
{{ row.action_reinit }}
{{ row.action_default_view }}
{{ row.action_debug }}
{{ row.action_export }}
{{ row.action_copy }}
{{ row.action_auto_launch }}
{{ row.action_pdf }}
{{ row.action_delete }}
{{ row.action_order }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>
</div> </div>
{% endif %} {% endif %}
</div> <!-- end view block accordeon -->
</div>
</div>
</div>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
{% if is_allowed_to_edit and not lp_is_shown %} {% if is_allowed_to_edit and not lp_is_shown %}
<div id="no-data-view"> <div id="no-data-view">
<h2>{{ "LearningPaths"|get_lang }}</h2> <h2>{{ "LearningPaths"|get_lang }}</h2>

Loading…
Cancel
Save