2019-09-17 04:13:41 +00:00
{% set title = album.name %}
2018-04-19 06:22:53 +00:00
{% extends "_layout.njk" %}
2018-04-18 21:00:36 +00:00
2019-09-17 04:13:41 +00:00
{% set fileRoot = config.domain %}
{% set generateZips = config.uploads.generateZips %}
{% set usingCdn = config.cloudflare and config.cloudflare.purgeCache %}
2018-04-18 21:00:36 +00:00
{% block stylesheets %}
<!-- Stylesheets -->
2018-12-11 12:31:48 +00:00
<link rel="stylesheet" href="../libs/bulma/bulma.min.css?v={{ globals.v3 }}">
<link rel="stylesheet" href="../css/style.css?v={{ globals.v1 }}">
2019-09-01 19:23:16 +00:00
<link rel="stylesheet" href="../css/thumbs.css?v={{ globals.v1 }}">
2018-12-11 12:31:48 +00:00
<link rel="stylesheet" href="../css/album.css?v={{ globals.v1 }}">
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 -%}
2018-08-20 23:24:50 +00:00
<!-- Scripts -->
2018-12-11 12:31:48 +00:00
<script src="../libs/lazyload/lazyload.min.js?v={{ globals.v3 }}"></script>
<script src="../js/album.js?v={{ globals.v1 }}"></script>
Updates (very important to read)
Client-side CSS & JS files will now be processed with Gulp.
Gulp tasks are configured in gulpfile.js file.
CSS files will be optimized with postcss-preset-env, which will
auto-add vendor prefixes and convert any parts necessary for browsers
compatibility.
Afterwards they will be minified with cssnano.
JS files will be optimized with bublé,
likewise for browsers compatibility.
Afterwards they will be minified with terser.
Unprocessed CSS & JS files will now be located at src directory, while
the processed results will be located at dist directory.
Due to bublé, the JS files should now be compatible up to IE 11
at the minimum.
Previously the safe would not work in IE 11 due to extensive usage of
template literals.
Due to that as well, JS files in src directory will now extensively use
arrow functions for my personal comfort (as they will be converted too).
The server will use the processed files at dist directory by default.
If you want to rebuild the files by your own, you can run "yarn build".
Gulp is a development dependency, so make sure you have installed all
development dependencies (e.i. NOT using "yarn install --production").
---
yarn lint -> gulp lint
yarn build -> gulp default
yarn watch -> gulp watch
yarn develop -> env NODE_ENV=development yarn watch
---
Fixed not being able to demote staff into normal users.
/api/token/verify will no longer respond with 401 HTTP error code,
unless an error occurred (which will be 500 HTTP error code).
Fixed /nojs route not displaying file's original name when a duplicate
is found on the server.
Removed is-breeze CSS class name, in favor of Bulma's is-info.
Removed custom styling from auth page, in favor of global styling.
Removed all usage of style HTML attribute in favor of CSS classes.
Renamed js/s/ to js/misc/.
Use loading spinners on dashboard's sidebar menus.
Disable all other sidebar menus when something is loading.
Changed title HTML attribute of disabled control buttons in
uploads & users list.
Hid checkboxes and WIP controls from users list.
Better error messages handling.
Especially homepage will now support CF's HTTP error codes.
Updated various icons.
Also, added fontello config file at public/libs/fontello/config.json.
This should let you edit them more easily with fontello.
Use Gatsby icon for my blog's link in homepage's footer.
A bunch of other improvements here & there.
2019-09-15 06:20:11 +00:00
<script src="../js/misc/utils.js?v={{ globals.v1 }}"></script>
2019-09-01 19:23:16 +00:00
{% endif %}
2018-04-29 12:47:24 +00:00
{% endblock %}
2018-04-23 19:58:44 +00:00
{% block opengraph %}
2018-04-18 21:00:36 +00:00
<!-- Open Graph tags -->
<meta property="og:type" content="website" />
2019-09-17 04:13:41 +00:00
<meta property="og:title" content="{{ album.name | safe }} – {{ files.length }} files" />
<meta property="og:url" content="{{ root }}/{{ album.url }}" />
<meta property="og:description" content="{{ album.description }}" />
<meta property="og:image" content="{{ fileRoot }}/{{ album.thumb }}" />
2018-04-18 21:00:36 +00:00
<meta property="og:locale" content="en_US" />
<!-- Twitter Card tags -->
<meta name="twitter:card" content="summary">
2019-09-17 04:13:41 +00:00
<meta name="twitter:title" content="{{ album.name | safe }} – {{ files.length }} files">
<meta name="twitter:description" content="{{ album.description }}">
<meta name="twitter:image" content="{{ fileRoot }}/{{ album.thumb }}">
2018-04-18 21:00:36 +00:00
{% endblock %}
{% block content %}
{{ super() }}
<section class="section">
<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-17 04:13:41 +00:00
{{ album.name | safe }}
2018-04-26 21:04:21 +00:00
</h1>
</div>
<div class="level-item">
<h1 id="count" class="subtitle">
2019-09-17 04:13:41 +00:00
{{ files.length }} files (<span class="file-size">{{ album.totalSize }} B</span>)
2018-04-26 21:04:21 +00:00
</h1>
</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 -%}
<a class="button is-primary is-outlined" title="There are no files in the album" disabled>Download album</a>
{%- elif album.downloadLink -%}
{%- if usingCDN -%}
<a class="button is-primary is-outlined" title="Be aware that album archive may be cached by CDN" href="../{{ album.downloadLink }}">Download album</a>
{%- else -%}
<a class="button is-primary is-outlined" href="../{{ album.downloadLink }}">Download album</a>
{%- endif -%}
2018-04-28 17:26:39 +00:00
{%- else -%}
2018-04-29 13:17:02 +00:00
<a class="button is-primary is-outlined" title="The album's owner has chosen to disable download" disabled>Download disabled</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 -%}
2018-12-13 09:09:46 +00:00
<h2 class="subtitle description">
2019-09-17 04:13:41 +00:00
{{ album.description | safe }}
2018-12-13 09:09:46 +00:00
</h2>
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">
<a class="image" href="{{ fileRoot }}/{{ file.name }}" target="_blank" rel="noopener">
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 -%}
<h1 class="title">{{ file.extname | default('N/A') }}</h1>
{%- endif %}
</a>
2018-04-26 18:33:11 +00:00
<div class="details">
2019-09-17 04:13:41 +00:00
<p><span class="name">{{ file.name }}</span></p>
2019-04-19 04:56:57 +00:00
<p class="file-size">{{ file.size }} B</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
2019-09-01 19:23:16 +00:00
{% if not nojs -%}
2018-04-29 12:47:24 +00:00
<noscript>
2019-09-01 19:23:16 +00:00
<style>body > section:not(#noscript) { display: none !important; }</style>
<section id="noscript" class="hero is-fullheight">
<div class="hero-body">
<div class="container has-text-centered">
<p>You have JavaScript disabled, but this page requires JavaScript to function.</p>
2019-09-17 04:13:41 +00:00
<p>Please <a href="../{{ album.url }}?nojs">click here</a> if you want to view its No-JS version.</p>
2019-09-01 19:23:16 +00:00
</div>
</div>
</section>
2018-04-29 12:47:24 +00:00
</noscript>
2019-09-01 19:23:16 +00:00
{%- endif %}
2018-04-18 21:00:36 +00:00
{% endblock %}