mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
Updates
* You can now disable using icons in home's footer links by setting "home_icons" to false in _globals.njk. * Renamed "meta" block to "opengraph" in _layout.njk, since the block only represents opengraph tags anyways. * Moved noscript warning to its own file at views/_partial/noscript.njk. It's also now being included in dashboard and auth pages. * No-JS uploader will no longer use icons in its footer links. It will also no longer load fontello.css. * Updated static files' version string in _globals.njk. * Some other tweaks, mainly to get no-icons mode to work properly.
This commit is contained in:
parent
c854e416ae
commit
e5f5fb1038
@ -42,7 +42,7 @@ const init = function (db) {
|
||||
table.integer('enabled')
|
||||
table.integer('timestamp')
|
||||
}).then(() => {
|
||||
db.table('users').where({username: 'root'}).then((user) => {
|
||||
db.table('users').where({ username: 'root' }).then((user) => {
|
||||
if (user.length > 0) { return }
|
||||
|
||||
require('bcrypt').hash('root', 10, function (error, hash) {
|
||||
|
@ -161,3 +161,8 @@ img[data-dz-thumbnail] {
|
||||
padding-left: 0.25rem;
|
||||
padding-right: 0.25rem;
|
||||
}
|
||||
|
||||
#linksColumn>span {
|
||||
padding: 0 0.3rem;
|
||||
color: #7f8c8d;
|
||||
}
|
||||
|
@ -7,14 +7,17 @@
|
||||
{% set home_subtitle = "A <strong>modern</strong> self-hosted file upload service" %}
|
||||
|
||||
{#
|
||||
This will be appended to all CSS and JS files, and should be changed on every updates to make sure clients load the very latest version of them.
|
||||
This will be appended to all CSS and JS files,
|
||||
and should be changed on every updates to make sure clients load the very latest version of them.
|
||||
#}
|
||||
{% set v = "hEmd7tjh6Q" %}
|
||||
{% set v = "8HSPG0eoRX" %}
|
||||
|
||||
{#
|
||||
These will be the links in the homepage and the No-JS uploader.
|
||||
You may remove icons by removing "icon" property. It will then automatically use "attrs.title" as the display text.
|
||||
You may remove icons by changing "home_icons" to false.
|
||||
It will then automatically use "attrs.title" as the display text.
|
||||
#}
|
||||
{% set home_icons = true %}
|
||||
{% set home_links = [
|
||||
{
|
||||
attrs: {
|
||||
|
@ -15,7 +15,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css?v={{ globals.v }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block meta %}
|
||||
{% block opengraph %}
|
||||
<!-- Open Graph tags -->
|
||||
<meta property="og:url" content="{{ globals.root }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
@ -51,6 +51,7 @@
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<!-- Scripts -->
|
||||
{% endblock %}
|
||||
|
@ -1,3 +1,7 @@
|
||||
{% if plain_links or not globals.home_icons %}
|
||||
{% set separator = (joiner('<span>|</span>')) %}
|
||||
{% endif %}
|
||||
|
||||
{% macro attrs(obj) %}
|
||||
{% set space = joiner(' ') %}
|
||||
{% for id, val in obj -%}
|
||||
@ -8,16 +12,17 @@
|
||||
<div class="columns is-gapless">
|
||||
<div class="column is-hidden-mobile"></div>
|
||||
<div class="column">
|
||||
<div id="linksColumn" class="columns is-mobile is-multiline is-centered">
|
||||
<div id="linksColumn" class="columns is-mobile is-multiline is-centered {{ "is-gapless" if separator }}">
|
||||
{% for link in globals.home_links -%}
|
||||
{{ (separator() | safe) if separator }}
|
||||
<div class="column is-narrow">
|
||||
<a {{ attrs(link.attrs) | trim }}>
|
||||
{% if link.icon -%}
|
||||
{% if separator -%}
|
||||
{{ link.attrs.title }}
|
||||
{%- else -%}
|
||||
<span class="icon is-medium">
|
||||
<i class="{{ link.icon }}"></i>
|
||||
</span>
|
||||
{%- else -%}
|
||||
{{ link.attrs.title }}
|
||||
{%- endif %}
|
||||
</a>
|
||||
</div>
|
||||
|
18
views/_partial/noscript.njk
Normal file
18
views/_partial/noscript.njk
Normal file
@ -0,0 +1,18 @@
|
||||
{#
|
||||
I thought of making a redirect with http-equiv="refresh", but it's too quick that people
|
||||
barely have any time to read the message which explains why the redirect is necessary.
|
||||
So yeah, I decided to stick with making people click on the link which leads to
|
||||
the No-JS uploader, if they really want to use the service.
|
||||
#}
|
||||
|
||||
<noscript>
|
||||
<style>body > section { display: none !important; }</style>
|
||||
<section class="hero is-fullheight has-text-centered">
|
||||
<div class="hero-body section">
|
||||
<div class="container">
|
||||
<p>You have JavaScript disabled, but this page requires JavaScript to function.</p>
|
||||
<p>Please <a href="nojs">click here</a> if you want to try out our No-JS uploader.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</noscript>
|
@ -15,7 +15,7 @@
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block meta %}
|
||||
{% block opengraph %}
|
||||
<!-- Open Graph tags -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="{{ title }} – {{ count }} files" />
|
||||
|
@ -61,4 +61,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% include "_partial/noscript.njk" %}
|
||||
{% endblock %}
|
||||
|
@ -96,4 +96,6 @@
|
||||
</div>
|
||||
<button class="modal-close is-large" aria-label="close" onclick="panel.closeModal()"></button>
|
||||
</div>
|
||||
|
||||
{% include "_partial/noscript.njk" %}
|
||||
{% endblock %}
|
||||
|
@ -77,15 +77,5 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<noscript>
|
||||
<style>#home { display: none !important; }</style>
|
||||
<section class="hero is-fullheight has-text-centered">
|
||||
<div class="hero-body section">
|
||||
<div class="container">
|
||||
<p>You have JavaScript disabled, but this page requires JavaScript to function.</p>
|
||||
<p>Please <a href="nojs">click here</a> if you want to try out our No-JS uploader.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</noscript>
|
||||
{% include "_partial/noscript.njk" %}
|
||||
{% endblock %}
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ super() }}
|
||||
<link rel="stylesheet" type="text/css" href="libs/fontello/fontello.css?v={{ globals.v }}">
|
||||
<link rel="stylesheet" type="text/css" href="css/home.css?v={{ globals.v }}">
|
||||
{% endblock %}
|
||||
|
||||
@ -68,6 +67,7 @@
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{% set plain_links = true %}
|
||||
{% include "_partial/links.njk" %}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user