]> Raphaƫl G. Git Repositories - treebundle/blobdiff - templates/album.html.twig
Add album and element templates
[treebundle] / templates / album.html.twig
diff --git a/templates/album.html.twig b/templates/album.html.twig
new file mode 100644 (file)
index 0000000..114cf80
--- /dev/null
@@ -0,0 +1,58 @@
+{% extends '@RapsysTree/_base.html.twig' %}
+{% block content %}
+       {% if album is defined and album %}
+               <article>
+                       <header>
+                               <h2>
+                                       {% for breadcrumb in album.breadcrumbs %}
+                                               <a href="{{ breadcrumb.link }}">{{ breadcrumb.name }}</a>
+                                       {% endfor %}
+                               </h2>
+                               {% if album.elements is defined and album.elements %}
+                                       <ul>
+                                               {% if album.elements is defined and album.elements %}
+                                                       {% for eid, element in album.elements %}
+                                                               <li><a href="{{ element.link }}">{{ element.name }}</a></li>
+                                                       {% endfor %}
+                                               {% endif %}
+                                       </ul>
+                               {% endif %}
+                       </header>
+                       <section>
+                               {% if ( album.directories is defined and album.directories ) or ( album.files is defined and album.files ) %}
+                                       <ul>
+                                               {% if album.directories is defined and album.directories %}
+                                                       {% for name, link in album.directories %}
+                                                               <li><a href="{{ link }}">{{ name }}</a></li>
+                                                       {% endfor %}
+                                               {% endif %}
+                                               {% if album.files is defined and album.files %}
+                                                       {% for name, infos in album.files %}
+                                                               <li><a href="{{ infos.link }}">{{ name }}</a></li>
+                                                       {% endfor %}
+                                               {% endif %}
+                                       </ul>
+                               {% endif %}
+                               {% if album.file is defined and album.file %}
+                                       <dl>
+                                               <dt>{% trans %}Size{% endtrans %}</dt>
+                                               <dd title="{{ album.file.size }}">{{ album.file.intlsize }} {{ album.file.intlunit }}</dd>
+                                       </dl>
+                                       <dl>
+                                               <dt>{% trans %}Mime type{% endtrans %}</dt>
+                                               <dd>{{ album.file.mimetype }}</dd>
+                                       </dl>
+                                       {% if album.file.thumb is defined and album.file.thumb %}
+                                               <dl>
+                                                       <dt>{% trans %}Thumb{% endtrans %}</dt>
+                                                       <dd>
+                                                               <a href=""><img src="{{ album.file.thumb.src }}" alt="{{ album.file.name }}" width="{{ album.file.thumb.width }}" height="{{ album.file.thumb.height }}" /></a>
+                                                       </dd>
+                                               </dl>
+                                       {% endif %}
+                               {% endif %}
+                       </section>
+               </article>
+               {# TODO: XXX: add next, prev and parent links ? #}
+       {% endif %}
+{% endblock %}