filesafe/views/dashboard.njk
Bobby Wibowo 5e5d5c5647
Manage albums admin page, and more!
Resolves #194.

Added pagination for Manage your albums page.

Albums sidebar will now only list 9 albums at most.
Use Manage your albums page to view the rest.
Albums in the list will now have View uploads button after all.

Delete album button for albums renamed to Disable album.
Since techincally the server would've always been disabling the albums
instead of deleting them.
It was something upstream dev's decided, and I haven't bothered changing
its behavior.

I'll work on actual Delete album feature some other days.

As the title says, added Manage albums admin page.

Viewing uploads of an album will hook into albumid: filter key.

I'll work on filter and bulk operations some other days.

Updated styling for disabled albums and users.
Instead of havine a line through them, they will be greyed out.
Disable public page of albums will still use line through however.

Links to album's disabled public page are now clickable.

Added a new button styling is-dangerish.
It'll be orange.

Renamed /api/albums/delete to /api/albums/disable.
For backwards compatibility, /api/albums/delete will still work
but automatically re-routed to /api/albums/disable.

/api/uploads/list will no longer print SQLite errors for moderators
or higher when encountering them.
It was originally used to inform moderators of non-existing colum names
when used for sorting.
But on one of the recent commits, I had added a check for allowed colum
names.

Improved some caching in dashboard page.

Added new entries to cookie policy.

Some other small things.

Bumped v1 version string and rebuilt client assets.
2020-06-01 11:44:16 +07:00

109 lines
3.7 KiB
Plaintext

{% set metaTitle = "Dashboard" %}
{% set metaUrl = '/dashboard' %}
{% extends "_layout.njk" %}
{% block stylesheets %}
{{ super() }}
<link rel="stylesheet" href="libs/fontello/fontello.css{{ versions[1] }}">
<link rel="stylesheet" href="css/sweetalert.css{{ versions[1] }}">
<link rel="stylesheet" href="css/thumbs.css{{ versions[1] }}">
<link rel="stylesheet" href="css/dashboard.css{{ versions[1] }}">
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="libs/sweetalert/sweetalert.min.js{{ versions[3] }}"></script>
<script src="libs/axios/axios.min.js{{ versions[3] }}"></script>
<script src="libs/clipboard.js/clipboard.min.js{{ versions[3] }}"></script>
<script src="libs/lazyload/lazyload.min.js{{ versions[3] }}"></script>
{# Polyfill smooth scroll for older browsers #}
<script src="libs/smoothscroll/smoothscroll.min.js{{ versions[3] }}"></script>
{# We assign an ID for this so that the script can find out its own version #}
<script id="mainScript" src="js/dashboard.js{{ versions[1] }}"></script>
<script src="js/misc/utils.js{{ versions[1] }}"></script>
{% endblock %}
{% block endmeta %}
{% include "_partial/noscript-refresh.njk" %}
{% endblock %}
{% block content %}
{{ super() }}
<section id="dashboard" class="section is-hidden">
<div id="panel" class="container">
<h1 class="title">
Dashboard
</h1>
<h1 class="subtitle">
A simple <strong>dashboard</strong>, to sort your uploaded stuff
</h1>
<hr>
<div class="columns">
<div class="column is-one-quarter">
<aside id="menu" class="menu">
<p class="menu-label">General</p>
<ul class="menu-list is-unselectable">
<li>
<a href="." class="is-relative">Frontpage</a>
</li>
<li>
<a id="itemUploads" class="is-relative">Uploads</a>
</li>
<li>
<a id="itemDeleteUploadsByNames" class="is-relative">Delete uploads by names</a>
</li>
</ul>
<p class="menu-label">Albums</p>
<ul class="menu-list is-unselectable">
<li>
<a id="itemManageYourAlbums" class="is-relative">Manage your albums</a>
</li>
<li>
<ul id="albumsContainer"></ul>
</li>
</ul>
<p id="itemLabelAdmin" class="menu-label is-hidden">Administration</p>
<ul id="itemListAdmin" class="menu-list is-unselectable is-hidden">
<li>
<a id="itemStatistics" class="is-relative is-hidden">Statistics</a>
</li>
<li>
<a id="itemManageUploads" class="is-relative is-hidden">Manage uploads</a>
</li>
<li>
<a id="itemManageAlbums" class="is-relative is-hidden">Manage albums</a>
</li>
<li>
<a id="itemManageUsers" class="is-relative is-hidden">Manage users</a>
</li>
</ul>
<p class="menu-label">Configuration</p>
<ul class="menu-list is-unselectable">
<li>
<a id="ShareX" class="is-relative">ShareX user profile</a>
</li>
<li>
<a id="itemManageToken" class="is-relative">Manage your token</a>
</li>
<li>
<a id="itemChangePassword" class="is-relative">Change your password</a>
</li>
<li>
<a id="itemLogout" class="is-relative">Logout</a>
</li>
</ul>
</aside>
</div>
<div id="page" class="column has-text-centered is-third-quarters">
<img alt="logo" src="images/logo.png{{ versions[2] }}">
</div>
</div>
</div>
</section>
{% include "_partial/loader.njk" %}
{% include "_partial/noscript.njk" %}
{% endblock %}