swaf upgrade: convert views to svelte
This commit is contained in:
parent
5571737d93
commit
79d23a4604
@ -1,8 +1,9 @@
|
||||
{% extends 'layouts' %}
|
||||
<script>
|
||||
import BaseTemplate from "./templates/BaseTemplate.svelte";
|
||||
import {locals} from "../ts/stores";
|
||||
</script>
|
||||
|
||||
{% set title = app.name + ' - About us' %}
|
||||
|
||||
{% block body %}
|
||||
<BaseTemplate title="{$locals.app.name} - About us" noH1>
|
||||
<h1>Self-hosting files</h1>
|
||||
|
||||
<div class="container">
|
||||
@ -11,4 +12,4 @@
|
||||
<p class="center">Powered by swaf</p>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</BaseTemplate>
|
@ -1,63 +0,0 @@
|
||||
{% extends 'layouts/barebone.njk' %}
|
||||
{% import 'macros.njk' as macros %}
|
||||
|
||||
{% block _stylesheets %}
|
||||
{{ super() }}
|
||||
<link rel="stylesheet" href="/css/app.css">
|
||||
{% block stylesheets %}{% endblock %}
|
||||
{% endblock %}
|
||||
{% block _scripts %}
|
||||
{{ super() }}
|
||||
{% block scripts %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<a href="/" class="logo"><img src="/img/logo.svg" alt="Logo"> {{ app.name }}</a>
|
||||
<nav>
|
||||
<button id="menu-button"><i data-feather="menu"></i></button>
|
||||
<ul id="main-menu">
|
||||
<li><a href="{{ route('about') }}"><i data-feather="info"></i> <span class="tip">About</span></a></li>
|
||||
{% if user %}
|
||||
<li><a href="{{ route('file-uploader') }}"><i data-feather="upload"></i> <span class="tip">Upload file</span></a></li>
|
||||
<li><a href="{{ route('url-shrinker') }}"><i data-feather="crosshair"></i> <span class="tip">Shrink URL</span></a></li>
|
||||
{% if user.is_admin %}
|
||||
<li><a href="{{ route('backend') }}"><i data-feather="settings"></i> <span class="tip">Backend</span></a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{ route('account') }}"><i data-feather="user"></i> <span class="tip">{{ user.name | default('Account') }}</span></a>
|
||||
<ul class="dropdown">
|
||||
<li><a href="{{ route('auth-tokens') }}"><i data-feather="key"></i> <span class="tip">Auth tokens</span></a></li>
|
||||
<li>
|
||||
<hr>
|
||||
<form action="{{ route('logout') }}?{{ querystring.stringify({redirect_uri: '/'}) }}" method="POST">
|
||||
<button><i data-feather="log-out"></i> <span class="tip">Logout</span></button>
|
||||
|
||||
{{ macros.csrf(getCsrfToken) }}
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li><a href="{{ route('auth') }}"><i data-feather="user"></i> <span class="tip">Login / Register</span></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block _body %}
|
||||
<div class="container">
|
||||
{{ macros.messages(flash) }}
|
||||
</div>
|
||||
|
||||
<main>
|
||||
{% if h1 %}
|
||||
<h1>{{ h1 }}</h1>
|
||||
{% endif %}
|
||||
{% if subtitle %}
|
||||
<p>{{ subtitle }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% block body %}{% endblock %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}{{ app.name }} v{{ app_version }} - all rights reserved.{% endblock %}
|
14
src/assets/views/templates/base/BaseNavMenuLinks.svelte
Normal file
14
src/assets/views/templates/base/BaseNavMenuLinks.svelte
Normal file
@ -0,0 +1,14 @@
|
||||
<script>
|
||||
import {locals} from "../../../ts/stores.js";
|
||||
import NavMenuItem from "../../components/NavMenuItem.svelte";
|
||||
import {route} from "../../../../common/Routing";
|
||||
</script>
|
||||
|
||||
<NavMenuItem href={route('about')} icon="info" text="About" />
|
||||
|
||||
|
||||
{#if $locals.user}
|
||||
<NavMenuItem href={route('file-uploader')} icon="upload" text="Upload" />
|
||||
<NavMenuItem href={route('url-shrinker')} icon="crosshair" text="Shorten URL" />
|
||||
<NavMenuItem href={route('auth-tokens')} icon="key" text="Auth tokens" /> <!-- TODO: move that link to the account page -->
|
||||
{/if}
|
Loading…
Reference in New Issue
Block a user