From dba959d5d244f2e02c8ff22f4a8789c7d3ad3cfa Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 19 Jan 2018 19:47:04 +0100 Subject: Improve find sheet --- .../ishtar/sheet_contextrecordsource.html | 4 +- archaeological_finds/forms.py | 1 + .../templates/ishtar/sheet_find.html | 241 ++++++++++----------- .../templates/ishtar/sheet_operation.html | 12 +- .../templates/ishtar/wizard/confirm_wizard.html | 3 +- 5 files changed, 130 insertions(+), 131 deletions(-) diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html index bd6cdcdba..725c89530 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource.html @@ -1,7 +1,7 @@ {% extends "ishtar/sheet_source.html" %} {% load i18n window_field window_header link_to_window %} -{% block head_title %}{% trans "Context record source" %}{% endblock %} +{% block head_title %}{% trans "Context record source" %} - {{item.title}} - {{item.owner}}{% endblock %} {% block window_nav %} {% window_nav item window_id 'show-contextrecordsource' 'record_source_modify' %} @@ -9,5 +9,5 @@ {% block related %} {% trans "Related context record" as related_item_label %} -{% field related_item_label item.owner '' item.owner|link_to_window %} +{% field_flex related_item_label item.owner '' item.owner|link_to_window %} {% endblock %} diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 458a3baa8..26ba8350f 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -464,6 +464,7 @@ class FindSelectWarehouseModule(FindSelect): class FindFormSelection(forms.Form): + SEARCH_AND_SELECT = True form_label = _("Find search") associated_models = {'pk': models.Find} currents = {'pk': models.Find} diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 68304740d..237a4d748 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -1,86 +1,96 @@ {% extends "ishtar/sheet.html" %} {% load i18n window_field from_dict link_to_window window_tables window_header humanize %} -{% block head_title %}{% trans "Find" %}{% endblock %} -{% block content %} -{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next 1 %} - -{% if item.image %} - -{% endif%} -{% if item.downstream_treatment %} -

- {% trans "This sheet has a downstream treatment: it is related to an old version of the find." %}

-{% endif %} +{% block head_title %}{% trans "Find" %} - {{item.label|default:""}}{% endblock %} -

{{ item.label|default:"" }}

-

{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.complete_id}}{% endfor %}

-

{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.short_id}}{% endfor %}

-

{{ item.administrative_index|default:"" }}

