Update from 1.11.x

pull/2881/head
Julio Montoya 6 years ago
parent bd31b2c1b5
commit 2b4dde79d6
  1. 83
      main/template/default/course_description/index.html.twig

@ -4,58 +4,39 @@
{% for message in messages %}
{{ message }}
{% endfor %}
{% if listing.descriptions|length != 0 %}
<div class="alert alert-info" role="alert">
{{ 'No description of the course is recorded'|trans }}
</div>
<div id="no-data-view" class="tool-view">
<h2>{{ "Course description"|trans }}</h2>
<img src="{{ "info.png"|icon(64) }}" width="64" height="64">
<div class="controls">
<a href="{{ web_self ~ "?" ~ _p.web_cid_query ~ "&action=edit&description_type=1" }}" class="btn btn-outline-primary">
{{ "Add description"|trans }}
</a>
{% for description in listing.descriptions %}
{% if not description is empty %}
<div id="description_{{ description.description_type }}" class="panel panel-default"
data-id="{{ description.id }}" data-c_id="{{ description.c_id }}" data-type="course_description">
<div class="panel-heading">
{% if is_allowed_to_edit %}
<div class="pull-right">
{% if session_id == description.session_id %}
<a href="{{ _p.web_self }}?action=edit&amp;id={{ description.id }}&amp;{{ _p.web_cid_query }}"
title="{{ 'Edit'|get_lang }}">
<img src="{{ 'edit.png'|icon(22) }}"/>
</a>
<a href="{{ _p.web_self }}?action=delete&amp;id={{ description.id }}&amp;{{ _p.web_cid_query }}"
onclick="javascript:return confirmation('{{ description.title_js }}');"
title="{{ 'Delete'|get_lang }}">
<img src="{{ 'delete.png'|icon(22) }}"/>
</a>
{% else %}
<img title="{{ 'EditionNotAvailableFromSession'|get_lang }}"
alt="{{ 'EditionNotAvailableFromSession'|get_lang }}"
src="{{ 'edit_na.png'|icon(22) }}" width="22" height="22"
style="vertical-align:middle;">
{% endif %}
</div>
{% endif %}
{{ description.title }}
</div>
<div class="panel-body">
{{ description.content }}
</div>
</div>
</div>
{% else %}
{% for description in listing.descriptions %}
{% if not description is empty %}
<div id="description_{{ description.description_type }}"
data-id="{{ description.id }}" data-c_id="{{ description.c_id }}" data-type="course_description">
{% set title %}
<h3 class="card-title">
{% if is_allowed_to_edit %}
<div class="float-right">
<div class="btn-group btn-group-sm" role="group">
{% if session_id == description.session_id %}
<a class="btn btn-light" href="{{ _p.web_self }}?action=edit&amp;id={{ description.id }}&amp;{{ _p.web_cid_query }}"
title="{{ 'Edit'|get_lang }}">
<i class="fas fa-pencil-alt"></i>
</a>
<a class="btn btn-light delete-swal" href="{{ _p.web_self }}?action=delete&amp;id={{ description.id }}&amp;{{ _p.web_cid_query }}"
title="{{ 'Delete'|get_lang }} {{ description.title_js }}">
<i class="far fa-trash-alt"></i>
</a>
{% else %}
<a class="btn btn-light disabled" href="#"
title="{{ 'EditionNotAvailableFromSession'|get_lang }}">
<i class="fas fa-pencil-alt"></i>
</a>
{% endif %}
</div>
</div>
{% endif %}
{{ description.title }}
</h3>
{% endset %}
{{ macro.panel_box('description' ,title , description.content ) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endfor %}
{% endif %}
{% endautoescape %}
{% endblock %}
Loading…
Cancel
Save