aboutsummaryrefslogtreecommitdiff
path: root/bgstack15-gallery-theme/templates/album.html
blob: 1114e401d588b40ad18c15bf4c8cd2b1d12088f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{% extends "base.html" %}
{% block content %}
  {% set numbers = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] %}
  {% set column_size = settings.colorbox_column_size %}
  {% set nb_columns = (9 / column_size)|int %}
  {% set column_size_t = numbers[column_size] %}

  {% macro img_description(media) -%}
    {% if media.big %} data-big="{{ media.big_url }}"{% endif %}
    {% if media.exif %}
      {% if media.exif.datetime %}
        data-date=", {{ media.exif.datetime }}"
      {% endif %}
    {% endif %}
  {%- endmacro %}

  <div id="gallery">
    {% for media in album.medias %}
      {% if loop.index % nb_columns == 1 %}
      <div id="albums" class="row">
      {% endif%}
      {% if media.type == "image" %}
      <div class="{{ column_size_t }} columns thumbnail">
        {% if 'sigal.plugins.media_page' in settings.plugins %}
        <a href="{{ media.url}}.html" class="gallery"
          title="{{ media.title }}"
          data-href="{{ media.url }}" {{ img_description(media) }}>
        {% else %}
        <a href="{{ media.url }}" class="gallery" title="{{ media.title }}"
          {{ img_description(media) }}>
        {% endif %}
          <img src="{{ media.thumbnail }}" alt="{{ media.url }}"{# bgstack15 added this if..media.title #}
              title="{{ media.title }}" />{% if '.jpg' not in media.title or settings.edit_enabled %}<br>{% endif %}{% if '.jpg' not in media.title %}{{ media.title }}{% endif %}</a>{% if settings.edit_enabled %} <a style="font-size: 66%;" href="{{ settings.edit_cgi_script }}?index={{ album.index_url }}&image={{ media.url }}&id={{ settings.gallery_id }}">{{ settings.edit_string }}</a>{% endif %}
     {% if media.description %}{{ media.description }}{% endif %}
      </div>
      {% endif %}
      {% if media.type == "video" %}
        {% set mhash = media.url|replace('.', '')|replace(' ', '') %}
        <div class="{{ column_size_t }} columns thumbnail">
          {% if 'sigal.plugins.media_page' in settings.plugins %}
          <a href="{{ media.url }}.html" data-href="#{{ mhash }}"
          {% else %}
          <a href="#{{ mhash }}" class="gallery" inline='yes' title="{{ media.url }}"
          {% endif %}
            {% if media.big %} data-big="{{ media.big_url }}"{% endif %}>
            <img src="{{ media.thumbnail }}" alt="{{ media.url }}"
                title="{{ media.title }}" /></a>{% if ('.mp4' not in media.title and '.webm' not in media.title) or settings.edit_enabled %}<br>{% endif %}{% if ('.jpg' not in media.title and '.webm' not in media.title) %}{{ media.title }}{% endif %}</a>{% if settings.edit_enabled %} <a style="font-size: 66%;" href="{{ settings.edit_cgi_script }}?index={{ album.index_url }}&image={{ media.url }}&id={{ settings.gallery_id }}">{{ settings.edit_string }}</a>{% endif %}
            {% if media.description %}{{ media.description }}{% endif %}
        </div>
        <!-- This contains the hidden content for the video -->
        <div style='display:none'>
          <div id="{{ mhash }}">
            <video controls height="100%" width="100%">
            <source src='{{ media.url }}' type='{{ media.mime }}' />
            </video>
          </div>
        </div>
      {% endif %}
      {% if loop.last or loop.index % nb_columns == 0 %}
      </div>
      {% endif%}
    {% endfor %}
  </div>

  {% if album.zip %}
  <div id="additionnal-infos" class="row">
    <p><a href="{{ album.zip }}"
        title="Download a zip archive with all images">Download ZIP</a></p>
  </div>
  {% endif %}

{% endblock %}

{% block footer %}
  <script src="{{ theme.url }}/js/jquery-2.2.1.min.js"></script>
  <script src="{{ theme.url }}/js/jquery.colorbox-min.js"></script>
  <script src="{{ theme.url }}/js/jquery.touchSwipe.min.js"></script>

  {% if 'sigal.plugins.media_page' in settings.plugins %}
  <script src="{{ theme.url }}/js/app-with-media-page.js"></script>
  {% else %}
  <script src="{{ theme.url }}/js/app.js"></script>
  {% endif %}
{% endblock %}
bgstack15