-{% include "ishtar/blocks/sheet_external_id.html" %} +{% block toolbar %} +{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next 1 %} +{% endblock %} +{% block content %} - -{% field "Dimensions comment" item.dimensions_comment "
" "
" %} - +
+ {% field_flex "Previous ID" item.previous_id %} + {% include "ishtar/blocks/sheet_creation_section.html" %} + {% trans "Administrative index" as admin_index_label %} + {% field_flex admin_index_label item.administrative_index %} + {% field_flex_multiple "Material types" item.material_types %} + {% field_flex "Dating" item.dating %} + {% field_flex "Length (cm)" item.length %} + {% field_flex "Width (cm)" item.width %} + {% field_flex "Height (cm)" item.height %} + {% field_flex "Diameter (cm)" item.diameter %} + {% field_flex "Thickness (cm)" item.thickness %} + {% field_flex "Volume (l)" item.volume %} + {% field_flex "Weight" item.weight_string %} + {% field_flex_full "Dimensions comment" item.dimensions_comment "
" "
" %} -{% field "Description" item.description "
" "
" %} -{% field "Comment" item.comment "
" "
" %} + {% field_flex "Find number" item.find_number %} + {% field_flex "Minimum number of individuals (MNI)" item.min_number_of_individuals %} + {% field_flex_multiple "Object types" item.object_types %} + {% field_flex_multiple "Integrity / interest" item.integrities %} + {% field_flex_multiple "Remarkability" item.remarkabilities %} + {% field_flex "Estimated value" item.estimated_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} + {% if item.CHECK_DICT %} + {% field_flex "Checked" item.checked|from_dict:item.CHECK_DICT %} + {% endif%} + {% if item.history_object and item.history_object.CHECK_DICT %} + {% field_flex "Checked" item.checked|from_dict:item.history_object.CHECK_DICT %} + {% endif%} + {% field_flex_full "Description" item.description "
" "
" %} + {% field_flex_full "Comment" item.comment "
" "
" %} +
{% include "ishtar/blocks/sheet_json.html" %} {% if item.conservatory_state or item.conservatory_comment or item.alterations.count or item.alteration_causes.count or item.preservation_to_considers.count or item.treatment_emergency or item.insurance_value %}

{% trans "Preservation" %}

- - {% field "Conservatory comment" item.conservatory_comment "
" "
" %} +
+ {% field_flex "Conservatory state" item.conservatory_state %} + {% field_flex_multiple "Alteration" item.alterations %} + {% field_flex_multiple "Alteration cause" item.alteration_causes %} + {% field_flex_multiple "Recommended treatments" item.preservation_to_considers %} + {% field_flex "Treatment emergency" item.treatment_emergency %} + {% 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 %}

{% trans "Warehouse"%}

-{% field_detail "Container" item.container %} -{% field "Container ID" item.container.cached_location %} -{% field_detail "Responsible warehouse" item.container.responsible %} -{% field_detail "Location (warehouse)" item.container.location %} -{% field "Precise localisation" item.container.divisions_lbl %} +
+ {% field_flex_detail "Container" item.container %} + {% field_flex "Container ID" item.container.cached_location %} + {% field_flex_detail "Responsible warehouse" item.container.responsible %} + {% field_flex_detail "Location (warehouse)" item.container.location %} + {% field_flex "Precise localisation" item.container.divisions_lbl %} +
{% endif %} {% if item.upstream_treatment or item.downstream_treatment %} @@ -88,9 +98,7 @@ {% if item.upstream_treatment %}

{% trans "Upstream treatment" %}

-
-
- +
@@ -123,16 +131,12 @@ {% endfor %}
  {% trans "Year - index" %}
-
-

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

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

{% trans "Downstream treatment" %}

-
-
- +
@@ -165,8 +169,6 @@ {% endfor %}
  {% trans "Year - index" %}
-
-

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

{% endif %} @@ -176,63 +178,63 @@

{% trans "Associated base finds"%}

{% for base_find in item.base_finds.all %} -

{{base_find.complete_id }}

-

{{base_find.short_id }}

+

{{base_find.complete_id }}

+

{{base_find.short_id }}

{% if base_find.external_id %} -

+

{{base_find.external_id|default:''}}

{% endif %} - + {% field_flex "Batch/object" base_find.batch %} + {% if base_find.history_object and base_find.history_object.IS_ISOLATED_DICT %} + {% field_flex "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %} + {% endif %} + + {% field_flex "Discovery date" base_find.discovery_date %} + {% field_flex "Special interest" base_find.special_interest %} + {% field_flex_detail "Context record" base_find.context_record %} + {% field_flex "Town" base_find.context_record.parcel.town %} + {% field_flex "Parcel" base_find.context_record.parcel %} + {% field_flex_detail "Operation" base_find.context_record.operation %} + {% field_flex "Point of topographic reference" base_find.topographic_localisation %} -{% field "Description" base_find.description "
" "
" %} -{% field "Comment" base_find.comment "
" "
" %} + {% if base_find.x or base_find.y %} +
+
{% trans "Coordinates" %}
+
+ {% trans "X"%} {{base_find.x|default_if_none:"-"}}, + {% trans "Y"%} {{base_find.y|default_if_none:"-"}}, + {% trans "Z"%} {{base_find.z|default_if_none:"-"}} + {% if base_find.spatial_reference_system %} + ({{base_find.spatial_reference_system.label}}{% if base_find.spatial_reference_system.srid %} - + {% trans "SRID"%} {{base_find.spatial_reference_system.srid}}{% endif %}) + {% endif %} +
+
+ {% endif %} + {% field_flex_full "Description" base_find.description "
" "
" %} + {% field_flex_full "Comment" base_find.comment "
" "
" %} + {% if forloop.counter0 %}
{% endif %} {% endfor %} {% if item.source.count %}

{% trans "Documents"%}

- +
@@ -254,11 +256,6 @@ {% empty %} {% endfor %}
{%trans "Documents"%}
 
- - {% endif %} {% endblock %} diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 565bccbb2..8166d9d68 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -229,7 +229,7 @@
{% if item.nb_context_records_by_type %}
- +
{% for label, nb in item.nb_context_records_by_type %} @@ -239,7 +239,7 @@ {% endif %} {% if item.nb_context_records_by_periods %}
-
{% trans "Type" %}{% trans "Number" %}
{{label|default:"-"}}{{nb}}
+
{% for label, nb in item.nb_context_records_by_periods %} @@ -256,7 +256,7 @@
{% if item.nb_finds_by_material_type %}
-
{% trans "Period" %}{% trans "Number" %}
{{label|default:"-"}}{{nb}}
+
{% for label, nb in item.nb_finds_by_material_type %} @@ -266,7 +266,7 @@ {% endif %} {% if item.nb_finds_by_types %}
-
{% trans "Material type" %}{% trans "Number" %}
{{label|default:"-"}}{{nb}}
+
{% for label, nb in item.nb_finds_by_types %} @@ -276,7 +276,7 @@ {% endif %} {% if item.nb_finds_by_periods %}
-
{% trans "Object type" %}{% trans "Number" %}
{{label}}{{nb}}
+
{% for label, nb in item.nb_finds_by_periods %} @@ -293,7 +293,7 @@
{% if item.nb_documents_by_types %}
-
{% trans "Period" %}{% trans "Number" %}
{{label|default:"-"}}{{nb}}
+
{% for label, nb in item.nb_documents_by_types %} diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index 5edc9f9bf..1128e9561 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -13,9 +13,10 @@ {% for form_label, form_data in datas %}
+ {% if form_label %}
{{form_label}} -
+
{% endif %}
{% trans "Type" %}{% trans "Number" %}
{{label}}{{nb}}
{% for data in form_data %} -- cgit v1.2.3