From 71d9b6fdc1b48f0a31c3c2f348bb715d9dde155b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 5 Oct 2023 13:14:56 +0200 Subject: ✨ improve import and import group sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - link to errors, match, result files - pre import values - link to associated imports and group imports --- ishtar_common/templates/ishtar/sheet_import.html | 2 +- .../templates/ishtar/sheet_import_gen.html | 55 ++++++++++++++++++++-- .../templates/ishtar/sheet_importgroup.html | 2 +- 3 files changed, 53 insertions(+), 6 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/sheet_import.html b/ishtar_common/templates/ishtar/sheet_import.html index 8685d9ae8..be5e12340 100644 --- a/ishtar_common/templates/ishtar/sheet_import.html +++ b/ishtar_common/templates/ishtar/sheet_import.html @@ -1,7 +1,7 @@ {% extends "ishtar/sheet.html" %} {% load i18n window_header window_field window_tables %} -{% block head_title %}{% trans "Import" %} – {{item.name}}{% endblock %} +{% block head_title %}{% trans "Import" %} – {{item.name}} – {{item.importer_type}}{% endblock %} {% block toolbar %} {% window_nav item window_id 'show-import' %} diff --git a/ishtar_common/templates/ishtar/sheet_import_gen.html b/ishtar_common/templates/ishtar/sheet_import_gen.html index 86c2ac6fe..4078c059b 100644 --- a/ishtar_common/templates/ishtar/sheet_import_gen.html +++ b/ishtar_common/templates/ishtar/sheet_import_gen.html @@ -1,4 +1,4 @@ -{% load i18n window_header window_field window_tables %} +{% load i18n link_to_window window_header window_field window_tables %} {% trans "Source" as source_label %} {% trans "Media" as media_label %} {% trans "Result" as result_label %} @@ -43,12 +43,13 @@ {% field_flex "Type" item.importer_type %}
-   {{item.creation_date|date:"DATE_FORMAT"}} {{item.creation_date|time:"H:i"}} - {% if item.end_date %}
  {{item.end_date|date:"DATE_FORMAT"}} {{item.end_date|time:"H:i"}}{% endif %} +   {{item.user}}
-   {{item.user}} +   {{item.creation_date|date:"DATE_FORMAT"}} {{item.creation_date|time:"H:i"}} + {% if item.end_date %}
  {{item.end_date|date:"DATE_FORMAT"}} {{item.end_date|time:"H:i"}}{% endif %}
+ {% field_flex_detail "Import group" item.group %} {% if item.imported_file %}
@@ -67,7 +68,53 @@ {% endif %} + + {% if item.error_file %} +
+ {% with file_label=error_label logo='text-danger fa fa-fw fa-exclamation-triangle' file_type='error' file=item.error_file %} + {% include "ishtar/blocks/import_table_buttons_view.html" %} + {% endwith %} +
+ {% endif %} + + {% if item.result_file %} +
+ {% with file_label=result_label logo='fa fa-fw fa-th' file_type='result' file=item.result_file %} + {% include "ishtar/blocks/import_table_buttons_view.html" %} + {% endwith %} +
+ {% endif %} + + {% if item.match_file %} +
+ {% with file_label=match_label logo='fa fa-fw fa-arrows-h' file_type='match' file=item.match_file %} + {% include "ishtar/blocks/import_table_buttons_view.html" %} + {% endwith %} +
+ {% endif %} + {% with import_list=item.import_list %}{% if import_list %} +
+
+
{% trans "Associated imports" %}
+
{% for import in import_list %}{{import|simple_link_to_window}} {{import}}
{% endfor %}
+
+ {% endif %} {% endwith %} +
+ + + {% with pre_import_items=item.pre_import_items %}{% if pre_import_items %} +

{% trans "Pre-import values "%}

+
{% for k, v in pre_import_items %} +
+
+ {{k}} +
+
+ {{v}} +
+
{% endfor %}
+ {% endif %}{% endwith %} {% if imported_list %}
{% trans "Import" %} – {{item.name}}{% endblock %} +{% block head_title %}{% trans "Import group" %} – {{item.name}} – {{item.importer_type}}{% endblock %} {% block toolbar %} {% window_nav item window_id 'show-importgroup' %} -- cgit v1.2.3