partitioncloud-server/partitioncloud/templates/base.html

140 lines
5.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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') }}">
<link rel="icon" type="image/png" href="{{ url_for('static', filename='icon.png') }}" />
<link rel="apple-touch-icon" href="{{ url_for('static', filename='icon.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>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 %}
<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="Rechercher" name="query">
<br>
<select id="nb-queries" name="nb-queries">
{% for i in range(0, user.max_queries+1) %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
<label for="nb-queries" id="nb-queries-label">en ligne</label>
<input id="search-submit" type="submit" value="Go">
</form>
{% endif %}
<h2>Albums</h2>
{% if g.user %}
<a href="#create-album">
<div id="new-album-button">
Créer un album
</div>
</a>
{% endif %}
<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 %}
{% for album in user.albums %}
<a href="/albums/{{ album['uuid'] }}">
<div class="album-cover" id="album-1">
{{ album["name"] }}
</div>
</a>
{% endfor %}
{% endif %}
</section>
<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>
Déconnexion
</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>Panneau admin
</button></a><br/>
{% endif %}
<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>
{% else %}
<a href="{{ url_for('auth.register') }}"><button>Créer un compte</button></a>
<a href="{{ url_for('auth.login') }}"><button>Se connecter</button></a>
{% endif %}
</div>
</div>
<div id="content-container">
<header id="page-header">
<h1>PartitionCloud</h1>
</header>
{% for message in get_flashed_messages() %}
<div class="flash">{{ message }}</div>
{% endfor %}
<section id="content">
{% block content %}{% endblock %}
</section>
</div>
</div>
</body>
</html>