1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 16:02:25 +00:00
nk20/templates/base.html

233 lines
11 KiB
HTML
Raw Normal View History

{% load static i18n pretty_money static getenv perms %}
2019-08-14 13:17:14 +00:00
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
2019-08-10 17:00:16 +00:00
<!DOCTYPE html>
2019-08-14 13:17:14 +00:00
<html lang="en" class="position-relative h-100">
2019-08-10 17:00:16 +00:00
<head>
2019-08-14 13:17:14 +00:00
<meta charset="utf-8">
2020-02-21 10:02:29 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
2019-08-14 13:17:14 +00:00
<title>
{% block title %}{{ title }}{% endblock title %} - {{ request.site.name }}
</title>
<meta name="description" content="{% trans "The ENS Paris-Saclay BDE note." %}">
2019-08-10 17:00:16 +00:00
2019-08-14 13:17:14 +00:00
{# Favicon #}
<link rel="apple-touch-icon" sizes="180x180" href="{% static "favicon/apple-touch-icon.png" %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static "favicon/favicon-32x32.png" %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static "favicon/favicon-16x16.png" %}">
<link rel="manifest" href="{% static "favicon/site.webmanifest" %}">
<link rel="mask-icon" href="{% static "favicon/safari-pinned-tab.svg" %}" color="#5bbad5">
<link rel="shortcut icon" href="{% static "favicon/favicon.ico" %}">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="{% static "favicon/browserconfig.xml" %}">
<meta name="theme-color" content="#ffffff">
2020-02-21 17:28:21 +00:00
{% if no_cache %}
<meta name="turbolinks-cache-control" content="no-cache">
{% endif %}
2019-08-10 17:00:16 +00:00
2019-08-14 13:17:14 +00:00
{# Bootstrap CSS #}
<link rel="stylesheet"
2020-02-21 10:02:29 +00:00
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
2019-08-14 13:17:14 +00:00
crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/v4-shims.css">
2020-02-08 19:27:22 +00:00
2020-02-21 20:15:49 +00:00
{# JQuery, Bootstrap and Turbolinks JavaScript #}
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh"
crossorigin="anonymous"></script>
2020-02-21 16:07:28 +00:00
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
2020-02-21 20:15:49 +00:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js"
crossorigin="anonymous"></script>
2020-03-12 15:53:35 +00:00
<script src="/static/js/base.js"></script>
2020-02-21 16:07:28 +00:00
{# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #}
{% if form.media %}
{{ form.media }}
{% endif %}
<style>
.validate:hover {
cursor: pointer;
text-decoration: underline;
}
2020-04-10 20:51:26 +00:00
.tooltip.show {
opacity: 1; /* opaque tooltip */
}
2020-04-10 19:36:04 +00:00
.tooltip-inner {
background-color: #fff;
box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
2020-04-10 20:22:07 +00:00
border: 1px solid rgba(0,0,0,.250);
2020-04-10 19:36:04 +00:00
color: #000;
2020-04-10 20:22:07 +00:00
margin: 0 .5rem .25rem .5rem;
padding: 0;
}
.bs-tooltip-bottom .arrow::before {
border-bottom-color: rgba(0,0,0,.250);
2020-04-10 19:36:04 +00:00
}
</style>
2019-08-14 13:17:14 +00:00
{% block extracss %}{% endblock %}
</head>
2020-02-21 10:02:29 +00:00
<body class="d-flex w-100 h-100 flex-column">
<main class="mb-auto">
2020-02-21 12:50:35 +00:00
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-navbar shadow-sm">
2019-08-14 13:17:14 +00:00
<a class="navbar-brand" href="/">{{ request.site.name }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse"
2020-02-27 11:00:02 +00:00
data-target="#navbarNavDropdown"
aria-controls="navbarNavDropdown" aria-expanded="false"
2019-08-14 13:17:14 +00:00
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
{% if "note.transactiontemplate"|not_empty_model_list %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'note:consos' %}"><i class="fas fa-coffee"></i> {% trans 'Consumptions' %}</a>
</li>
{% endif %}
2020-03-26 16:41:11 +00:00
{% if "note.transaction"|not_empty_model_list %}
2020-03-23 14:53:10 +00:00
<li class="nav-item active">
<a class="nav-link" href="{% url 'note:transfer' %}"><i class="fas fa-exchange-alt"></i>{% trans 'Transfer' %} </a>
2020-03-23 14:53:10 +00:00
</li>
2020-03-26 16:41:11 +00:00
{% endif %}
2020-07-25 15:25:57 +00:00
{% if "auth.user"|model_list_length >= 2 %}
2020-04-01 18:56:24 +00:00
<li class="nav-item active">
<a class="nav-link" href="{% url 'member:user_list' %}"><i class="fas fa-user"></i> {% trans 'Users' %}</a>
2020-04-01 18:56:24 +00:00
</li>
{% endif %}
{% if "member.club"|not_empty_model_list %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'member:club_list' %}"><i class="fas fa-users"></i> {% trans 'Clubs' %}</a>
</li>
{% endif %}
2020-04-05 04:40:03 +00:00
{% if "member.change_profile_registration_valid"|has_perm:user %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'registration:future_user_list' %}">
<i class="fas fa-user-plus"></i> {% trans "Registrations" %}
2020-04-05 04:40:03 +00:00
</a>
</li>
{% endif %}
{% if "activity.activity"|not_empty_model_list %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'activity:activity_list' %}"><i class="fas fa-calendar"></i> {% trans 'Activities' %}</a>
</li>
{% endif %}
2020-04-24 12:03:25 +00:00
{% if "treasury.invoice"|not_empty_model_list %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'treasury:invoice_list' %}"><i class="fas fa-credit-card"></i> {% trans 'Treasury' %}</a>
</li>
{% endif %}
2020-04-24 12:03:25 +00:00
{% if "wei.weiclub"|not_empty_model_list %}
2020-04-20 23:06:54 +00:00
<li class="nav-item active">
<a class="nav-link" href="{% url 'wei:current_wei_detail' %}"><i class="fas fa-bus"></i> {% trans 'WEI' %}</a>
</li>
{% endif %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'permission:rights' %}"><i class="fas fa-balance-scale"></i> {% trans 'Rights' %}</a>
</li>
{% if user.is_staff %}
<li class="nav-item active">
2020-04-27 15:59:34 +00:00
<a data-turbolinks="false" class="nav-link" href="{% url 'admin:index' %}"><i class="fas fa-user-cog"></i> {% trans 'Administration' %}</a>
</li>
{% endif %}
2019-08-14 13:17:14 +00:00
</ul>
<ul class="navbar-nav ml-auto">
{% if user.is_authenticated %}
2019-08-10 17:00:16 +00:00
<li class="dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-user"></i>
2020-03-12 09:53:06 +00:00
<span id="user_balance">{{ user.username }} ({{ user.note.balance | pretty_money }})</span>
2019-08-10 17:00:16 +00:00
</a>
2019-08-14 13:17:14 +00:00
<div class="dropdown-menu dropdown-menu-right"
aria-labelledby="navbarDropdownMenuLink">
2020-02-25 21:55:27 +00:00
<a class="dropdown-item" href="{% url 'member:user_detail' pk=user.pk %}">
<i class="fas fa-user"></i> Mon compte
2019-08-14 13:17:14 +00:00
</a>
2019-08-10 17:00:16 +00:00
<a class="dropdown-item" href="{% url 'logout' %}">
<i class="fas fa-sign-out-alt"></i> Se déconnecter
2019-08-14 13:17:14 +00:00
</a>
2019-08-10 17:00:16 +00:00
</div>
</li>
2019-08-14 13:17:14 +00:00
{% else %}
2019-08-10 17:00:16 +00:00
<li class="nav-item active">
2020-04-05 03:17:28 +00:00
<a class="nav-link" href="{% url 'registration:signup' %}">
<i class="fas fa-user-plus"></i> S'inscrire
2019-08-10 17:00:16 +00:00
</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url 'login' %}">
<i class="fas fa-sign-in-alt"></i> Se connecter
2019-08-10 17:00:16 +00:00
</a>
</li>
2019-08-14 13:17:14 +00:00
{% endif %}
</ul>
</div>
</nav>
2020-02-21 12:50:35 +00:00
<div class="container-fluid my-3" style="max-width: 1600px;">
2020-04-05 03:17:28 +00:00
{% if user.is_authenticated and not user.profile.email_confirmed %}
<div class="alert alert-warning">
{% trans "Your e-mail address is not validated. Please check your mail inbox and click on the validation link." %}
</div>
{% endif %}
2020-02-21 12:50:35 +00:00
{% block contenttitle %}<h1>{{ title }}</h1>{% endblock %}
2020-03-12 22:12:49 +00:00
<div id="messages"></div>
2020-02-21 12:50:35 +00:00
{% block content %}
<p>Default content...</p>
{% endblock content %}
2019-08-14 13:17:14 +00:00
</div>
</main>
2020-02-21 10:02:29 +00:00
<footer class="bg-light mt-auto py-2">
2019-08-14 13:17:14 +00:00
<div class="container-fluid">
<div class="row">
<div class="col-sm">
<form action="{% url 'set_language' %}" method="post"
class="form-inline">
<span class="text-muted mr-1">
2020-02-21 12:50:35 +00:00
NoteKfet2020 &mdash;
2020-03-11 16:51:42 +00:00
<a href="mailto:{{ "CONTACT_EMAIL" | getenv }}"
2020-02-21 12:50:35 +00:00
class="text-muted">Nous contacter</a> &mdash;
2019-08-14 13:17:14 +00:00
</span>
{% csrf_token %}
<select title="language" name="language"
class="custom-select custom-select-sm"
onchange="this.form.submit()">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"
{% if language.code == LANGUAGE_CODE %}
selected{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
<noscript>
<input type="submit">
</noscript>
</form>
</div>
<div class="col-sm text-right">
<a href="#" class="text-muted">Retour en haut</a>
</div>
2019-08-10 17:00:16 +00:00
</div>
2019-08-14 13:17:14 +00:00
</div>
</footer>
2019-08-10 17:00:16 +00:00
2020-03-13 08:26:39 +00:00
<script>
CSRF_TOKEN = "{{ csrf_token }}";
</script>
2019-08-14 13:17:14 +00:00
{% block extrajavascript %}
{% endblock extrajavascript %}
2019-08-10 17:00:16 +00:00
</body>
</html>