{# Copyright 2020 Karlsruhe Institute of Technology # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #} {% from "macros.html" import render_csrf, render_js %} {% set user_active = current_user.is_authenticated and current_user.state == UserState.ACTIVE and not current_user.identity.needs_email_confirmation and not current_user.needs_legals_acceptance %} {% set show_broadcast = get_sys_config(const.SYS_CONFIG_BROADCAST_MESSAGE_PUBLIC) or user_active %} {% if user_active %} {% set can_create_records = has_permission(current_user, "create", "record", None) %} {% set can_create_collections = has_permission(current_user, "create", "collection", None) %} {% set can_create_templates = has_permission(current_user, "create", "template", None) %} {% set can_create_groups = has_permission(current_user, "create", "group", None) %} {% endif %} {% include "snippets/base/meta.html" %} {% block title %} {% if title %}{{ title }} · Kadi4Mat{% else %}Kadi4Mat{% endif %} {% endblock %}
{% include "snippets/base/header.html" %}
{{ render_js("vendor.js") }} {# Plugin frontend translations. #}
{% for category, message in get_flashed_messages(with_categories=true) %} {% endfor %}
{% if show_broadcast %} {% set broadcast_message = get_sys_config(const.SYS_CONFIG_BROADCAST_MESSAGE) %}
{% endif %} {# Only show the breadcrumbs container if the respective block is actually used. #} {% if self.breadcrumbs() %} {% endif %} {# Container for the main content. #}
{% block content %}{% endblock %}
{{ render_js("app/main.js") }} {% block scripts %} {% endblock %} {# Plugin scripts, loaded before the main app is mounted. #} {% for script in get_plugin_scripts() %} {% endfor %}