From: Raphaƫl Gertz Date: Thu, 14 Nov 2024 07:53:16 +0000 (+0100) Subject: Add album and element templates X-Git-Tag: 0.0.8~3 X-Git-Url: https://git.rapsys.eu/treebundle/commitdiff_plain/d3798da0c79794f2355b3002b36faf7e8e8fc95e?ds=inline Add album and element templates --- diff --git a/templates/album.html.twig b/templates/album.html.twig new file mode 100644 index 0000000..114cf80 --- /dev/null +++ b/templates/album.html.twig @@ -0,0 +1,58 @@ +{% extends '@RapsysTree/_base.html.twig' %} +{% block content %} + {% if album is defined and album %} +
+
+

+ {% for breadcrumb in album.breadcrumbs %} + {{ breadcrumb.name }} + {% endfor %} +

+ {% if album.elements is defined and album.elements %} +
    + {% if album.elements is defined and album.elements %} + {% for eid, element in album.elements %} +
  • {{ element.name }}
  • + {% endfor %} + {% endif %} +
+ {% endif %} +
+
+ {% if ( album.directories is defined and album.directories ) or ( album.files is defined and album.files ) %} +
    + {% if album.directories is defined and album.directories %} + {% for name, link in album.directories %} +
  • {{ name }}
  • + {% endfor %} + {% endif %} + {% if album.files is defined and album.files %} + {% for name, infos in album.files %} +
  • {{ name }}
  • + {% endfor %} + {% endif %} +
+ {% endif %} + {% if album.file is defined and album.file %} +
+
{% trans %}Size{% endtrans %}
+
{{ album.file.intlsize }} {{ album.file.intlunit }}
+
+
+
{% trans %}Mime type{% endtrans %}
+
{{ album.file.mimetype }}
+
+ {% if album.file.thumb is defined and album.file.thumb %} +
+
{% trans %}Thumb{% endtrans %}
+
+ {{ album.file.name }} +
+
+ {% endif %} + {% endif %} +
+
+ {# TODO: XXX: add next, prev and parent links ? #} + {% endif %} +{% endblock %} diff --git a/templates/element.html.twig b/templates/element.html.twig new file mode 100644 index 0000000..1996c3b --- /dev/null +++ b/templates/element.html.twig @@ -0,0 +1,47 @@ +{% extends '@RapsysTree/_base.html.twig' %} +{% block content %} + {% if element is defined and element %} +
+
+

+ {% for breadcrumb in element.breadcrumbs %} + {{ breadcrumb.name }} + {% endfor %} +

+
+
+ {% if ( element.directories is defined and element.directories ) or ( element.files is defined and element.files ) %} +
    + {% if element.directories is defined and element.directories %} + {% for name, link in element.directories %} +
  • {{ name }}
  • + {% endfor %} + {% endif %} + {% if element.files is defined and element.files %} + {% for name, infos in element.files %} +
  • {{ name }}
  • + {% endfor %} + {% endif %} +
+ {% endif %} + {% if element.file is defined and element.file %} +
+
{% trans %}Size{% endtrans %}
+
{{ element.file.intlsize }} {{ element.file.intlunit }}
+
+
+
{% trans %}Mime type{% endtrans %}
+
{{ element.file.mimetype }}
+
+ {% if element.file.preview is defined and element.file.preview %} +
+
{% trans %}Preview{% endtrans %}
+
element.file.preview
+
+ {% endif %} + {% endif %} +
+
+ {# TODO: XXX: add next, prev and parent links ? #} + {% endif %} +{% endblock %}