]> Raphaƫl G. Git Repositories - treebundle/blob - templates/element.html.twig
Add alias member variable
[treebundle] / templates / element.html.twig
1 {% extends '@RapsysTree/_base.html.twig' %}
2 {% block content %}
3 {% if element is defined and element %}
4 <article>
5 <header>
6 <h2>
7 {% for breadcrumb in element.breadcrumbs %}
8 <a href="{{ breadcrumb.link }}">{{ breadcrumb.name }}</a>
9 {% endfor %}
10 </h2>
11 </header>
12 <section>
13 {% if ( element.directories is defined and element.directories ) or ( element.files is defined and element.files ) %}
14 <ul>
15 {% if element.directories is defined and element.directories %}
16 {% for name, link in element.directories %}
17 <li><a href="{{ link }}">{{ name }}</a></li>
18 {% endfor %}
19 {% endif %}
20 {% if element.files is defined and element.files %}
21 {% for name, infos in element.files %}
22 <li><a href="{{ infos.link }}">{{ name }}</a></li>
23 {% endfor %}
24 {% endif %}
25 </ul>
26 {% endif %}
27 {% if element.file is defined and element.file %}
28 <dl>
29 <dt>{% trans %}Size{% endtrans %}</dt>
30 <dd title="{{ element.file.size }}">{{ element.file.intlsize }} {{ element.file.intlunit }}</dd>
31 </dl>
32 <dl>
33 <dt>{% trans %}Mime type{% endtrans %}</dt>
34 <dd>{{ element.file.mimetype }}</dd>
35 </dl>
36 {% if element.file.preview is defined and element.file.preview %}
37 <dl>
38 <dt>{% trans %}Preview{% endtrans %}</dt>
39 <dd>element.file.preview</dd>
40 </dl>
41 {% endif %}
42 {% endif %}
43 </section>
44 </article>
45 {# TODO: XXX: add next, prev and parent links ? #}
46 {% endif %}
47 {% endblock %}