2019-09-19 01:27:19 +00:00
|
|
|
|
{% set metaTitle %}
|
|
|
|
|
{{- album.name | truncate(60, true, '…') + ' – ' + files.length + ' file' + ('s' if files.length !== 1) -}}
|
|
|
|
|
{% endset %}
|
2019-09-19 08:30:00 +00:00
|
|
|
|
{% set metaDesc = album.description | striptags | truncate(200, true, '…') %}
|
2019-09-19 01:27:19 +00:00
|
|
|
|
{% set metaUrl = '/' + album.url %}
|
2018-04-18 21:00:36 +00:00
|
|
|
|
|
2022-06-29 06:58:09 +00:00
|
|
|
|
{% set fileRoot = utils.conf.domain %}
|
2019-09-19 01:27:19 +00:00
|
|
|
|
{% set metaImage = fileRoot + '/' + album.thumb %}
|
|
|
|
|
|
|
|
|
|
{% extends "_layout.njk" %}
|
|
|
|
|
|
2020-05-25 20:49:54 +00:00
|
|
|
|
{% set noJsUrl = '../' + album.url + '?nojs' %}
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{% set generateZips = config.uploads.generateZips %}
|
|
|
|
|
{% set usingCdn = config.cloudflare and config.cloudflare.purgeCache %}
|
|
|
|
|
|
2018-04-18 21:00:36 +00:00
|
|
|
|
{% block stylesheets %}
|
2020-07-28 14:47:48 +00:00
|
|
|
|
<!-- Libs stylesheets -->
|
2020-05-16 21:54:06 +00:00
|
|
|
|
<link rel="stylesheet" href="../libs/fontello/fontello.css{{ versions[1] }}">
|
2022-09-29 21:02:28 +00:00
|
|
|
|
<link rel="stylesheet" href="../libs/simple-lightbox/simple-lightbox.min.css{{ versions[3] }}">
|
2020-07-28 14:47:48 +00:00
|
|
|
|
<!-- Stylesheets -->
|
2019-09-19 12:10:37 +00:00
|
|
|
|
<link rel="stylesheet" href="../css/style.css{{ versions[1] }}">
|
|
|
|
|
<link rel="stylesheet" href="../css/thumbs.css{{ versions[1] }}">
|
|
|
|
|
<link rel="stylesheet" href="../css/album.css{{ versions[1] }}">
|
2018-04-18 21:00:36 +00:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
2018-04-29 12:47:24 +00:00
|
|
|
|
{% block scripts %}
|
2019-09-01 19:23:16 +00:00
|
|
|
|
{% if not nojs -%}
|
2020-11-03 13:56:32 +00:00
|
|
|
|
<!-- Libs stylesheets -->
|
2019-09-19 12:10:37 +00:00
|
|
|
|
<script src="../libs/lazyload/lazyload.min.js{{ versions[3] }}"></script>
|
2022-09-29 21:02:28 +00:00
|
|
|
|
<script src="../libs/simple-lightbox/simple-lightbox.min.js{{ versions[3] }}"></script>
|
2020-11-03 13:56:32 +00:00
|
|
|
|
<!-- Scripts -->
|
2019-09-19 12:10:37 +00:00
|
|
|
|
<script src="../js/album.js{{ versions[1] }}"></script>
|
|
|
|
|
<script src="../js/misc/utils.js{{ versions[1] }}"></script>
|
2020-05-25 20:49:54 +00:00
|
|
|
|
{%- endif %}
|
2018-04-29 12:47:24 +00:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
2020-04-23 18:18:25 +00:00
|
|
|
|
{% block endmeta %}
|
|
|
|
|
{% if not nojs -%}
|
2020-05-25 20:49:54 +00:00
|
|
|
|
{% set noscriptRefreshUrl = noJsUrl %}
|
|
|
|
|
{% include "_partial/noscript-refresh.njk" %}
|
2020-04-23 18:18:25 +00:00
|
|
|
|
{%- endif %}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
2018-04-18 21:00:36 +00:00
|
|
|
|
{% block content %}
|
|
|
|
|
{{ super() }}
|
2020-05-16 21:54:06 +00:00
|
|
|
|
<section class="section has-extra-bottom-padding">
|
2018-04-18 21:00:36 +00:00
|
|
|
|
<div class="container">
|
2018-04-26 21:04:21 +00:00
|
|
|
|
<nav class="level">
|
|
|
|
|
<div class="level-left">
|
|
|
|
|
<div class="level-item">
|
|
|
|
|
<h1 id="title" class="title">
|
2019-09-19 01:27:19 +00:00
|
|
|
|
{{ album.name | truncate(70, true, '…') }}
|
2018-04-26 21:04:21 +00:00
|
|
|
|
</h1>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="level-item">
|
Improved albums public page cache and more
Removed its dependency towards albums' editedAt property.
Editing album's metas (name, description, etc) will no longer update
its editedAt property.
Instead it will now ONLY be updated when adding/removing files to/from
it. Just like how it was meant to be, which was to be used to check
whether it's necessary to re-generate their downloadable ZIPs.
Albums public page cache will still be properly invalidated when
adding/removing files to/from it, as well as after editing their metas.
Added views/album-notice.njk to be used to render okay-ish notice when
an album's public page is still being generated.
I was originally thinking of using it for disabled albums as well, but
I refrained from it to reduce the possibility of disabled album IDs from
being easily scanned (as it just returns 404 now).
Removed invalidatedAt property from stats cache. Instead their caches
will immediately be nullified as they should (thus frees up memory
slightly as well).
Stats cache for albums will now only be cleared when truly necessary.
As in, adding/removing files to/from albums will no longer clear them.
Updated Nunjucks files to properly use h1, h2, h3 tags in actual
hierarchical orders.
Elements that don't need to use hX tags will now use P instead.
Nothing changes visually, only structurally.
Fixed some elements in Nunjucks using single quotes instead of
double quotes. They'd have worked the same, but consistency.
Added h1 title in FAQ page.
Make text for no JS warning a bit bigger, and improved the phrasing
a little bit.
2020-06-03 03:44:24 +00:00
|
|
|
|
<p id="count" class="subtitle">
|
2019-09-19 01:30:02 +00:00
|
|
|
|
{{ files.length }} file{{ 's' if files.length !== 1 }} (<span class="file-size">{{ album.totalSize }} B</span>)
|
Improved albums public page cache and more
Removed its dependency towards albums' editedAt property.
Editing album's metas (name, description, etc) will no longer update
its editedAt property.
Instead it will now ONLY be updated when adding/removing files to/from
it. Just like how it was meant to be, which was to be used to check
whether it's necessary to re-generate their downloadable ZIPs.
Albums public page cache will still be properly invalidated when
adding/removing files to/from it, as well as after editing their metas.
Added views/album-notice.njk to be used to render okay-ish notice when
an album's public page is still being generated.
I was originally thinking of using it for disabled albums as well, but
I refrained from it to reduce the possibility of disabled album IDs from
being easily scanned (as it just returns 404 now).
Removed invalidatedAt property from stats cache. Instead their caches
will immediately be nullified as they should (thus frees up memory
slightly as well).
Stats cache for albums will now only be cleared when truly necessary.
As in, adding/removing files to/from albums will no longer clear them.
Updated Nunjucks files to properly use h1, h2, h3 tags in actual
hierarchical orders.
Elements that don't need to use hX tags will now use P instead.
Nothing changes visually, only structurally.
Fixed some elements in Nunjucks using single quotes instead of
double quotes. They'd have worked the same, but consistency.
Added h1 title in FAQ page.
Make text for no JS warning a bit bigger, and improved the phrasing
a little bit.
2020-06-03 03:44:24 +00:00
|
|
|
|
</p>
|
2018-04-26 21:04:21 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{% if generateZips -%}
|
2018-04-26 21:04:21 +00:00
|
|
|
|
<div class="level-right">
|
|
|
|
|
<p class="level-item">
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{% if not files.length -%}
|
2020-11-03 14:57:43 +00:00
|
|
|
|
<a class="button is-primary is-outlined" disabled>
|
|
|
|
|
<span class="icon">
|
|
|
|
|
<i class="icon-cancel"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span>Empty album</span>
|
|
|
|
|
</a>
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{%- elif album.downloadLink -%}
|
|
|
|
|
{%- if usingCDN -%}
|
2020-11-03 14:57:43 +00:00
|
|
|
|
<a class="button is-primary is-outlined" title="Be aware that album archive may be cached by CDN" href="../{{ album.downloadLink }}">
|
|
|
|
|
<span class="icon">
|
|
|
|
|
<i class="icon-download"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span>Download album</span>
|
|
|
|
|
</a>
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{%- else -%}
|
2020-11-03 14:57:43 +00:00
|
|
|
|
<a class="button is-primary is-outlined" href="../{{ album.downloadLink }}">
|
|
|
|
|
<span class="icon">
|
|
|
|
|
<i class="icon-download"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span>Download album</span>
|
|
|
|
|
</a>
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{%- endif -%}
|
2018-04-28 17:26:39 +00:00
|
|
|
|
{%- else -%}
|
2020-11-03 14:57:43 +00:00
|
|
|
|
<a class="button is-primary is-outlined" disabled>
|
|
|
|
|
<span class="icon">
|
|
|
|
|
<i class="icon-cancel"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span>Download disabled</span>
|
|
|
|
|
</a>
|
2018-04-28 17:26:39 +00:00
|
|
|
|
{%- endif %}
|
2018-04-26 21:04:21 +00:00
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
{%- endif %}
|
|
|
|
|
</nav>
|
2019-09-01 19:23:16 +00:00
|
|
|
|
|
2019-09-17 04:13:41 +00:00
|
|
|
|
{% if album.description -%}
|
2022-05-05 05:55:21 +00:00
|
|
|
|
<div class="subtitle description content">
|
|
|
|
|
{{ album.description | safe }}
|
2019-09-19 08:30:00 +00:00
|
|
|
|
</div>
|
2018-04-26 21:04:21 +00:00
|
|
|
|
{%- endif %}
|
2018-04-18 21:00:36 +00:00
|
|
|
|
<hr>
|
2019-09-01 19:23:16 +00:00
|
|
|
|
|
|
|
|
|
{% if nojs -%}
|
|
|
|
|
<article class="message">
|
|
|
|
|
<div class="message-body">
|
|
|
|
|
<p>You are viewing No-JS version of this album, so file size will be displayed in bytes.</p>
|
2019-09-17 04:13:41 +00:00
|
|
|
|
<p>Please <a href="../{{ album.url }}">click here</a> if you want to view its regular version.</p>
|
2019-09-01 19:23:16 +00:00
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
{%- endif %}
|
|
|
|
|
|
2018-04-26 21:04:21 +00:00
|
|
|
|
{% if files.length -%}
|
2018-04-26 18:33:11 +00:00
|
|
|
|
<div id="table" class="columns is-multiline is-mobile is-centered has-text-centered">
|
|
|
|
|
{% for file in files %}
|
2019-09-17 04:13:41 +00:00
|
|
|
|
<div class="image-container column">
|
2020-04-06 18:50:15 +00:00
|
|
|
|
<a class="image" href="{{ fileRoot }}/{{ file.name }}" target="_blank">
|
2018-04-29 12:47:24 +00:00
|
|
|
|
{% if file.thumb -%}
|
2019-09-01 19:23:16 +00:00
|
|
|
|
{% if nojs -%}
|
2019-09-17 04:13:41 +00:00
|
|
|
|
<img alt="{{ file.name }}" src="{{ fileRoot }}/{{ file.thumb }}" width="200" height="200" loading="lazy">
|
2019-09-01 19:23:16 +00:00
|
|
|
|
{%- else -%}
|
2019-09-17 04:13:41 +00:00
|
|
|
|
<img alt="{{ file.name }}" data-src="{{ fileRoot }}/{{ file.thumb }}">
|
2019-09-01 19:23:16 +00:00
|
|
|
|
{%- endif %}
|
2018-04-29 12:47:24 +00:00
|
|
|
|
{%- else -%}
|
2020-05-25 20:49:54 +00:00
|
|
|
|
<h1 class="title">{{ file.extname or 'N/A' }}</h1>
|
2018-04-29 12:47:24 +00:00
|
|
|
|
{%- endif %}
|
|
|
|
|
</a>
|
2018-04-26 18:33:11 +00:00
|
|
|
|
<div class="details">
|
2020-06-07 05:29:17 +00:00
|
|
|
|
<p class="name">{{ file.name }}</p>
|
2022-09-19 00:13:09 +00:00
|
|
|
|
<p class="file-size" data-value="{{ file.size }}">{{ file.size }} B</p>
|
|
|
|
|
<p class="file-date" data-value="{{ file.timestamp }}"></p>
|
2018-04-26 18:33:11 +00:00
|
|
|
|
</div>
|
2018-04-18 21:00:36 +00:00
|
|
|
|
</div>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</div>
|
2018-04-26 21:04:21 +00:00
|
|
|
|
{%- else -%}
|
|
|
|
|
<article class="message">
|
|
|
|
|
<div class="message-body">
|
2018-04-27 03:03:13 +00:00
|
|
|
|
There are no files in the album.
|
2018-04-26 21:04:21 +00:00
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
{%- endif %}
|
2018-04-18 21:00:36 +00:00
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2018-04-29 12:47:24 +00:00
|
|
|
|
|
2020-05-25 20:49:54 +00:00
|
|
|
|
{% set floatingHomeHref = '..' %}
|
|
|
|
|
{% include "_partial/floating-home.njk" %}
|
2019-09-01 19:23:16 +00:00
|
|
|
|
{% if not nojs -%}
|
2022-06-28 04:47:28 +00:00
|
|
|
|
{% set noscriptMessage = '<p>If you are not automatically redirected to its No-JS version, <a href="' + noJsUrl + '">click here</a>.</p>' %}
|
2020-05-25 20:49:54 +00:00
|
|
|
|
{% include "_partial/noscript.njk" %}
|
2019-09-01 19:23:16 +00:00
|
|
|
|
{%- endif %}
|
2018-04-18 21:00:36 +00:00
|
|
|
|
{% endblock %}
|