partitioncloud-server/partitioncloud/templates/base.html

142 lines
6.1 KiB
HTML
Raw Normal View History

2023-06-10 16:46:55 +02:00
<!DOCTYPE html>
<html>
<head>
2023-09-08 13:56:08 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
2023-06-10 16:46:55 +02:00
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>{% block title %}{% endblock %} - PartitionCloud</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='mobile.css') }}">
2023-06-23 22:37:53 +02:00
<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') }}">
2022-11-21 21:00:48 +01:00
<link rel="manifest" href="{{ url_for('static', filename='manifest.webmanifest') }}" />
</head>
2023-06-10 16:46:55 +02:00
<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 %}
2023-06-17 21:25:13 +02:00
{% if g.user %}
<dialog id="create-album">
<h2>Créer un nouvel album</h2>
<form action="/albums/create-album" method="post">
<input type="text" name="name" id="name" placeholder="Nom" required><br/>
<input type="submit" value="Créer">
</form>
<a href="#!" class="close-dialog">Close</a>
</dialog>
{% endif %}
2023-06-10 16:46:55 +02:00
<div class="mask" id="!"></div>
</div>
<div id="main-container">
<input id="slide-sidebar" type="checkbox" role="button"/>
2023-06-10 16:46:55 +02:00
<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">
2022-08-31 13:54:13 +02:00
{% if g.user %}
2023-06-10 16:46:55 +02:00
<form id="search-form" action="/albums/search" method="post">
<input type="search" id="search-bar" required="" placeholder="Rechercher" name="query">
<br>
<select id="nb-queries" name="nb-queries" title="Nombre de recherches en ligne">
2023-06-10 16:46:55 +02:00
{% 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 %}
2023-06-17 21:25:13 +02:00
<h2>Albums</h2>
{% if g.user %}
<a href="#create-album">
<div id="new-album-button">
Créer un album
</div>
</a>
{% endif %}
2023-06-10 16:46:55 +02:00
<section id="albums">
{% if not g.user %}
<div style="text-align: center;"><i>Connectez vous pour avoir accès à vos albums</i></div>
{% elif user.get_albums() | length == 0 %}
<div style="text-align: center;"><i>Aucun album disponible</i></div>
{% else %}
2023-06-10 16:46:55 +02:00
{% for album in user.albums %}
<a href="/albums/{{ album['uuid'] }}">
<div class="album-cover" id="album-1">
{{ album["name"] }}
</div>
</a>
{% endfor %}
2022-08-31 13:54:13 +02:00
{% endif %}
2023-06-10 16:46:55 +02:00
</section>
<div id="settings-container">
{% if g.user %}
2023-06-11 21:33:54 +02:00
<a href="{{ url_for('auth.logout') }}">
<button id="logout">
2023-06-17 21:25:13 +02:00
<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">
2023-06-11 21:33:54 +02:00
<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>
Déconnexion
</button>
</a><br/>
{% if g.user.access_level == 1 %}
2023-06-17 21:25:13 +02:00
<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>Panneau admin
</button></a><br/>
{% endif %}
<div class="user">
<div class="user-profile-picture" style="background-color:{{ user.color }}; position:inherit;"
title="{{ user.username }}">
{{ user.username[0] | upper }}
</div>
<div class="username">{{ user.username }}</div>
</div>
2023-06-10 16:46:55 +02:00
{% else %}
2023-06-24 16:05:05 +02:00
{% if not config.DISABLE_REGISTER %}
<a href="{{ url_for('auth.register') }}"><button>Créer un compte</button></a>
{% endif %}
2023-06-11 21:33:54 +02:00
<a href="{{ url_for('auth.login') }}"><button>Se connecter</button></a>
2023-06-10 16:46:55 +02:00
{% endif %}
</div>
2022-08-31 13:54:13 +02:00
</div>
2023-06-10 16:46:55 +02:00
<div id="content-container">
<header id="page-header">
2023-06-11 21:33:54 +02:00
<h1>PartitionCloud</h1>
2023-06-10 16:46:55 +02:00
</header>
2023-06-11 21:33:54 +02:00
{% for message in get_flashed_messages() %}
<div class="flash">{{ message }}</div>
{% endfor %}
2023-06-10 16:46:55 +02:00
<section id="content">
{% block content %}{% endblock %}
</section>
</div>
2023-09-08 13:56:08 +02:00
<div id="footer"><a href="https://github.com/partitioncloud/partitioncloud-server">PartitionCloud</a> {{ version }}</div>
2023-06-10 16:46:55 +02:00
</div>
</body>
<script src="{{ url_for('static', filename='main.js') }}"></script>
2023-06-10 16:46:55 +02:00
</html>