|
1 | 1 | {% import '@ChamiloCore/Macros/box.html.twig' as macro %}
|
2 | 2 | {% block content %}
|
3 | 3 | {% autoescape false %}
|
4 |
| - {% for description in listing.descriptions %} |
5 |
| - {% if not description is empty %} |
6 |
| - <div id="description_{{ description.descriptionType }}" class="bg-white shadow-md rounded-lg mb-4" data-id="{{ description.iid }}" data-type="course_description"> |
7 |
| - <div class="bg-gray-15 border-b border-gray-25 px-4 py-2 flex justify-between items-center"> |
8 |
| - <div> |
9 |
| - {{ description.title }} |
10 |
| - {% if description.sessionId %} |
11 |
| - {{ description.icon_session }} |
12 |
| - {% endif %} |
13 |
| - </div> |
14 |
| - {% if is_allowed_to_edit %} |
15 |
| - <div class="space-x-2"> |
16 |
| - {% if is_granted('EDIT', description.resourceNode) %} |
17 |
| - <a href="{{ url('legacy_main', {'name': 'course_description/index.php' }) }}?action=edit&id={{ description.iid }}&{{ course_url_params }}" title="{{ 'Edit'|get_lang }}" class="text-primary hover:text-secondary"> |
18 |
| - {{ 'ActionIcon::EDIT'|mdi_icon }} |
19 |
| - </a> |
20 |
| - {% endif %} |
21 |
| - |
22 |
| - {% if is_granted('DELETE', description.resourceNode) %} |
23 |
| - <a href="{{ url('legacy_main', {'name': 'course_description/index.php' }) }}?action=delete&id={{ description.iid }}&{{ course_url_params }}" onclick="javascript:return confirmation('{{ description.title | e('js')}}');" title="{{ 'Delete'|get_lang }}" class="text-danger hover:text-danger-dark"> |
24 |
| - {{ 'ActionIcon::DELETE'|mdi_icon }} |
25 |
| - </a> |
| 4 | + {% if listing.descriptions is not empty %} |
| 5 | + {% for description in listing.descriptions %} |
| 6 | + {% if not description is empty %} |
| 7 | + <div id="description_{{ description.descriptionType }}" class="bg-white shadow-md rounded-lg mb-4" data-id="{{ description.iid }}" data-type="course_description"> |
| 8 | + <div class="bg-gray-15 border-b border-gray-25 px-4 py-2 flex justify-between items-center"> |
| 9 | + <div> |
| 10 | + {{ description.title }} |
| 11 | + {% if description.sessionId %} |
| 12 | + {{ description.icon_session }} |
26 | 13 | {% endif %}
|
27 | 14 | </div>
|
28 |
| - {% endif %} |
29 |
| - </div> |
30 |
| - <div class="p-4"> |
31 |
| - {{ description.content }} |
| 15 | + {% if is_allowed_to_edit %} |
| 16 | + <div class="space-x-2"> |
| 17 | + {% if is_granted('EDIT', description.resourceNode) %} |
| 18 | + <a href="{{ url('legacy_main', {'name': 'course_description/index.php' }) }}?action=edit&id={{ description.iid }}&{{ course_url_params }}" title="{{ 'Edit'|get_lang }}" class="text-primary hover:text-secondary"> |
| 19 | + {{ 'ActionIcon::EDIT'|mdi_icon }} |
| 20 | + </a> |
| 21 | + {% endif %} |
| 22 | + {% if is_granted('DELETE', description.resourceNode) %} |
| 23 | + <a href="{{ url('legacy_main', {'name': 'course_description/index.php' }) }}?action=delete&id={{ description.iid }}&{{ course_url_params }}" onclick="javascript:return confirmation('{{ description.title | e('js')}}');" title="{{ 'Delete'|get_lang }}" class="text-danger hover:text-danger-dark"> |
| 24 | + {{ 'ActionIcon::DELETE'|mdi_icon }} |
| 25 | + </a> |
| 26 | + {% endif %} |
| 27 | + </div> |
| 28 | + {% endif %} |
| 29 | + </div> |
| 30 | + <div class="p-4"> |
| 31 | + {{ description.content }} |
| 32 | + </div> |
32 | 33 | </div>
|
33 |
| - </div> |
34 |
| - {% endif %} |
35 |
| - {% endfor %} |
| 34 | + {% endif %} |
| 35 | + {% endfor %} |
| 36 | + {% else %} |
| 37 | + <div class="text-center text-gray-500 italic py-8"> |
| 38 | + {{ 'No descriptions available yet.'|get_lang }} |
| 39 | + </div> |
| 40 | + {% endif %} |
36 | 41 | {% endautoescape %}
|
37 | 42 | {% endblock %}
|
0 commit comments