Browse Source

Merge pull request #184 from moonshinerd/sigi-4.0

Ajustes no template de exportação do Admin com Bootstrap e resolução de conflitos de merge
sigi-4.0
Sesostris Vieira 2 weeks ago
committed by GitHub
parent
commit
ae4edf3612
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 23
      sigi/templates/admin/import_export/base.html
  2. 80
      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 %}

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

@ -0,0 +1,80 @@
{% 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 %}
<p></p>
<fieldset class="module">
<p style="padding: 0;">{% translate "This exporter will export the following fields:" %}</p>
<div class="row">
{% for field in form.visible_fields %}
{% if field.name != "format" %} {# Excluindo o campo "Formato" da lista automática #}
<div class="col-md-4 col-lg-3 mb-4">
<div class="card h-100" style="width: 100%;">
<div class="card-body">
<label for="{{ field.id_for_label }}" class="form-label d-block">
{{ field.label }}
</label>
{{ field }}
{% if field.field.help_text %}
<small class="text-muted d-block mt-1">
{{ field.field.help_text|safe }}
</small>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
</fieldset>
{# Campo "Formato" separado, posicionado de forma independente #}
<div class="mt-4">
<label for="{{ form.format.id_for_label }}" class="form-label">{{ form.format.label }}</label>
{{ form.format }}
</div>
<div class="submit-row mt-4">
<input type="submit" class="btn btn-outline-primary" value="{% translate "Submit" %}">
</div>
</form>
{% endblock %}
Loading…
Cancel
Save