mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-14 00:16:21 +00:00
c3d61733af
Added iamdustan/smoothscroll polyfill in dashboard pages. This will polyfill smooth scroll (when executed programmatically) for older browers. No-JS uploader's notice button when on private mode will now also say "Log in to upload", although auth page will still require JS. All front-end buttons will now use outlined version. I'm lovin' it. Auth page will now show a loading spinner if the user has a saved token. Afterwards, they will still be redirected to dashboard. Better error handlers in home, dashboard, and auth pages. Removed <hr> from uploads & users lists in dashboard. "Manage your token" menu will no longer try to make an API request prior to displaying its page. Reloading the page will already trigger token verification anyway. Updated public/images/fb_share.png. Updated README.md. A few other tweaks.
98 lines
3.2 KiB
Plaintext
98 lines
3.2 KiB
Plaintext
{% set metaTitle = "No-JS uploader" %}
|
|
{% set metaUrl = '/nojs' %}
|
|
|
|
{% extends "_layout.njk" %}
|
|
|
|
{% set private = config.private %}
|
|
{% set disabledMessage -%}
|
|
{%- if config.enableUserAccounts -%}
|
|
Anonymous upload is disabled. Log in to upload.
|
|
{%- else -%}
|
|
Running in private mode. Log in to upload.
|
|
{%- endif %}
|
|
{%- endset %}
|
|
{% set maxSizeInt = config.uploads.maxSize | int %}
|
|
{% set noJsMaxSizeInt = config.cloudflare.noJsMaxSize | int %}
|
|
|
|
{% block stylesheets %}
|
|
{{ super() }}
|
|
<link rel="stylesheet" href="css/home.css?v={{ globals.v1 }}">
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
{{ super() }}
|
|
<section id="home" class="hero is-fullheight">
|
|
<div class="hero-body">
|
|
<div class="container has-text-centered">
|
|
<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="maxSize">
|
|
Maximum total size per upload attempt is {{ noJsMaxSizeInt or maxSizeInt }} MB
|
|
</h3>
|
|
|
|
<div class="columns is-gapless">
|
|
<div class="column is-hidden-mobile"></div>
|
|
<div class="column">
|
|
{% if private -%}
|
|
<a class="button is-danger is-outlined is-fullwidth" href="auth">
|
|
{{ disabledMessage }}
|
|
</a>
|
|
{%- else -%}
|
|
<form id="form" class="field" action="" method="post" enctype="multipart/form-data">
|
|
<div class="field">
|
|
<p class="control">
|
|
<input type="file" class="is-fullwidth" name="files[]" multiple="multiple">
|
|
</p>
|
|
</div>
|
|
<div class="field">
|
|
<p class="control">
|
|
<input type="submit" class="button is-danger is-outlined is-fullwidth" value="Upload">
|
|
</p>
|
|
<p class="help">
|
|
Files uploaded through this form will not be associated with your account, if you have any.
|
|
</p>
|
|
</div>
|
|
</form>
|
|
{%- endif %}
|
|
{% if files -%}
|
|
<div class="field uploads nojs">
|
|
{% for file in files -%}
|
|
<div class="field">
|
|
<p class="name is-unselectable">{{ file.original }}</p>
|
|
{% if errorMessage -%}
|
|
<p class="error">{{ errorMessage | safe }}</p>
|
|
{%- endif %}
|
|
{% if file.url -%}
|
|
<p class="link">
|
|
<a href="{{ file.url }}" target="_blank" rel="noopener">{{ file.url | safe }}</a>
|
|
</p>
|
|
{%- endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{%- endif %}
|
|
</div>
|
|
<div class="column is-hidden-mobile"></div>
|
|
</div>
|
|
|
|
{% set plain_links = true %}
|
|
{% include "_partial/links.njk" %}
|
|
|
|
{% if gitHash -%}
|
|
<div class="git-commit columns is-gapless">
|
|
<div class="column is-hidden-mobile"></div>
|
|
<div class="column">
|
|
<span>Git commit: </span><a href="https://github.com/BobbyWibowo/lolisafe/commit/{{ gitHash }}" target="_blank" rel="noopener">{{ gitHash }}</a>
|
|
</div>
|
|
<div class="column is-hidden-mobile"></div>
|
|
</div>
|
|
{%- endif %}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{% endblock %}
|