filesafe/views/auth.njk
Bobby Wibowo 4660200b1e
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-29 00:26:39 +07:00

68 lines
2.4 KiB
Plaintext

{% extends "_layout.njk" %}
{% block stylesheets %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="libs/fontello/fontello.css?v={{ globals.v1 }}">
<link rel="stylesheet" type="text/css" href="css/sweetalert.css?v={{ globals.v1 }}">
<link rel="stylesheet" type="text/css" href="css/auth.css?v={{ globals.v1 }}">
{% endblock %}
{% block scripts %}
{{ super() }}
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js?v={{ globals.v1 }}"></script>
<script type="text/javascript" src="libs/axios/axios.min.js?v={{ globals.v1 }}"></script>
<script type="text/javascript" src="js/auth.js?v={{ globals.v1 }}"></script>
{% endblock %}
{% block content %}
{{ super() }}
<section id="login" class="hero is-fullheight" style="background-color: #232629">
<div class="hero-body">
<div class="container">
<div class="columns is-centered">
<div class="column is-one-third is-hidden-touch"></div>
<div class="column">
<h1 class="title">
Dashboard Access
</h1>
<h2 class="subtitle">
Login or register
</h2>
<div class="field">
<div class="control">
<input id="user" class="input" type="text" onkeypress="page.onkeypress(event, this)" placeholder="Your username">
</div>
</div>
<div class="field">
<div class="control">
<input id="pass" class="input" type="password" onkeypress="page.onkeypress(event, this)" placeholder="Your password">
</div>
</div>
<div class="field is-grouped is-grouped-right">
<div class="control">
<a id="registerBtn" class="button" onclick="page.do('register')">
<span class="icon">
<i class="icon-user-plus"></i>
</span>
<span>Register</span>
</a>
</div>
<div class="control">
<a id="loginBtn" class="button" onclick="page.do('login')">
<span class="icon">
<i class="icon-login"></i>
</span>
<span>Log in</span>
</a>
</div>
</div>
</div>
<div class="column is-one-third is-hidden-mobile"></div>
</div>
</div>
</div>
</section>
{% include "_partial/noscript.njk" %}
{% endblock %}