diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-12-05 15:42:57 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-12-08 15:48:15 +0100 |
| commit | 4214cac32be4062fc930694dfe8e31f89e315ba6 (patch) | |
| tree | af1df471d53b11e074d4bdd52fea2cd646f6f07c | |
| parent | 781314f108737a16689801a3aa4672df9be450fd (diff) | |
| download | Ishtar-4214cac32be4062fc930694dfe8e31f89e315ba6.tar.bz2 Ishtar-4214cac32be4062fc930694dfe8e31f89e315ba6.zip | |
✨ sheet find: put archaeological context on second tab
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 352 | ||||
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_museum_find.html | 6 |
2 files changed, 194 insertions, 164 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 6b557bc55..7d30460a8 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -37,17 +37,17 @@ {% if output != "ODT" and output != "PDF"%} <ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist"> <li class="nav-item"> - <a class="nav-link active" id="{{window_id}}-basefind-tab" - data-toggle="tab" href="#{{window_id}}-basefind" role="tab" - aria-controls="{{window_id}}-basefind" aria-selected="true"> - {% trans "Image / Base find" %} + <a class="nav-link active" id="{{window_id}}-identification-tab" + data-toggle="tab" href="#{{window_id}}-identification" role="tab" + aria-controls="{{window_id}}-identification" aria-selected="true"> + {% trans "Identification / Description" %} </a> </li> <li class="nav-item"> - <a class="nav-link" id="{{window_id}}-identification-tab" - data-toggle="tab" href="#{{window_id}}-identification" role="tab" - aria-controls="{{window_id}}-identification" aria-selected="false"> - {% trans "Identification / Description" %} + <a class="nav-link" id="{{window_id}}-basefind-tab" + data-toggle="tab" href="#{{window_id}}-basefind" role="tab" + aria-controls="{{window_id}}-basefind" aria-selected="false"> + {% trans "Archaeological context" %} </a> </li> <li class="nav-item"> @@ -89,15 +89,185 @@ <div class="tab-content" id="{{window_id}}-tab-content"> - <div class="tab-pane fade show active" id="{{window_id}}-basefind" - role="tabpanel" aria-labelledby="{{window_id}}-basefind-tab"> + <div class="tab-pane fade show active" id="{{window_id}}-identification" + role="tabpanel" aria-labelledby="{{window_id}}-identification-tab"> {% if has_image %} <div class="clearfix"> <div class="card float-left col-12 col-md-6 col-lg-4"> {% include "ishtar/blocks/window_image.html" %} </div> - {% endif %} + {% endif %} + <h3>{% trans "Identification" %}</h3> + + <div class='text-center'> + {% include "ishtar/blocks/sheet_external_id.html" %} + {# no complete identifier #} + </div> + + <div class='row'> + {% field_flex "Denomination" item.denomination %} + {% field_flex "Complete museum ID" item.cache_complete_museum_id %} + {% field_flex "Free ID" item.label %} + {% field_flex "Previous ID" item.previous_id %} + {% field_flex "Excavation ID" item.excavation_ids %} + {% field_flex "Laboratory ID" item.laboratory_id %} + {% field_flex "Seal number" item.seal_number %} + {# no index admin #} + </div> + + <h3>{% trans "Description" %}</h3> + <div class='row'> + {% field_flex_full "Description" item.description "<pre>" "</pre>" %} + {% field_flex_full "Public description" item.public_description "<pre>" "</pre>" %} + {% field_flex "Is complete?" item.is_complete %} + {% with material=item.get_hierarchical_material_types %}{% if material %} + {% field_flex "Material types" material %}{% else %} + {% field_flex_multiple_obj "Material types" item 'material_types' %} + {% endif %}{% endwith %} + {% field_flex "Material type quality" item.material_type_quality %} + {% field_flex_multiple_obj "Technical processes" item 'technical_processes' %} + {% field_flex_full "Comment on the material" item.material_comment "<pre>" "</pre>" %} + {% field_flex_multiple_obj "Object types" item 'object_types' %} + {% field_flex "Object type quality" item.object_type_quality %} + {% field_flex_multiple_obj "Functional areas" item 'functional_areas' %} + {% field_flex_multiple_obj "Technical areas" item 'technical_areas' %} + {% field_flex "Number of remains" item.find_number %} + {% field_flex "Minimum number of individuals (MNI)" item.min_number_of_individuals %} + {% field_flex "Inventory quantity" item.museum_inventory_quantity %} + {% field_flex "Observed quantity" item.museum_observed_quantity %} + {% field_flex_full "Comment on quantity" item.quantity_comment "<pre>" "</pre>" %} + {% field_flex_full "Decoration" item.decoration "<pre>" "</pre>" %} + {% field_flex_full "Inscription" item.inscription "<pre>" "</pre>" %} + {% field_flex "Manufacturing place" item.manufacturing_place %} + {% field_flex_multiple_obj "Communicability" item 'communicabilities' %} + {% field_flex_full _("General comment") item.comment "<pre>" "</pre>" %} + </div> + + {% if item.has_ownership_section %} + <h3>{% trans "Ownership" %}</h3> + <div class='row'> + {% field_flex _("Ownership status") item.ownership_status %} + {% field_flex _("Owner") item.owner %} + </div> + {% endif %} + + {% if item.has_museum_section %} + <h3>{% trans "Museum / legal status" %}</h3> + <div class='row'> + {% field_flex "Complete museum ID" item.cache_complete_museum_id %} + {% field_flex "Comment on museum ID" item.museum_id_comment %} + {% field_flex_multiple_obj _("Collections") item "museum_collections" %} + {% field_flex_detail_multiple _("Former collection") item.museum_former_collections %} + {% field_flex_detail "Owner institution" item.museum_owner_institution %} + {% field_flex_detail "Assigned institution" item.museum_assigned_institution %} + {% field_flex_detail "Custodian institution" item.museum_custodian_institution %} + {% field_flex "Depositor inventory number" item.museum_depositor_inventory_number %} + {% field_flex "Collections entry mode" item.museum_collection_entry_mode %} + {% field_flex "Comment on museum entry mode" item.museum_entry_mode_comment %} + {% trans "Museum entry date" as museum_entry_date_label %} + {% field_flex museum_entry_date_label item.museum_entry_date_label %} + {% field_flex "Comment on museum entry date" item.museum_entry_date_comment %} + {% field_flex_detail_multiple _("Donors, testators or vendors") item.museum_donors %} + {% field_flex_multiple_obj "Presence of inventory marking" item "museum_inventory_marking_presence" %} + {% field_flex_multiple_obj "Type of marking" item "museum_marking_type" %} + {% field_flex "Marking details" item.mark "<pre>" "</pre>" %} + {% field_flex "Conformity with inventory" item.museum_inventory_conformity %} + {% field_flex "Comment on conformity" item.museum_conformity_comment %} + {% field_flex "Inventory entry year" item.museum_inventory_entry_year %} + {% field_flex_full "Inventory transcript" item.museum_inventory_transcript %} + {% field_flex "Original/reproduction" item.museum_original_repro %} + {% field_flex "Date of museum allocation" item.museum_allocation_date|date:"SHORT_DATE_FORMAT" %} + {% field_flex "Purchase price" item.museum_purchase_price %} + </div> + {% endif %} + + {% if item.length or item.width or item.height or item.diameter or item.thickness or item.volume or item.weight_string or item.dimensions_comment or item.clutter_long_side or item.clutter_short_side or item.clutter_height %} + <h3>{% trans "Dimensions" %}</h3> + <div class='row'> + {% field_flex "Length (cm)" item.length %} + {% field_flex "Width (cm)" item.width %} + {% field_flex "Height (cm)" item.height %} + {% field_flex "Thickness (cm)" item.thickness %} + {% field_flex "Diameter (cm)" item.diameter %} + {% field_flex "Circumference (cm)" item.circumference %} + {% field_flex "Volume (l)" item.volume %} + {% trans "Weight (g)" as weight_label %} + {% field_flex weight_label item.weight_string %} + {% field_flex "Clutter long side (cm)" item.clutter_long_side %} + {% field_flex "Clutter short side (cm)" item.clutter_short_side %} + {% field_flex "Clutter height (cm)" item.clutter_height %} + {% field_flex_full "Dimensions comment" item.dimensions_comment "<pre>" "</pre>" %} + </div> + {% endif %} + {% with dating_list=item|m2m_listing:"datings" %} + {% if dating_list or item.dating_comment or item.cultural_attributions_count %} + <h3>{% trans "Dating" %}</h3> + {% if item.cultural_attributions_count %} + <div class='row'> + {% field_flex_multiple_obj "Cultural attributions" item 'cultural_attributions' %} + </div> + {% endif %} + {% if dating_list %} + <table id='{{window_id}}-datings' class="table table-striped"> + <tr> + <th>{% trans "Chronological period" %}</th> + <th>{% trans "Start date" %}</th> + <th>{% trans "End date" %}</th> + <th>{% trans "Dating type" %}</th> + <th>{% trans "Quality" %}</th> + <th>{% trans "Precise on this dating" %}</th> + </tr> + {% for dating in dating_list %} + <tr> + <td> + {{dating.period}} + </td> + <td> + {{dating.start_date|default_if_none:"-"}} + </td> + <td> + {{dating.end_date|default_if_none:"-"}} + </td> + <td> + {{dating.dating_type|default_if_none:"-"}} + </td> + <td> + {{dating.quality|default_if_none:"-"}} + </td> + <td> + {{dating.precise_dating|default_if_none:"-"}} + </td> + </tr> + {% endfor %} + </table> + {% endif %} + <div class='row'> + {% field_flex_full "Comment on dating" item.dating_comment "<pre>" "</pre>" %} + </div> + {% endif %} + {% endwith %} + + {% if not is_external %} + {% if item.history_creator or item.last_edition_date or item.created %} + <h3>{% trans "Sheet" %}</h3> + <div class='row'> + {% trans "Checked" as checked_label %} + {% field_flex checked_label item.checked_type %} + {% with item.check_date|date:"SHORT_DATE_FORMAT" as check_date %} + {% if check_date %}{% field_flex "Check date" check_date %}{% endif %} + {% endwith %} + {% include "ishtar/blocks/sheet_creation_section.html" %} + </div> + {% endif %} + {% endif %} + {% if has_image %} + </div> + {% endif %} + </div> + + <div class="tab-pane fade" id="{{window_id}}-basefind" + role="tabpanel" aria-labelledby="{{window_id}}-basefind-tab"> <ul class="nav nav-pills" role="tablist"> {% if is_external %} {% for base_find in item.base_finds_list %} @@ -125,166 +295,18 @@ <div class="tab-content"> {% if is_external %} {% for base_find in item.base_finds_list %} - {% with first=forloop.first|add:has_image %} + {% with first=forloop.first %} {% include "ishtar/sheet_basefind.html" %} {% endwith %} {% endfor %} {% else %} {% for base_find in item.base_finds.all %} - {% with first=forloop.first|add:has_image %} + {% with first=forloop.first %} {% include "ishtar/sheet_basefind.html" %} {% endwith %} {% endfor %} {% endif %} </div> - {% if has_image %} - </div> - {% endif %} - </div> - - <div class="tab-pane fade" id="{{window_id}}-identification" - role="tabpanel" aria-labelledby="{{window_id}}-identification-tab"> - <h3>{% trans "Identification" %}</h3> - - <div class='text-center'> - {% include "ishtar/blocks/sheet_external_id.html" %} - {% if item.complete_identifier %}<p class="window-refs" - title="{% trans 'Complete identifier' %}"> - <strong>{{ item.complete_identifier }}</strong></p>{% endif %} - </div> - - <div class='row'> - {% field_flex "Denomination" item.denomination %} - {% field_flex "Free ID" item.label %} - {% field_flex "Previous ID" item.previous_id %} - {% field_flex "Excavation ID" item.excavation_ids %} - {% field_flex "Museum ID" item.museum_id %} - {% field_flex "Laboratory ID" item.laboratory_id %} - {% field_flex "Seal number" item.seal_number %} - {% trans "Administrative index" as admin_index_label %} - {% field_flex admin_index_label item.administrative_index %} - {% field_flex_full _("Marking details") item.mark "<pre>" "</pre>" %} - </div> - - <h3>{% trans "Description" %}</h3> - <div class='row'> - {% field_flex_full "Description" item.description "<pre>" "</pre>" %} - {% field_flex_full "Public description" item.public_description "<pre>" "</pre>" %} - {% field_flex "Is complete?" item.is_complete %} - {% with material=item.get_hierarchical_material_types %}{% if material %} - {% field_flex "Material types" material %}{% else %} - {% field_flex_multiple_obj "Material types" item 'material_types' %} - {% endif %}{% endwith %} - {% field_flex "Material type quality" item.material_type_quality %} - {% field_flex_multiple_obj "Technical processes" item 'technical_processes' %} - {% field_flex_full "Comment on the material" item.material_comment "<pre>" "</pre>" %} - {% field_flex_multiple_obj "Object types" item 'object_types' %} - {% field_flex "Object type quality" item.object_type_quality %} - {% field_flex_multiple_obj "Functional areas" item 'functional_areas' %} - {% field_flex_multiple_obj "Technical areas" item 'technical_areas' %} - {% field_flex "Number of remains" item.find_number %} - {% field_flex "Minimum number of individuals (MNI)" item.min_number_of_individuals %} - {% field_flex "Inventory quantity" item.museum_inventory_quantity %} - {% field_flex "Observed quantity" item.museum_observed_quantity %} - {% field_flex_full "Comment on quantity" item.quantity_comment "<pre>" "</pre>" %} - {% field_flex_full "Decoration" item.decoration "<pre>" "</pre>" %} - {% field_flex_full "Inscription" item.inscription "<pre>" "</pre>" %} - {% field_flex "Manufacturing place" item.manufacturing_place %} - {% field_flex_multiple_obj "Communicability" item 'communicabilities' %} - {% field_flex_full _("General comment") item.comment "<pre>" "</pre>" %} - </div> - - {% if item.length or item.width or item.height or item.diameter or item.thickness or item.volume or item.weight_string or item.dimensions_comment or item.clutter_long_side or item.clutter_short_side or item.clutter_height %} - <h3>{% trans "Dimensions" %}</h3> - <div class='row'> - {% field_flex "Length (cm)" item.length %} - {% field_flex "Width (cm)" item.width %} - {% field_flex "Height (cm)" item.height %} - {% field_flex "Thickness (cm)" item.thickness %} - {% field_flex "Diameter (cm)" item.diameter %} - {% field_flex "Circumference (cm)" item.circumference %} - {% field_flex "Volume (l)" item.volume %} - {% trans "Weight (g)" as weight_label %} - {% field_flex weight_label item.weight_string %} - {% field_flex "Clutter long side (cm)" item.clutter_long_side %} - {% field_flex "Clutter short side (cm)" item.clutter_short_side %} - {% field_flex "Clutter height (cm)" item.clutter_height %} - {% field_flex_full "Dimensions comment" item.dimensions_comment "<pre>" "</pre>" %} - </div> - {% endif %} - - {% if item.has_ownership_section %} - <h3>{% trans "Ownership" %}</h3> - <div class='row'> - {% field_flex _("Ownership status") item.ownership_status %} - {% field_flex _("Owner") item.owner %} - </div> - {% endif %} - - {% if item.has_museum_section %} - <h3>{% trans "Museum / legal status" %}</h3> - <div class='row'> - {% field_flex "Museum ID prefix" item.museum_id_prefix %} - {% field_flex "Museum inventory number" item.museum_id %} - {% field_flex "Museum ID suffix" item.museum_id_suffix %} - {% field_flex "Comment on museum ID" item.museum_id_comment %} - {% field_flex_detail "Owner institution" item.museum_owner_institution %} - {% field_flex_detail "Assigned institution" item.museum_assigned_institution %} - {% field_flex_detail "Custodian institution" item.museum_custodian_institution %} - {% field_flex "Depositor inventory number" item.museum_depositor_inventory_number %} - {% field_flex "Collections entry mode" item.museum_collection_entry_mode %} - {% field_flex "Comment on museum entry mode" item.museum_entry_mode_comment %} - {% trans "Museum entry date" as museum_entry_date_label %} - {% field_flex museum_entry_date_label item.museum_entry_date_label %} - {% field_flex "Comment on museum entry date" item.museum_entry_date_comment %} - {% field_flex_detail_multiple _("Donors, testators or vendors") item.museum_donors %} - {% field_flex_multiple_obj "Presence of inventory marking" item "museum_inventory_marking_presence" %} - {% field_flex_multiple_obj "Type of marking" item "museum_marking_type" %} - {% field_flex_multiple_obj _("Collections") item "museum_collections" %} - {% field_flex_detail_multiple _("Former collection") item.museum_former_collections %} - {% field_flex "Inventory entry year" item.museum_inventory_entry_year %} - {% field_flex "Conformity with inventory" item.museum_inventory_conformity %} - {% field_flex "Comment on conformity" item.museum_conformity_comment %} - {% field_flex "Inventory transcript" item.museum_inventory_transcript %} - {% field_flex "Original/reproduction" item.museum_original_repro %} - {% field_flex "Date of museum allocation" item.museum_allocation_date|date:"SHORT_DATE_FORMAT" %} - {% field_flex "Purchase price" item.museum_purchase_price %} - </div> - {% endif %} - - {% with dating_list=item|m2m_listing:"datings" %} - {% if can_change or dating_list or item.dating_comment or item.cultural_attributions_count or item.periods_count %} - <h3>{% trans "Periods / Datings" %}</h3> - {% if item.cultural_attributions_count or item.periods_count %} - <div class='row'> - {% field_flex_multiple_obj _("Periods") item 'periods' %} - {% field_flex_multiple_obj "Cultural attributions" item 'cultural_attributions' %} - </div> - {% endif %} - {% if can_change or dating_list %} - {% with url_dating="find-dating" %} - {% include "ishtar/blocks/sheet_dating_list.html" %} - {% endwith %} - {% endif %} - <div class='row'> - {% field_flex_full "Comment on dating" item.dating_comment "<pre>" "</pre>" %} - </div> - {% endif %} - {% endwith %} - - {% if not is_external %} - {% if item.history_creator or item.last_edition_date or item.created %} - <h3>{% trans "Sheet" %}</h3> - <div class='row'> - {% trans "Checked" as checked_label %} - {% field_flex checked_label item.checked_type %} - {% with item.check_date|date:"SHORT_DATE_FORMAT" as check_date %} - {% if check_date %}{% field_flex "Check date" check_date %}{% endif %} - {% endwith %} - {% include "ishtar/blocks/sheet_creation_section.html" %} - </div> - {% endif %} - {% endif %} </div> {% include "ishtar/sheet_find_treatments.html" %} @@ -324,7 +346,13 @@ {% endif %} </div> -{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} {% endwith %} +{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} + +<script type='text/javascript'> + $( "#{{window_id}}-tabs" ).on( "tabsactivate", function( event, ui ) { + update_all_map_display(); + } ); +</script> {% endblock %} diff --git a/archaeological_finds/templates/ishtar/sheet_museum_find.html b/archaeological_finds/templates/ishtar/sheet_museum_find.html index 291156e7c..887272e34 100644 --- a/archaeological_finds/templates/ishtar/sheet_museum_find.html +++ b/archaeological_finds/templates/ishtar/sheet_museum_find.html @@ -29,7 +29,9 @@ {% with can_view_container=permission_view_own_container|or_:permission_view_container %} {% with display_warehouse_treatments=item.container|or_:item.container_ref|or_:item.upstream_treatment|or_:item.downstream_treatment|or_:non_modif_treatments_count|or_:associated_treatment_files_count %} {% with can_view_documents=permission_view_own_document|or_:permission_view_document %} -{% with display_documents=can_view_documents|and_:item.documents_count %} +{% with can_change=permission_change_own_find|or_:permission_change_find %} +{% with has_documents=item|safe_or:"documents.count|documents_list"|safe_and_not:"documents_not_available" %} +{% with display_documents=can_view_documents|and_:has_documents %} {% with has_image=item.images_number %} {% if output != "ODT" and output != "PDF"%} @@ -344,7 +346,7 @@ {% endif %} </div> -{% endwith %} {% endwith %} {% endwith %} {% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} +{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} <script type='text/javascript'> $( "#{{window_id}}-tabs" ).on( "tabsactivate", function( event, ui ) { |
