kadenios/shared/templates/base.html

111 lines
3.5 KiB
HTML
Raw Normal View History

2020-12-19 22:49:50 +01:00
{% load static bulma_utils i18n %}
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">
{# 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
{# Javascript #}
2020-12-18 13:40:40 +01:00
<script src="{% static 'vendor/jquery/jquery-3.5.1.min.js' %}"></script>
2020-12-18 11:48:07 +01:00
{# <script src="{% static 'elections/js/main.js' %}"></script> #}
<!-- Delete notification -->
<script>
document.addEventListener('DOMContentLoaded', () => {
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
var $notification = $delete.parentNode;
$delete.addEventListener('click', () => {
$notification.parentNode.removeChild($notification);
});
});
});
</script>
2020-12-18 11:48:07 +01:00
{% block extra_head %}{% endblock extra_head %}
</head>
<body>
<nav class="level has-background-primary">
<div class="level-left pl-4">
2020-12-19 23:48:18 +01:00
<div class="level-item">
<h1 class="has-text-primary-light is-size-1 is-family-secondary">Kadenios</h1>
</div>
2020-12-18 11:48:07 +01:00
</div>
2020-12-19 23:48:18 +01:00
<div class="level-right pr-5">
2020-12-21 00:07:07 +01:00
{% if user.is_authenticated %}
<div class="level-item mr-5">
<div class="tag">
{% blocktrans with name=user.base_username connection=user.connection_method %}Connecté·e en tant que {{ name }} par {{ connection }}{% endblocktrans %}
</div>
</div>
2020-12-21 00:07:07 +01:00
<div class="level-item ml-3">
<a class="icon is-size-1 has-text-white" href="{% url 'auth.logout' %}?next={{ view.get_next_url }}">
2020-12-19 23:48:18 +01:00
<i class="fas fa-sign-out-alt"></i>
2020-12-18 11:48:07 +01:00
</a>
2020-12-19 23:48:18 +01:00
</div>
2020-12-21 00:07:07 +01:00
{% else %}
2020-12-21 00:07:07 +01:00
<div class="level-item">
{% if election %}
<a class="icon is-size-1 has-text-white" href="{% url 'auth.select' %}?next={{ request.path }}&election_id={{ election.id }}&method={{ election.preferred_method }}">
<i class="fas fa-sign-in-alt"></i>
</a>
{% else %}
<a class="icon is-size-1 has-text-white" href="{% url 'auth.cas' %}?next={{ request.path }}">
2020-12-21 00:07:07 +01:00
<i class="fas fa-sign-in-alt"></i>
</a>
{% endif %}
2020-12-21 00:07:07 +01:00
</div>
{% endif %}
2020-12-18 11:48:07 +01:00
</div>
</nav>
{% block layout %}
<div class="main-content">
<div class="columns is-centered">
<div class="column is-two-thirds">
<section class="section pt-3">
{% if messages %}
{% 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 %}
2020-11-20 19:31:22 +01:00
{% endif %}
<div 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 %}
<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>
2020-12-18 11:48:07 +01:00
</body>
2020-11-20 19:31:22 +01:00
</html>