From 7ce630bb33b24f70c4068aac01ba70181152c1ff Mon Sep 17 00:00:00 2001 From: moonshinerd Date: Tue, 19 Nov 2024 18:22:45 -0300 Subject: [PATCH 1/4] =?UTF-8?q?add:=20adicionando=20base.html=20e=20export?= =?UTF-8?q?.html=20fix:=20corrige=20duplica=C3=A7=C3=A3o=20da=20navega?= =?UTF-8?q?=C3=A7=C3=A3o=20"=C3=8Dnicio"=20no=20breadcrumbs,=20sobrescreve?= =?UTF-8?q?ndo=20corretamente=20o=20bloco=20nav-breadcrumbs=20do=20Admin?= =?UTF-8?q?=20para=20evitar=20repeti=C3=A7=C3=A3o.=20Esse=20bloco=20estava?= =?UTF-8?q?=20contido=20no=20import=5Fexport/base.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/templates/admin/import_export/base.html | 23 +++++ .../templates/admin/import_export/export.html | 90 +++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 sigi/templates/admin/import_export/base.html create mode 100644 sigi/templates/admin/import_export/export.html diff --git a/sigi/templates/admin/import_export/base.html b/sigi/templates/admin/import_export/base.html new file mode 100644 index 0000000..1a7f6cf --- /dev/null +++ b/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 }}{% endblock %} + +{% if not is_popup %} + {% block nav-breadcrumbs %} + + {% endblock %} +{% endif %} + +{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} diff --git a/sigi/templates/admin/import_export/export.html b/sigi/templates/admin/import_export/export.html new file mode 100644 index 0000000..697c32c --- /dev/null +++ b/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 }} + +{{ form.media }} +{% endblock %} + + +{% block breadcrumbs_last %} +{% translate "Export" %} +{% endblock %} + + +{% block content %} +{% if form.errors %} + {{ form.errors }} +{% endif %} +
+ {% csrf_token %} + {# export request has originated from an Admin UI action #} + {% if form.initial.export_items %} +

+ {% blocktranslate count len=form.initial.export_items|length %} + Export {{ len }} selected item. + {% plural %} + Export {{ len }} selected items. + {% endblocktranslate %} +

+ {% 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 %} + +
+ {% for field in form.visible_fields %} +
+ {% if field.field.initial_field %} +

{% translate "This exporter will export the following fields: " %}

+ {% 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 %} +

{{ field.field.help_text|safe }}

+ {% endif %} +
+ {% endfor %} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} +
+ +
+ {{ form.non_field_errors }} +
+ +
+ +
+
+{% endblock %} From 6cfdd0af20218a68e8a06c09faec7eab1f3c29e0 Mon Sep 17 00:00:00 2001 From: moonshinerd Date: Tue, 19 Nov 2024 19:28:22 -0300 Subject: [PATCH 2/4] fix: corrigindo export.html em labels e checkboxes e colocando o bt5 no botao enviar --- sigi/static/css/export.css | 3 ++ .../templates/admin/import_export/export.html | 47 +++++-------------- 2 files changed, 14 insertions(+), 36 deletions(-) create mode 100644 sigi/static/css/export.css diff --git a/sigi/static/css/export.css b/sigi/static/css/export.css new file mode 100644 index 0000000..eb02cfe --- /dev/null +++ b/sigi/static/css/export.css @@ -0,0 +1,3 @@ +input[type="checkbox"] { + vertical-align: middle; /* Alinha verticalmente ao texto */ +} diff --git a/sigi/templates/admin/import_export/export.html b/sigi/templates/admin/import_export/export.html index 697c32c..34c9edd 100644 --- a/sigi/templates/admin/import_export/export.html +++ b/sigi/templates/admin/import_export/export.html @@ -35,56 +35,31 @@ {% if not form.is_selectable_fields_form %} {% include "admin/import_export/resource_fields_list.html" with import_or_export="export" %} {% endif %} - +

+

{% translate "This exporter will export the following fields:" %}

{% for field in form.visible_fields %} -
- {% if field.field.initial_field %} -

{% translate "This exporter will export the following fields: " %}

- {% 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 %} -

{{ field.field.help_text|safe }}

- {% endif %} +
{% endfor %} {% for field in form.hidden_fields %} {{ field }} {% endfor %} -
+ +
{{ form.non_field_errors }}
- +
{% endblock %} From 4a5b305af20d79603c6ee76c8a57f88ea7441249 Mon Sep 17 00:00:00 2001 From: moonshinerd Date: Tue, 19 Nov 2024 19:28:53 -0300 Subject: [PATCH 3/4] =?UTF-8?q?remove:=20apagando=20arquivos=20desnecess?= =?UTF-8?q?=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/static/css/export.css | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 sigi/static/css/export.css diff --git a/sigi/static/css/export.css b/sigi/static/css/export.css deleted file mode 100644 index eb02cfe..0000000 --- a/sigi/static/css/export.css +++ /dev/null @@ -1,3 +0,0 @@ -input[type="checkbox"] { - vertical-align: middle; /* Alinha verticalmente ao texto */ -} From 9f1625ec58e1086afc31f64a368eefb21e5a3b4e Mon Sep 17 00:00:00 2001 From: moonshinerd Date: Tue, 19 Nov 2024 20:02:11 -0300 Subject: [PATCH 4/4] feat: melhorando a estetica do export --- .../templates/admin/import_export/export.html | 79 +++++++++++-------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/sigi/templates/admin/import_export/export.html b/sigi/templates/admin/import_export/export.html index 34c9edd..dc6870d 100644 --- a/sigi/templates/admin/import_export/export.html +++ b/sigi/templates/admin/import_export/export.html @@ -3,63 +3,78 @@ {% load admin_urls %} {% load import_export_tags %} -{% block extrahead %}{{ block.super }} +{% block extrahead %} +{{ block.super }} {{ form.media }} {% endblock %} - {% block breadcrumbs_last %} {% translate "Export" %} {% endblock %} - {% block content %} {% if form.errors %} {{ form.errors }} {% endif %}
{% csrf_token %} - {# export request has originated from an Admin UI action #} - {% if form.initial.export_items %} -

- {% blocktranslate count len=form.initial.export_items|length %} - Export {{ len }} selected item. - {% plural %} - Export {{ len }} selected items. - {% endblocktranslate %} -

- {% endif %} + {# Export request has originated from an Admin UI action #} + {% if form.initial.export_items %} +

+ {% blocktranslate count len=form.initial.export_items|length %} + Export {{ len }} selected item. + {% plural %} + Export {{ len }} selected items. + {% endblocktranslate %} +

+ {% endif %} - {# fields list is not required with selectable fields form #} + {# 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 %}

+

{% translate "This exporter will export the following fields:" %}

- {% for field in form.visible_fields %} -
- -
- {{ field }} -
-
- {% endfor %} + +
+ {% for field in form.visible_fields %} + {% if field.name != "format" %} {# Excluindo o campo "Formato" da lista automática #} +
+
+
+ + {{ field }} + {% if field.field.help_text %} + + {{ field.field.help_text|safe }} + + {% endif %} +
+
+
+ {% endif %} + {% endfor %} +
+ {% for field in form.hidden_fields %} - {{ field }} + {{ field }} {% endfor %} -
- - -
- {{ form.non_field_errors }} + + + {# Campo "Formato" separado, posicionado de forma independente #} +
+ + {{ form.format }}
- -
+ +
+ {% endblock %}