filesafe/views/home.njk

136 lines
5.2 KiB
Plaintext
Raw Normal View History

{% extends "_layout.njk" %}
{% block endmeta %}
{{ super() }}
{% if globals.google_site_verification %}
<meta name="google-site-verification" content="{{ globals.google_site_verification }}" />
{% endif %}
{% endblock %}
{% block stylesheets %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="libs/fontello/fontello.css?v={{ globals.v3 }}">
More improvements to albums, and others Improvements related to albums: * Changed "rename album" option with a better "edit album" feature. With it you can also disable download or public link and even request a new public link (https://i.fiery.me/fz1y.png). This also adds a new API route: /api/albums/edit. The old API route, /api/albums/rename, is still available but will silently be using the new API in backend. * Deleting album will now also delete its zip archive if exists. * Renaming albums will also rename its zip archive if exists. * Generating zip will use async fs.readFile instead of fs.readFileSync. This should improve generating speed somewhat. * The codes that tries to generate random identifier for album will now check whether an album with the same identifier already exists. It will also rely on "uploads.maxTries" config option to limit how many times it will try to re-generate a new random identifier. * Added a new config option "uploads.albumIdentifierLength" which sets the length of the randomly generated identifier. * Added "download" and "public" columns to "albums" table in database/db.js. Existing users can run "node database/migration.js" to add the columns. Others: * uploadsController.getUniqueRandomName will no longer accept 3 paramters (previously it would accept a callback in the third parameter). It will now instead return a Promise. * Album name of disabled/deleted albums will no longer be shown in uploads list. * Added "fileLength" column to "users" table in database/db.js. * Renamed HTTP404.html and HTTP500.html in /pages/error to 404.html and 500.html respectively. I'm still using symlinks though. * Added a new CSS named sweetalert.css which will be used in homepage, auth and dashboard. It will style all sweetalert modals with dark theme (matching the current color scheme used in this branch). * Updated icons (added download icon). * Some other improvements/tweaks here and there.
2018-04-28 17:26:39 +00:00
<link rel="stylesheet" type="text/css" href="css/sweetalert.css?v={{ globals.v1 }}">
<link rel="stylesheet" type="text/css" href="css/home.css?v={{ globals.v1 }}">
{% endblock %}
{% block scripts %}
{{ super() }}
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js?v={{ globals.v3 }}"></script>
<script type="text/javascript" src="libs/dropzone/dropzone.min.js?v={{ globals.v3 }}"></script>
<script type="text/javascript" src="libs/axios/axios.min.js?v={{ globals.v3 }}"></script>
<script type="text/javascript" src="libs/clipboard.js/clipboard.min.js?v={{ globals.v3 }}"></script>
<script type="text/javascript" src="libs/lazyload/lazyload.min.js?v={{ globals.v3 }}"></script>
<script type="text/javascript" src="js/home.js?v={{ globals.v1 }}"></script>
{% endblock %}
{% block content %}
{{ super() }}
<section class="hero is-fullheight has-text-centered" id="home">
<div class="hero-body section">
<div class="container">
<p id="b">
<img class="logo" alt="logo" src="images/logo_smol.png?v={{ globals.v2 }}">
</p>
<h1 class="title">{{ globals.name }}</h1>
<h2 class="subtitle">{{ globals.home_subtitle | safe }}</h2>
<h3 class="subtitle" id="maxFileSize"></h3>
<div class="columns is-gapless">
<div class="column is-hidden-mobile"></div>
<div class="column">
<a id="loginToUpload" class="button is-danger is-loading" style="display: flex"></a>
<div id="albumDiv" class="field has-addons" style="display: none">
<div class="control is-expanded">
<div class="select is-fullwidth">
<select id="albumSelect"></select>
</div>
</div>
<div class="control">
<a id="createAlbum" class="button is-breeze" title="Create new album">
<i class="icon-plus"></i>
</a>
</div>
</div>
{% if urlMaxSize -%}
<div id="tabs" class="tabs is-centered" style="display: none">
<ul>
<li data-id="tab-files" class="is-active"><a>Files</a></li>
<li data-id="tab-urls"><a>URLs</a></li>
</ul>
</div>
{%- endif %}
<div id="tab-files" class="tab-content" style="display: none">
<div class="field dz-container"></div>
<div class="field uploads" style="display: none"></div>
</div>
{% if urlMaxSize -%}
<div id="tab-urls" class="tab-content" style="display: none">
<div class="field">
<div class="control">
<textarea id="urls" class="textarea" rows="2"></textarea>
</div>
<p class="help">
{% if urlMaxSize !== maxSize -%}
Maximum file size for URL upload is <span style="font-weight: bold">{{ urlMaxSize }}</span>.
{%- endif %}
{%- if urlMaxSize and urlMaxSize !== maxSize and urlDuckDuckGoProxy %}<br>{% endif -%}
{%- if urlDuckDuckGoProxy %}
Since we're using DuckDuckGo's proxy, the URLs have to be direct links.
{% endif -%}
</p>
</div>
<div class="field">
<div class="control is-expanded">
<a id="uploadUrls" class="button is-danger is-fullwidth is-unselectable">
<span class="icon">
<i class="icon-upload-cloud"></i>
</span>
<span>Upload URLs</span>
</a>
</div>
</div>
<div class="field uploads" style="display: none"></div>
</div>
{%- endif %}
</div>
<div class="column is-hidden-mobile"></div>
</div>
<div id="tpl" style="display: none">
<div class="field">
<img class="is-unselectable">
<p class="name is-unselectable"></p>
<progress class="progress is-small is-danger" value="0" max="100">0%</progress>
<p class="error"></p>
<p class="link">
<a target="_blank" rel="noopener"></a>
</p>
<p class="clipboard-mobile is-hidden-desktop" style="display: none">
<a class="button is-info is-outlined clipboard-js" style="display: flex">
<span class="icon">
<i class="icon-clipboard-1"></i>
</span>
<span>Copy link to clipboard</span>
</a>
</p>
</div>
</div>
<h3 class="subtitle">
<a href="auth" id="loginLinkText"></a>
</h3>
{% include "_partial/links.njk" %}
{% if gitHash -%}
<p>Git commit: <a href="https://github.com/BobbyWibowo/lolisafe/commit/{{ gitHash }}" target="_blank" rel="noopener">{{ gitHash }}</a></p>
{%- endif %}
</div>
</div>
</section>
{% include "_partial/noscript.njk" %}
{% endblock %}