kadenios/shared/templates/base.html

258 lines
9 KiB
HTML
Raw Normal View History

2021-05-29 09:22:04 +02:00
{% load static bulma i18n %}
2020-11-20 19:31:22 +01:00
2021-08-22 03:52:57 +02:00
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as langs %}
2020-11-20 19:31:22 +01:00
<!DOCTYPE html>
<html>
2020-12-18 11:48:07 +01:00
<head>
2020-12-20 13:46:25 +01:00
<title>Kadenios</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2020-12-18 11:48:07 +01:00
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
2021-06-09 15:37:06 +02:00
{# Favicon #}
2021-06-11 14:41:05 +02:00
<link rel="shortcut icon" type="image/png" href="{% static 'images/kadenios.png' %}">
2021-06-09 15:37:06 +02:00
2020-12-18 11:48:07 +01:00
{# CSS #}
2020-12-18 13:53:31 +01:00
<link rel="stylesheet" href="{% static 'css/main.css' %}">
<link rel="stylesheet" href="{% static 'vendor/font-awesome/css/font-awesome.min.css' %}">
<link rel="stylesheet" href="{% static 'vendor/font-awesome/css/solid.min.css' %}">
2020-12-18 11:48:07 +01:00
2021-08-21 22:58:01 +02:00
<script src="{% static 'js/main.js' %}"></script>
2021-08-20 18:34:03 +02:00
{% block extra_head %}{% endblock extra_head %}
2020-12-18 11:48:07 +01:00
</head>
<body>
2021-08-22 03:52:57 +02:00
{# Scrool to top #}
2021-08-20 16:47:30 +02:00
<button id="scroll-button" class="button is-rounded is-large is-hidden has-tooltip" data-tooltip="{% trans "Revenir en haut de la page" %}">
<span class="icon is-large has-text-primary">
<i class="fas fa-2x fa-chevron-circle-up"></i>
</span>
</button>
2021-08-22 03:52:57 +02:00
{# Sélection de la langue #}
<form action="{% url "set_language" %}" method="POST" id="lang-form" class="is-hidden">
{% csrf_token %}
<input type="hidden" name="language" id="lang-input">
</form>
{# Navbar #}
<nav class="level has-background-primary is-mobile">
<div class="level-left">
<div class="level-item pl-4">
2021-06-15 11:41:04 +02:00
<a href="{% url 'kadenios' %}">
2020-12-21 21:14:52 +01:00
<h1 class="has-text-primary-light is-size-1 is-family-secondary">Kadenios</h1>
</a>
2020-12-19 23:48:18 +01:00
</div>
2021-08-22 03:52:57 +02:00
<div class="level-item pl-4 is-hidden-touch">
2021-06-15 11:41:04 +02:00
<a href="{% url 'election.list' %}">
<h3 class="has-text-primary-light has-text-weight-semibold is-size-3">{% trans "Élections" %}</h3>
</a>
</div>
2021-06-15 11:41:04 +02:00
2021-06-18 18:08:12 +02:00
{% comment %}
2021-08-22 03:52:57 +02:00
<div class="level-item pl-4 is-hidden-touch">
2021-06-15 11:41:04 +02:00
<a href="{% url 'faq.list' %}">
<h3 class="has-text-primary-light has-text-weight-semibold is-size-3">{% trans "FAQ" %}</h3>
</a>
</div>
2021-06-18 18:08:12 +02:00
{% endcomment %}
2020-12-18 11:48:07 +01:00
</div>
2021-08-22 03:52:57 +02:00
<div class="level-right">
2021-04-14 20:51:04 +02:00
{% block auth %}
2021-08-22 03:52:57 +02:00
{% if user.is_authenticated %}
{# Paramètres de Kadenios #}
{% if user.is_staff %}
<div class="level-item has-tooltip-light has-tooltip-bottom is-hidden-touch" data-tooltip="Administration">
<a class="button is-primary" href="{% url 'auth.admin' %}">
<span class="icon is-size-3">
<i class="fas fa-cog"></i>
</span>
</a>
</div>
{% endif %}
2021-04-14 20:51:04 +02:00
2021-08-22 03:52:57 +02:00
<div class="level-item is-hidden-mobile">
<div class="tag">
{% blocktrans with name=user.base_username connection=user.connection_method %}Connecté·e en tant que {{ name }} par {{ connection }}{% endblocktrans %}
2021-04-14 20:51:04 +02:00
</div>
</div>
2021-08-22 03:52:57 +02:00
<div class="level-item is-hidden-touch">
<a class="button is-primary" href="{% url 'authens:logout' %}?next={% if view.get_next_url %}{{ view.get_next_url }}{% else %}/{% endif %}">
<span class="icon is-size-1">
<i class="fas fa-sign-out-alt"></i>
</span>
</a>
</div>
{% else %}
2021-04-14 03:22:22 +02:00
2021-08-22 03:52:57 +02:00
<div class="level-item py-2 is-hidden-touch">
<a class="button" href="{% url 'authens:login' %}?next={{ request.path }}">
<span class="is-size-5">{% trans "Se connecter" %}</span>
<span class="icon is-size-4">
<i class="fas fa-sign-in-alt"></i>
</span>
</a>
</div>
{% endif %}
{% endblock %}
2021-04-14 03:22:22 +02:00
2021-08-22 03:52:57 +02:00
{# Choix de la langue #}
<div class="level-item is-hidden-touch">
2021-04-14 20:51:04 +02:00
<div class="dropdown is-hoverable is-right">
2021-04-14 03:22:22 +02:00
<div class="dropdown-trigger">
<a class="button is-primary is-large" aria-haspopup="true" aria-controls="dropdown-menu">
<span class="icon is-size-2">
2021-04-14 03:22:22 +02:00
<i class="fas fa-language"></i>
</span>
</a>
</div>
<div class="dropdown-menu">
<div class="dropdown-content">
{% for lang in langs %}
{% with lang_svg="images/"|add:lang.code|add:".svg" %}
<a class="dropdown-item lang-selector" data-lang="{{ lang.code }}">
<span class="icon-text">
<span class="icon">
<img src="{% static lang_svg %}">
</span>
<span class="ml-1">{{ lang.name_translated }}</span>
</span>
{% endwith %}
</a>
2021-04-14 20:51:04 +02:00
{% if not forloop.last %}
<hr class="dropdown-divider">
{% endif %}
2021-04-14 03:22:22 +02:00
{% endfor %}
</div>
</div>
</div>
</div>
2021-08-22 03:52:57 +02:00
{# Menu pour mobile et tablette #}
<div class="level-item is-hidden-desktop">
<div class="dropdown is-right">
<div class="dropdown-trigger">
<a class="button is-primary is-large" aria-haspopup="true" aria-controls="dropdown-menu">
<span class="icon is-size-2">
<i class="fas fa-bars"></i>
</span>
</a>
</div>
<div class="dropdown-menu pr-1">
<div class="dropdown-content pb-0">
2021-08-22 03:52:57 +02:00
<a class="dropdown-item" href="{% url 'election.list' %}">
<span class="icon is-size-5 mr-3">
<i class="fas fa-vote-yea"></i>
</span>
<span class="is-size-5">{% trans "Élections" %}</span>
</a>
{% comment %}
<hr class="dropdown-divider">
<a class="dropdown-item" href="{% url 'faq.list' %}">
<span class="icon is-size-5 mr-3">
<i class="fas fa-question"></i>
</span>
<span class="has-text-weight-semibol is-size-5">{% trans "FAQs" %}</span>
</a>
{% endcomment %}
{% if user.is_staff %}
<hr class="dropdown-divider">
<a class="dropdown-item" href="{% url 'auth.admin' %}">
<span class="icon is-size-5 mr-3">
<i class="fas fa-cog"></i>
</span>
<span class="is-size-5">{% trans "Administration" %}</span>
</a>
{% endif %}
<hr class="dropdown-divider">
{% if user.is_authenticated %}
<a class="dropdown-item" href="{% url 'authens:logout' %}?next={% if view.get_next_url %}{{ view.get_next_url }}{% else %}/{% endif %}">
<span class="icon is-size-5 mr-3">
<i class="fas fa-sign-out-alt"></i>
</span>
<span class="is-size-5">{% trans "Déconnexion" %}</span>
</a>
{% else %}
<a class="dropdown-item" href="{% url 'authens:login' %}?next={{ request.path }}">
<span class="icon is-size-5 mr-3">
<i class="fas fa-sign-in-alt"></i>
</span>
<span class="is-size-5">{% trans "Se connecter" %}</span>
</a>
{% endif %}
{% for lang in langs %}
{% with lang_svg="images/"|add:lang.code|add:".svg" %}
<hr class="dropdown-divider {% if forloop.first %}mb-0{% else %}my-0{% endif %}">
2021-08-22 03:52:57 +02:00
<a class="dropdown-item lang-selector" data-lang="{{ lang.code }}">
<span class="icon-text">
<span class="icon mr-4">
2021-08-22 03:52:57 +02:00
<img style="border-radius:3px" src="{% static lang_svg %}">
</span>
<span class="is-size-">{{ lang.name_translated }}</span>
2021-08-22 03:52:57 +02:00
</span>
{% endwith %}
</a>
{% endfor %}
</div>
</div>
</div>
</div>
2020-12-18 11:48:07 +01:00
</div>
</nav>
2021-07-13 02:41:32 +02:00
2020-12-18 11:48:07 +01:00
{% block layout %}
<div class="main-content">
<div class="columns is-centered">
2020-12-24 01:10:05 +01:00
<div class="column is-two-thirds-fullhd is-12-desktop is-12-widescreen">
2021-08-23 14:25:10 +02:00
<section id="notifications" class="section pt-0">
{% for message in messages %}
<div class="notification is-{{ message.level_tag|bulma_message_tag }} is-light">
{% if 'safe' in message.tags %}
{{ message|safe }}
{% else %}
{{ message }}
{% endif %}
<button class="delete"></button>
</div>
{% endfor %}
<div id="content" class="box">
{% block content %}
{% endblock content %}
</div>
</section>
</div>
2020-11-20 19:31:22 +01:00
</div>
2020-12-18 11:48:07 +01:00
</div>
{% endblock layout %}
2021-08-22 03:52:57 +02:00
<footer class="footer">
<p class="has-text-centered">
2020-12-19 22:49:50 +01:00
{% blocktrans %}Développé par <a class="tag is-light is-danger" href="https://www.eleves.ens.fr/kde">KDEns</a>. En cas de pépin, contacter <span class="tag is-info is-light">klub-dev [at] ens [dot] fr</span>.{% endblocktrans %}
</p>
</footer>
{% block custom_js %}{% endblock %}
2020-12-18 11:48:07 +01:00
</body>
2020-11-20 19:31:22 +01:00
</html>