mirror of https://github.com/interlegis/sigi.git
Browse Source
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.htmlpull/183/head
moonshinerd
1 month ago
2 changed files with 113 additions and 0 deletions
@ -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> |
|||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a> |
|||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a> |
|||
› {% block breadcrumbs_last %}{% endblock %} |
|||
</div> |
|||
{% endblock %} |
|||
</nav> |
|||
{% endblock %} |
|||
{% endif %} |
|||
|
|||
{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} |
@ -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…
Reference in new issue