partitioncloud-server/partitioncloud/templates/base.html
2024-02-25 15:28:51 +01:00

195 lines
8.1 KiB
HTML

<!DOCTYPE html>
<html lang="{{ lang }}">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="{{ self.title() }}" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#eff1f5">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1e1e2e">
<title>{% block title %}{% endblock %} - PartitionCloud</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style/style.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='style/mobile.css') }}">
<link rel="icon" type="image/png" href="{{ url_for('static', filename='icons/512.png') }}" />
<link rel="apple-touch-icon" href="{{ url_for('static', filename='icons/512.png') }}">
<link rel="manifest" href="{{ url_for('static', filename='manifest.webmanifest') }}" />
</head>
<body>
<div id="dialogs">
<!-- This div contains needed needed dialogs for the page
They will only appear if the user clicks a button for one of them -->
{% block dialogs %}{% endblock %}
{% if g.user %}
<dialog id="create-album">
<h2>{{ _("New Album") }}</h2>
<form action="/albums/create-album" method="post">
<input type="text" name="name" id="name" placeholder="{{ _('Name') }}" required><br/>
<input type="submit" value="{{ _('Create') }}">
</form>
<br/>
<br/>
{{ _("I want to create a collection of albums.") }} <a href="#create-groupe">{{ _("Create group") }}</a>.
<a href="#!" class="close-dialog">Close</a>
</dialog>
<dialog id="create-groupe">
<h2>{{ _("Create new group") }}</h2>
<form action="/groupe/create-groupe" method="post">
<input type="text" name="name" id="name" placeholder="{{ _('Name') }}" required><br/>
<input type="submit" value="{{ _('Create') }}">
</form>
<a href="#!" class="close-dialog">Close</a>
</dialog>
{% endif %}
<div class="mask" id="!"></div>
</div>
<div id="main-container">
<input id="slide-sidebar" type="checkbox" role="button"/>
<label for="slide-sidebar">
<div id="slide">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-playlist" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M14 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"></path>
<path d="M17 17v-13h4"></path>
<path d="M13 5h-10"></path>
<path d="M3 9l10 0"></path>
<path d="M9 13h-6"></path>
</svg>
</div>
</label>
<div id="sidebar">
{% if g.user %}
<form id="search-form" action="/albums/search" method="post">
<input type="search" id="search-bar" required="" placeholder="{{ _('Search') }}" name="query">
<br>
<select id="nb-queries" name="nb-queries" title="{{ _('Number of online searches') }}">
{% for i in range(0, user.max_queries+1) %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
<input id="search-submit" type="submit" value="Go">
</form>
{% endif %}
<h2>{{ _("Albums") }}</h2>
{% if g.user %}
<a href="#create-album">
<div class="create-button">
{{ _("New album") }}
</div>
</a>
{% endif %}
{% if g.user %}
<section id="sidebar-navigation">
<section id="groupes">
{% if user.get_groupes() | length > 0 %}
{% for groupe in user.groupes %}
<div class="groupe-cover">
<details>
<summary>
<a href="/groupe/{{ groupe.uuid }}">{{ groupe.name }}</a>
</summary>
<div class="groupe-albums-cover">
{% if groupe.get_albums() | length == 0 %}
{{ _("No albums") }}
{% else %}
{% for album in groupe.get_albums() %}
<a href="/groupe/{{ groupe.uuid }}/{{ album['uuid'] }}">
<div class="groupe-album-cover">
{{ album["name"] }}
</div>
</a>
{% endfor %}
{% endif %}
</div>
</details>
</div>
{% endfor %}
{% endif %}
</section>
<section id="albums">
{% if user.get_albums() | length == 0 %}
<div style="text-align: center;"><i>{{ _("No album available") }}</i></div>
{% else %}
{% for album in user.albums %}
<a href="/albums/{{ album['uuid'] }}">
<div class="album-cover">
{{ album["name"] }}
</div>
</a>
{% endfor %}
{% endif %}
</section>
</section>
{% else %}
<section id="sidebar-navigation">
<div style="text-align: center;"><i>{{ _("Log in to see your albums") }}</i></div>
</section>
{% endif %}
<div id="settings-container">
{% if g.user %}
<a href="{{ url_for('auth.logout') }}">
<button id="logout">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"></path>
<path d="M9 12h12l-3 -3"></path>
<path d="M18 15l3 -3"></path>
</svg>
{{ _("Log out") }}
</button>
</a><br/>
{% if g.user.access_level == 1 %}
<a href="/admin"><button>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 21a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3c.568 1.933 .635 3.957 .223 5.89"></path>
<path d="M19.001 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M19.001 15.5v1.5"></path>
<path d="M19.001 21v1.5"></path>
<path d="M22.032 17.25l-1.299 .75"></path>
<path d="M17.27 20l-1.3 .75"></path>
<path d="M15.97 17.25l1.3 .75"></path>
<path d="M20.733 20l1.3 .75"></path>
</svg>{{ _("Admin Panel") }}
</button></a><br/>
{% endif %}
<a href="/settings"><div class="user">
<div class="user-profile-picture" style="background-color:{{ user.color }};"
title="{{ user.username }}">
{{ user.username[0] | upper }}
</div>
<div class="username">{{ user.username }}</div>
</div></a>
{% else %}
{% if not config.DISABLE_REGISTER %}
<a href="{{ url_for('auth.register') }}"><button>{{ _("Create account") }}</button></a>
{% endif %}
<a href="{{ url_for('auth.login') }}"><button>{{ _("Log in") }}</button></a>
{% endif %}
</div>
</div>
<div id="content-container">
{% if not DISABLE_HEADER %}
<header id="page-header">
<h1>PartitionCloud</h1>
</header>
{% endif %}
{% for message in get_flashed_messages() %}
<div class="flash">{{ message }}</div>
{% endfor %}
<section id="content">
{% block content %}{% endblock %}
</section>
</div>
<div id="footer"><a href="https://github.com/partitioncloud/partitioncloud-server">PartitionCloud</a> {{ version }}</div>
</div>
</body>
<script src="{{ url_for('static', filename='scripts/main.js') }}"></script>
{% for script in scripts %}
<script src="{{ url_for('static', filename=script) }}"></script>
{% endfor %}
</html>