{% extends "admin/change_form.html" %}
{% load i18n admin_urls static kmuhelper_tags %}

{% block title %}{{ title }} | KMUHelper{% endblock %}

{% block breadcrumbs %}
    {% get_admin_module as module %}
    {% get_admin_model as model %}

    <div class="breadcrumbs">
        <a href="{% url module.viewname %}">KMUHelper {{ module.title }}</a>
        &rsaquo; {% if has_view_permission %}
        <a href="{% url opts|admin_urlname:'changelist' %}">
            {{ model.ADMIN_TITLE | default:opts.verbose_name_plural }}</a>{% else %}
        {{ model.ADMIN_TITLE | default:opts.verbose_name_plural }}{% endif %}
        &rsaquo;
        {% if add %}{% blocktranslate with name=opts.verbose_name %}Add {{ name }}{% endblocktranslate %}{% else %}
            {{ original|truncatewords:"18" }}{% endif %}
    </div>
{% endblock %}

{% block branding %}
    {% kmuhelper_branding %}
{% endblock %}

{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'admin/kmuhelper/css/style.css' %}">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.5.2/css/all.css"
          integrity="sha384-PPIZEGYM1v8zp5Py7UjFb79S58UeqCL9pYVnVPURKEqvioPROaVAJKKLzvH2rDnI" crossorigin="anonymous">
{% endblock %}

{% block extrahead %}
    {{ block.super }}
    {% include "kmuhelper/_includes/pwa_head.html" %}

    {% comment %} Load the 'collapse-opem' schript {% endcomment %}
    <script src="{% static 'admin/kmuhelper/js/collapse-open.js' %}" type="text/javascript"></script>
    {% comment %} Load the beforeunload script {% endcomment %}
    <script src="{% static 'admin/kmuhelper/js/beforeunload.js' %}" type="text/javascript"></script>
{% endblock %}
