{% extends 'admin/change_form.html' %}

{% load i18n admin_urls static admin_modify edc_dashboard_extras edc_admin_modify %}

{% block extrahead %}{{ block.super }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{% static 'fontawesomefree/js/all.min.js' %}"></script>

<!-- edc_model_admin: add attr for delay_save_buttons.js -->
<script>window.adminSaveDelay = {{ save_delay|default:0 }};</script>

{% endblock %}

{% block extrastyle %}{{ block.super }}
{%  for css in edc_model_admin_css_theme_path %}
<link rel='stylesheet' type="text/css" href='{% static css %}'>
{% endfor %}
<!-- hack to fix wrapping radiolists -->
<style>
  form div.radiolist label {
    width: 600px;
}
</style>
{% endblock %}

{% block dark-mode-vars %}
<link rel="stylesheet" type="text/css" href="{% static 'edc_model_admin/css/dark_mode.css' %}">
{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block branding %}{% show_navbar_for_admin_templates_b3 %}&nbsp;{% if app_url %}<a href="{{ app_url }}">{{ opts.app_config.verbose_name|capfirst }}</A>{% else %}{{ opts.app_config.verbose_name|capfirst }}{% endif %}&nbsp;&rsaquo;&nbsp;<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name|capfirst|truncatechars:25 }}</A>&nbsp;&rsaquo;&nbsp;{% if add %}Add{% else %}Change{% endif %}{% endblock %}

{% block welcome-msg %}{% endblock %}

{% block userlinks %}{% logout_row %}{% endblock %}

{% block object-tools-items %}
{% if show_history_label %}<li>{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}<a href="{% add_preserved_filters history_url %}" class="historylink">{% translate history_label|default:"History" %}</a></li>{% endif %}
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% translate view_on_site_label|default:"View on site" %}</a></li>{% endif %}
{% endblock %}

{% block form_top %}
{% instructions %}
{% additional_instructions %}
{% endblock %}

{% block field_sets %}
{% for fieldset in adminform %}
{% for inline_admin_formset in inline_admin_formsets %}
{% if inline_admin_formset.formset.insert_before_fieldset and inline_admin_formset.formset.insert_before_fieldset == fieldset.name %}
{% include inline_admin_formset.opts.template %}
{% endif  %}
{% endfor %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}

{% block inline_field_sets %}
<!--begin inline_field_sets -->
{% for inline_admin_formset in inline_admin_formsets %}
{% if not inline_admin_formset.formset.insert_before_fieldset %}{% include inline_admin_formset.opts.template %}{% endif  %}
{% endfor %}
<!--end inline_field_sets -->
{% endblock %}

{% block submit_buttons_top %}{% edc_submit_row cancel_url cancel_url_kwargs cancel_url_querystring_data show_delete %}{% endblock %}

{% block submit_buttons_bottom %}
{% edc_submit_row cancel_url cancel_url_kwargs cancel_url_querystring_data show_delete %}
{% revision_row %}
{% endblock submit_buttons_bottom %}
