Browse Source

add: adicionando base.html e export.html

fix: corrige duplicação da navegação "Ínicio" no breadcrumbs, sobrescrevendo corretamente o bloco nav-breadcrumbs do Admin para evitar repetição. Esse bloco estava contido no import_export/base.html
pull/183/head
moonshinerd 1 month ago
parent
commit
7ce630bb33
  1. 23
      sigi/templates/admin/import_export/base.html
  2. 90
      sigi/templates/admin/import_export/export.html

23
sigi/templates/admin/import_export/base.html

@ -0,0 +1,23 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_modify %}
{% load admin_urls %}
{% load static %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% if not is_popup %}
{% block nav-breadcrumbs %}
<nav aria-label="{% translate 'Breadcrumbs' %}">
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; {% block breadcrumbs_last %}{% endblock %}
</div>
{% endblock %}
</nav>
{% endblock %}
{% endif %}
{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}

90
sigi/templates/admin/import_export/export.html

@ -0,0 +1,90 @@
{% extends "admin/import_export/base.html" %}
{% load i18n %}
{% load admin_urls %}
{% load import_export_tags %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ form.media }}
{% endblock %}
{% block breadcrumbs_last %}
{% translate "Export" %}
{% endblock %}
{% block content %}
{% if form.errors %}
{{ form.errors }}
{% endif %}
<form action="{{ export_url }}" method="POST">
{% csrf_token %}
{# export request has originated from an Admin UI action #}
{% if form.initial.export_items %}
<p>
{% blocktranslate count len=form.initial.export_items|length %}
Export {{ len }} selected item.
{% plural %}
Export {{ len }} selected items.
{% endblocktranslate %}
</p>
{% endif %}
{# fields list is not required with selectable fields form #}
{% if not form.is_selectable_fields_form %}
{% include "admin/import_export/resource_fields_list.html" with import_or_export="export" %}
{% endif %}
<fieldset class="module">
{% for field in form.visible_fields %}
<div
{% if field.field.is_selectable_field %}
{# all fields are visible by default, JS will hide unselected resource fields on load #}
class="selectable-field-export-row"
{# resource index will be used for showing-hiding fields #}
resource-index="{{ field.field.resource_index }}"
{% else %}
class="form-row aligned"
{% endif %}
>
{% if field.field.initial_field %}
<p style="padding: 0;">{% translate "This exporter will export the following fields: " %}</p>
{% endif %}
{{ field.errors }}
{% if not field.field.is_selectable_field %}
{{ field.label_tag }}
{% endif %}
{% if field.field.widget.attrs.readonly %}
{{ field.field.value }}
{{ field.as_hidden }}
{% else %}
{{ field }}
{% endif %}
{% if field.field.is_selectable_field %}
{{ field.label_tag }}
{% endif %}
{% if field.field.help_text %}
<p class="help">{{ field.field.help_text|safe }}</p>
{% endif %}
</div>
{% endfor %}
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
</fieldset>
<div>
{{ form.non_field_errors }}
</div>
<div class="submit-row">
<input type="submit" class="default" value="{% translate "Submit" %}">
</div>
</form>
{% endblock %}
Loading…
Cancel
Save