From d828cce778cfe6e826bf09745ef207d022c89d53 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 18 Feb 2025 15:22:57 +0100 Subject: 🐛 fix museum find templates - refaction sheet find MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/ishtar/sheet_find.html | 264 +------------------- .../templates/ishtar/sheet_find_treatments.html | 269 +++++++++++++++++++++ .../templates/ishtar/sheet_museum_find.html | 257 +------------------- 3 files changed, 271 insertions(+), 519 deletions(-) create mode 100644 archaeological_finds/templates/ishtar/sheet_find_treatments.html (limited to 'archaeological_finds') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index d7d2b423f..768bd0ea1 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -274,271 +274,9 @@ {% endif %} {% endif %} -
- {% comment %} - {% if item.collection %} -
- {% field_flex_detail "Collection" item.collection "large" %} -
- {% endif %} - {% endcomment %} - {% if item.integrities_count or item.remarkabilities_count or item.conservatory_states_count or item.conservatory_comment or item.alterations.count or item.alteration_causes.count or item.preservation_to_considers.count or item.appraisal_date or item.treatment_emergency or item.insurance_value or item.estimated_value %} -

{% trans "Preservation" %}

-
- {% field_flex_multiple_obj "Integrity" item 'integrities' %} - {% field_flex_multiple_obj "Remarkability" item 'remarkabilities' %} - {% field_flex_multiple_obj _("Conservatory states") item 'conservatory_states' %} - {% field_flex_multiple_obj "Alteration" item 'alterations' %} - {% field_flex_multiple_obj "Alteration cause" item 'alteration_causes' %} - {% field_flex_multiple_obj "Recommended treatments" item 'preservation_to_considers' %} - {% field_flex "Treatment emergency" item.treatment_emergency %} - {% field_flex "Estimated value" item.estimated_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} - {% field_flex "Insurance value" item.insurance_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} - {% field_flex "Appraisal date" item.appraisal_date %} - {% field_flex_full "Conservatory comment" item.conservatory_comment "
" "
" %} -
- {% endif %} - {% if item.container or item.container_ref %} - {% if can_view_container %} -

{% trans "Warehouse - container" %}

-
- {% if item.container_ref != item.container and item.container_ref %} -
-
{% trans "Reference container" %}
-
- -
-
- {% endif %} - {% if item.container %} -
-
- {% if item.container_ref != item.container %} - {% trans "Current container" %}{% else %} - {% trans "Reference container / current container" %} - {% endif %} -
-
- -
-
- {% if item.container.index %} -
-
-
{% trans "Index" %}
-
- {{ item.container.location }} - {{ item.container.index|unlocalize }} -
-
-
- {% endif %} - {% endif %} -
- {% else %} - - {% endif %} - {% endif %} - {% if item.upstream_treatment or item.downstream_treatment or non_modif_treatments_count %} - {% if non_modif_treatments_count %} -

{% trans "Simple treatments"%}

- - - - - - - - - {% if can_view_container %}{% endif %} - - - {# {% for treatment in item.treatments.all %} #} - {% for items, treatment in item.non_modif_treatments %} - - - - - - - - {% if can_view_container %}{% endif %} - - - {% endfor %} - {% if can_view_container and item.container_fisrt_full_location %} - - - - - {% endif %} - {% if can_view_container and item.container_ref_fisrt_full_location and item.container_ref_fisrt_full_location != item.container_fisrt_full_location %} - - - - - {% endif %} -
 {% trans "Year - index" %}{% trans "Label/type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Date start/end" %}
- - - - {{ treatment.year|unlocalize }}-{{treatment.index|unlocalize}}{% if treatment.label %}{{ treatment.label}} ({{treatment.treatment_types_lbl}}){% else %}{{treatment.treatment_types_lbl}}{% endif %}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{% for find_treatment in treatment.get_find_treatment_list %}{% if find_treatment.find.pk == item.pk %}{{ find_treatment.full_location|default_if_none:"-" }}{% if find_treatment.location_type_label %} {{find_treatment.location_type_label}}{% endif %}{% endif %}{% endfor %}{{ treatment.start_date|default_if_none:"-" }}{% if treatment.end_date %}/{{ treatment.end_date|default_if_none:"-" }}{% endif %}
{% trans "First packaging" %}{{ item.container_fisrt_full_location }} {% if item.container_fisrt_full_location == item.container_ref_fisrt_full_location %}{% trans "Reference/current" %}{% else %}{% trans "Current" %}{% endif %}
{% trans "First packaging" %}{{ item.container_ref_fisrt_full_location }} {% trans "Reference" %}
- {% endif %} - - {% if item.upstream_treatment %} -

{% trans "Upstream treatment" %}

- - - - - - - - - - {% if can_view_container %}{% endif %} - - - - {% for items, treatment in item.limited_upstream_treatments %} - - - - - - - - - {% if can_view_container %}{% endif %} - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
- - - - {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"-" }}{{ treatment.end_date|default_if_none:"-" }}
-

{% trans "CSV" %} ({{ENCODING}})

- {% endif %} + {% include "ishtar/sheet_find_treatments.html" %} - {% if item.downstream_treatment %} -

{% trans "Downstream treatment" %}

- - - - - - - - - - {% if can_view_container %}{% endif %} - - - - {% for items, treatment in item.limited_downstream_treatments %} - - - - - - - - - {% if can_view_container %}{% endif %} - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
- - - - {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{ it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"" }}{{ treatment.end_date|default_if_none:"" }}
- -

{% trans "CSV" %} ({{ENCODING}})

- {% endif %} - {% endif %} - {% if item.associated_treatment_files_count %} -

{% trans "Treatment requests" %}

- - - - - - - - - - - - - {% for treatment_file in item.associated_treatment_files %} - - - - - - - - - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Type" %}{% trans "Name" %}{% trans "Person in charge" %}{% trans "Applicant" %}{% trans "Applicant organisation" %}{% trans "Reception date" %}{% trans "End date" %}
- - - - {{ treatment_file.year }} - {{treatment_file.index}}{{ treatment_file.type }}{{ treatment_file.name|default_if_none:"-" }}{{ treatment_file.in_charge|default_if_none:"" }}{{ treatment_file.applicant|default_if_none:"" }}{{ treatment_file.applicant_organisation|default_if_none:"" }}{{ treatment_file.reception_date|default_if_none:"" }}{{ treatment_file.end_date|default_if_none:"" }}
- {% endif %} -
{% if display_documents %}
diff --git a/archaeological_finds/templates/ishtar/sheet_find_treatments.html b/archaeological_finds/templates/ishtar/sheet_find_treatments.html new file mode 100644 index 000000000..a02a79c73 --- /dev/null +++ b/archaeological_finds/templates/ishtar/sheet_find_treatments.html @@ -0,0 +1,269 @@ +{% load i18n l10n window_field link_to_window humanize %} +
+ + {% comment %} + {% if item.collection %} +
+ {% field_flex_detail "Collection" item.collection "large" %} +
+ {% endif %} + {% endcomment %} + {% if item.integrities_count or item.remarkabilities_count or item.conservatory_states_count or item.conservatory_comment or item.alterations.count or item.alteration_causes.count or item.preservation_to_considers.count or item.appraisal_date or item.treatment_emergency or item.insurance_value or item.estimated_value %} +

{% trans "Preservation" %}

+
+ {% field_flex_multiple_obj "Integrity" item 'integrities' %} + {% field_flex_multiple_obj "Remarkability" item 'remarkabilities' %} + {% field_flex_multiple_obj _("Conservatory states") item 'conservatory_states' %} + {% field_flex_multiple_obj "Alteration" item 'alterations' %} + {% field_flex_multiple_obj "Alteration cause" item 'alteration_causes' %} + {% field_flex_multiple_obj "Recommended treatments" item 'preservation_to_considers' %} + {% field_flex "Treatment emergency" item.treatment_emergency %} + {% field_flex "Estimated value" item.estimated_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} + {% field_flex "Insurance value" item.insurance_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} + {% field_flex "Appraisal date" item.appraisal_date %} + {% field_flex_full "Conservatory comment" item.conservatory_comment "
" "
" %} +
+ {% endif %} + {% if item.container or item.container_ref %} + {% if can_view_container %} +

{% trans "Warehouse - container" %}

+
+ {% if item.container_ref != item.container and item.container_ref %} +
+
{% trans "Reference container" %}
+
+ +
+
+ {% endif %} + {% if item.container %} +
+
+ {% if item.container_ref != item.container %} + {% trans "Current container" %}{% else %} + {% trans "Reference container / current container" %} + {% endif %} +
+
+ +
+
+ {% if item.container.index %} +
+
+
{% trans "Index" %}
+
+ {{ item.container.location }} - {{ item.container.index|unlocalize }} +
+
+
+ {% endif %} + {% endif %} +
+ {% else %} + + {% endif %} + + {% endif %} + {% if item.upstream_treatment or item.downstream_treatment or non_modif_treatments_count %} + + {% if item.upstream_treatment %} +

{% trans "Upstream treatment" %}

+ + + + + + + + + + {% if can_view_container %}{% endif %} + + + + {% for items, treatment in item.limited_upstream_treatments %} + + + + + + + + + {% if can_view_container %}{% endif %} + + + + {% endfor %} +
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
+ + + + {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"-" }}{{ treatment.end_date|default_if_none:"-" }}
+

{% trans "CSV" %} ({{ENCODING}})

+ {% endif %} + + {% if item.downstream_treatment %} +

{% trans "Downstream treatment" %}

+ + + + + + + + + + {% if can_view_container %}{% endif %} + + + + {% for items, treatment in item.limited_downstream_treatments %} + + + + + + + + + {% if can_view_container %}{% endif %} + + + + {% endfor %} +
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
+ + + + {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{ it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"" }}{{ treatment.end_date|default_if_none:"" }}
+ +

{% trans "CSV" %} ({{ENCODING}})

+ {% endif %} + {% endif %} + + {% if non_modif_treatments_count %} +

{% trans "Simple treatments"%}

+ + + + + + + + + {% if can_view_container %}{% endif %} + + + {# {% for treatment in item.treatments.all %} #} + {% for items, treatment in item.non_modif_treatments %} + + + + + + + + {% if can_view_container %}{% endif %} + + + {% endfor %} + {% if can_view_container and item.container_fisrt_full_location %} + + + + + {% endif %} + {% if can_view_container and item.container_ref_fisrt_full_location and item.container_ref_fisrt_full_location != item.container_fisrt_full_location %} + + + + + {% endif %} +
 {% trans "Year - index" %}{% trans "Label/type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Organization/responsible" %}{% trans "Container" %}{% trans "Date start/end" %}
+ + + + {{ treatment.year|unlocalize }}-{{treatment.index|unlocalize}}{% if treatment.label %}{{ treatment.label}} ({{treatment.treatment_types_lbl}}){% else %}{{treatment.treatment_types_lbl}}{% endif %}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{it|link_to_window:request}}{% endfor %}{{ treatment.organization|default_if_none:"-" }}/{{ treatment.person|default_if_none:"-" }}{% for find_treatment in treatment.get_find_treatment_list %}{% if find_treatment.find.pk == item.pk %}{{ find_treatment.full_location|default_if_none:"-" }}{% if find_treatment.location_type_label %} {{find_treatment.location_type_label}}{% endif %}{% endif %}{% endfor %}{{ treatment.start_date|default_if_none:"-" }}{% if treatment.end_date %}/{{ treatment.end_date|default_if_none:"-" }}{% endif %}
{% trans "First packaging" %}{{ item.container_fisrt_full_location }} {% if item.container_fisrt_full_location == item.container_ref_fisrt_full_location %}{% trans "Reference/current" %}{% else %}{% trans "Current" %}{% endif %}
{% trans "First packaging" %}{{ item.container_ref_fisrt_full_location }} {% trans "Reference" %}
+ {% endif %} + + {% if item.associated_treatment_files_count %} +

{% trans "Treatment requests" %}

+ + + + + + + + + + + + + {% for treatment_file in item.associated_treatment_files %} + + + + + + + + + + + + {% endfor %} +
 {% trans "Year - index" %}{% trans "Type" %}{% trans "Name" %}{% trans "Person in charge" %}{% trans "Applicant" %}{% trans "Applicant organisation" %}{% trans "Reception date" %}{% trans "End date" %}
+ + + + {{ treatment_file.year }} - {{treatment_file.index}}{{ treatment_file.type }}{{ treatment_file.name|default_if_none:"-" }}{{ treatment_file.in_charge|default_if_none:"" }}{{ treatment_file.applicant|default_if_none:"" }}{{ treatment_file.applicant_organisation|default_if_none:"" }}{{ treatment_file.reception_date|default_if_none:"" }}{{ treatment_file.end_date|default_if_none:"" }}
+ {% endif %} +
diff --git a/archaeological_finds/templates/ishtar/sheet_museum_find.html b/archaeological_finds/templates/ishtar/sheet_museum_find.html index 3c00a5d38..2f313f0a1 100644 --- a/archaeological_finds/templates/ishtar/sheet_museum_find.html +++ b/archaeological_finds/templates/ishtar/sheet_museum_find.html @@ -299,263 +299,8 @@
-
- {% comment %} - {% if item.collection %} -
- {% field_flex_detail "Collection" item.collection "large" %} -
- {% endif %} - {% endcomment %} - {% if item.integrities_count or item.remarkabilities_count or item.conservatory_states_count or item.conservatory_comment or item.alterations.count or item.alteration_causes.count or item.preservation_to_considers.count or item.appraisal_date or item.treatment_emergency or item.insurance_value or item.estimated_value %} -

{% trans "Preservation" %}

-
- {% field_flex_multiple_obj "Integrity" item 'integrities' %} - {% field_flex_multiple_obj "Remarkability" item 'remarkabilities' %} - {% field_flex_multiple_obj _("Conservatory states") item 'conservatory_states' %} - {% field_flex_multiple_obj "Alteration" item 'alterations' %} - {% field_flex_multiple_obj "Alteration cause" item 'alteration_causes' %} - {% field_flex_multiple_obj "Recommended treatments" item 'preservation_to_considers' %} - {% field_flex "Treatment emergency" item.treatment_emergency %} - {% field_flex "Estimated value" item.estimated_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} - {% field_flex "Insurance value" item.insurance_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} - {% field_flex "Appraisal date" item.appraisal_date %} - {% field_flex_full "Conservatory comment" item.conservatory_comment "
" "
" %} -
- {% endif %} - {% if item.container or item.container_ref %} - {% if can_view_container %} -

{% trans "Warehouse - container" %}

-
- {% if item.container_ref != item.container and item.container_ref %} -
-
{% trans "Reference container" %}
-
- -
-
- {% endif %} - {% if item.container %} -
-
- {% if item.container_ref != item.container %} - {% trans "Current container" %}{% else %} - {% trans "Reference container / current container" %} - {% endif %} -
-
- -
-
- {% if item.container.index %} -
-
-
{% trans "Index" %}
-
- {{ item.container.location }} - {{ item.container.index }} -
-
-
- {% endif %} - {% endif %} -
- {% else %} - - {% endif %} - - {% endif %} - {% if item.upstream_treatment or item.downstream_treatment or non_modif_treatments_count %} - {% if non_modif_treatments_count %} -

{% trans "Simple treatments"%}

- - - - - - - - - - - - - - {# {% for treatment in item.treatments.all %} #} - {% for items, treatment in item.non_modif_treatments %} - - - - - - - - - - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
- - - - {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"-" }}{{ treatment.end_date|default_if_none:"-" }}
- {% endif %} - - {% if item.upstream_treatment %} -

{% trans "Upstream treatment" %}

- - - - - - - - - - - - - - {% for items, treatment in item.limited_upstream_treatments %} - - - - - - - - - - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
- - - - {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"-" }}{{ treatment.end_date|default_if_none:"-" }}
-

{% trans "CSV" %} ({{ENCODING}})

- {% endif %} - - {% if item.downstream_treatment %} -

{% trans "Downstream treatment" %}

- - - - - - - - - - - - - - {% for items, treatment in item.limited_downstream_treatments %} - - - - - - - - - - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
- - - - {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in items %}{{it}} {{ it|link_to_window:request}}{% endfor %}{{ treatment.person|default_if_none:"" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"" }}{{ treatment.end_date|default_if_none:"" }}
+ {% include "ishtar/sheet_find_treatments.html" %} -

{% trans "CSV" %} ({{ENCODING}})

- {% endif %} - {% endif %} - {% if item.associated_treatment_files_count %} -

{% trans "Treatment requests" %}

- - - - - - - - - - - - - {% for treatment_file in item.associated_treatment_files %} - - - - - - - - - - - - {% endfor %} -
 {% trans "Year - index" %}{% trans "Type" %}{% trans "Name" %}{% trans "Person in charge" %}{% trans "Applicant" %}{% trans "Applicant organisation" %}{% trans "Reception date" %}{% trans "End date" %}
- - - - {{ treatment_file.year }} - {{treatment_file.index}}{{ treatment_file.type }}{{ treatment_file.name|default_if_none:"-" }}{{ treatment_file.in_charge|default_if_none:"" }}{{ treatment_file.applicant|default_if_none:"" }}{{ treatment_file.applicant_organisation|default_if_none:"" }}{{ treatment_file.reception_date|default_if_none:"" }}{{ treatment_file.end_date|default_if_none:"" }}
- {% endif %} -
{% if display_documents %}
-- cgit v1.2.3