2024-12-16 17:17:42 +00:00
|
|
|
{#
|
|
|
|
The main template inherited by almost every other templates.
|
|
|
|
|
|
|
|
:param user: The current user, if logged in.
|
|
|
|
:type user: :class:`~canaille.core.models.User`
|
|
|
|
:param features: The features enabled and available in Canaille.
|
|
|
|
:type features: :class:`~canaille.app.features.Features`
|
|
|
|
:param locale: The user locale.
|
|
|
|
:type locale: :class:`str`
|
|
|
|
:param website_name: The Canaille instance defined in :attr:`~canaille.core.configuration.CoreSettings.NAME`.
|
|
|
|
:type website_name: :class:`str`
|
|
|
|
:param logo_url: The URL of the instance logo defined in :attr:`~canaille.core.configuration.CoreSettings.LOGO`.
|
|
|
|
:type logo_url: :class:`str`
|
|
|
|
:param favicon_url: The URL of the instance favicon defined in :attr:`~canaille.core.configuration.CoreSettings.FAVICON`.
|
|
|
|
:type favicon_url: :class:`str`
|
|
|
|
:param is_boosted: Whether the page is boosted by :attr:`~canaille.core.configuration.CoreSettings.HTMX`.
|
|
|
|
:type is_boosted: :class:`bool`
|
|
|
|
:param menu: Whether to display the menu or not.
|
|
|
|
:type menu: :class:`bool`
|
|
|
|
:param debug: Whether the app has been launched in debug mode.
|
|
|
|
:type debug: :class:`bool`
|
|
|
|
#}
|
2023-08-14 13:48:56 +00:00
|
|
|
{%- import 'macro/flask.html' as flask -%}
|
|
|
|
|
|
|
|
<!doctype html>
|
|
|
|
<html lang="{{ locale }}">
|
|
|
|
<head>
|
|
|
|
<title>{% block title -%}{% trans %}Authorization interface{% endtrans %}{%- endblock %} - {{ website_name|default("Canaille") }}</title>
|
|
|
|
|
|
|
|
{% if not is_boosted %}
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
|
2023-12-25 19:15:21 +00:00
|
|
|
<link href="{{ url_for("static", filename="fomanticui/semantic.min.css") }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for("static", filename="fonts/lato.css") }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for("static", filename="css/base.css") }}" rel="stylesheet">
|
2023-08-14 13:48:56 +00:00
|
|
|
{% if logo_url %}<link rel="icon" href="{{ favicon_url }}">{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% block style %}{% endblock %}
|
|
|
|
</head>
|
|
|
|
|
2024-04-09 10:06:33 +00:00
|
|
|
<body{% if config["CANAILLE"]["JAVASCRIPT"] and config["CANAILLE"]["HTMX"] %} hx-boost="true"{% endif %}>
|
2023-08-14 13:48:56 +00:00
|
|
|
{% block menu %}
|
2024-04-09 20:06:08 +00:00
|
|
|
{% if menu %}
|
2023-08-14 13:48:56 +00:00
|
|
|
<div class="ui container menu-container">
|
|
|
|
<nav class="ui stackable labeled icon seven item {% if self.submenu() | trim %}top attached{% endif %} menu">
|
|
|
|
{% if logo_url %}
|
|
|
|
<a href="/" class="item logo">
|
|
|
|
<img class="ui img" src="{{ logo_url }}" alt="{{ website_name }}" />
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
|
2024-04-09 20:06:08 +00:00
|
|
|
{% if user %}
|
|
|
|
{% if user.can_edit_self %}
|
|
|
|
<a class="item {% if menuitem is defined and menuitem == "profile" %}active{% endif %}"
|
|
|
|
href="{{ url_for('core.account.profile_edition', edited_user=user) }}">
|
|
|
|
<i class="id card icon"></i>
|
|
|
|
{% trans %}Profile{% endtrans %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2024-05-14 20:53:47 +00:00
|
|
|
{% if features.has_oidc and user.can_use_oidc %}
|
2024-04-09 20:06:08 +00:00
|
|
|
<a class="item {% if menuitem is defined and menuitem == "consents" %}active{% endif %}"
|
|
|
|
href="{{ url_for('oidc.consents.consents') }}">
|
|
|
|
<i class="handshake icon"></i>
|
|
|
|
{% trans %}Consents{% endtrans %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if user.can_manage_users %}
|
|
|
|
<a class="item {% if menuitem is defined and menuitem == "users" %}active{% endif %}"
|
|
|
|
href="{{ url_for('core.account.users') }}">
|
|
|
|
<i class="address book icon"></i>
|
|
|
|
{% trans %}Users{% endtrans %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if user.can_manage_groups %}
|
|
|
|
<a class="item {% if menuitem is defined and menuitem == "groups" %}active{% endif %}"
|
|
|
|
href="{{ url_for('core.groups.groups') }}">
|
|
|
|
<i class="users icon"></i>
|
|
|
|
{% trans %}Groups{% endtrans %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if user.can_manage_oidc %}
|
|
|
|
<a class="item {% if menuitem is defined and menuitem == "admin" %}active{% endif %}" href="{{ url_for('core.admin.mail_index') }}">
|
|
|
|
<i class="settings icon"></i>
|
|
|
|
{% trans %}Admin{% endtrans %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
<a class="item" href="{{ url_for('core.auth.logout') }}">
|
|
|
|
<i class="sign out alternate icon"></i>
|
|
|
|
{% trans %}Log out{% endtrans %}
|
2023-08-14 13:48:56 +00:00
|
|
|
</a>
|
2024-04-09 20:06:08 +00:00
|
|
|
{% else %}
|
|
|
|
<a class="item" href="{{ url_for('core.auth.login') }}">
|
|
|
|
<i class="sign in alternate icon"></i>
|
|
|
|
{% trans %}Sign in{% endtrans %}
|
2023-08-14 13:48:56 +00:00
|
|
|
</a>
|
2024-04-09 20:06:08 +00:00
|
|
|
|
2023-08-14 13:48:56 +00:00
|
|
|
{% endif %}
|
|
|
|
</nav>
|
2023-09-08 07:05:51 +00:00
|
|
|
{% if self.submenu() | trim %}
|
|
|
|
<nav class="ui bottom attached equal width borderless menu">
|
|
|
|
{% block submenu %}{% endblock %}
|
|
|
|
</nav>
|
|
|
|
{% endif %}
|
2023-08-14 13:48:56 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block container %}
|
|
|
|
<div class="ui container">
|
|
|
|
<div class="ui content">
|
|
|
|
{{ flask.messages() }}
|
|
|
|
{% block content %}{% endblock %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
<a href="{{ url_for('core.account.about') }}">{{ _("About Canaille") }}</a>
|
|
|
|
</footer>
|
2024-04-09 10:06:33 +00:00
|
|
|
{% if config["CANAILLE"]["JAVASCRIPT"] %}
|
2023-08-14 13:48:56 +00:00
|
|
|
{% if not is_boosted %}
|
2023-12-25 19:15:21 +00:00
|
|
|
<script src="{{ url_for("static", filename="jquery/jquery.min.js") }}" defer></script>
|
|
|
|
<script src="{{ url_for("static", filename="fomanticui/semantic.min.js") }}" defer></script>
|
2024-04-09 10:06:33 +00:00
|
|
|
{% if config["CANAILLE"]["HTMX"] %}
|
2023-12-25 19:15:21 +00:00
|
|
|
<script src="{{ url_for("static", filename="htmx/htmx.min.js") }}" defer></script>
|
2023-08-14 13:48:56 +00:00
|
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
htmx.config.requestClass = "loading"
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
2023-12-25 19:15:21 +00:00
|
|
|
<script src="{{ url_for("static", filename="js/base.js") }}" defer></script>
|
2023-08-14 13:48:56 +00:00
|
|
|
{% endif %}
|
|
|
|
{% block script %}{% endblock %}
|
|
|
|
{% endif %}
|
|
|
|
</body>
|
|
|
|
</html>
|