diff options
Diffstat (limited to 'archaeological_finds/templates')
11 files changed, 611 insertions, 296 deletions
diff --git a/archaeological_finds/templates/ishtar/blocks/window_find_nav.html b/archaeological_finds/templates/ishtar/blocks/window_find_nav.html new file mode 100644 index 000000000..74c6858a1 --- /dev/null +++ b/archaeological_finds/templates/ishtar/blocks/window_find_nav.html @@ -0,0 +1,21 @@ +{% extends "ishtar/blocks/window_nav.html" %} +{% load i18n link_to_window %} +{% block post_pin %}{% if baskets %} +<div class="dropdown btn-secondary"> + <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" + id="dropdown-post-pin-{{window_id}}" + data-toggle="dropdown"aria-haspopup="true" + aria-expanded="false"> + <i class="fa fa-shopping-basket"></i> {% trans "Baskets" %} + </button> + <div class="dropdown-menu" aria-labelledby="dropdown-post-pin-{{window_id}}"> + {% for basket_id, lbl in baskets %} + <a class="dropdown-item" href="#" + onclick="load_window('{% url 'show-findbasket' basket_id %}')"> + <i class="fa fa-info-circle display_details" aria-hidden="true"></i> + {{lbl}} + </a> + {% endfor %} + </div> +</div> +{% endif %}{% endblock %} diff --git a/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html index ef3906735..f20f0cb65 100644 --- a/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html +++ b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html @@ -27,20 +27,26 @@ </div> <div class="form-row"> + {{ form.reference_container }} <label for="{{form.reference_container.auto_id}}"> + {% trans "Change the reference container" %} + </label> + </div> + + <div class="form-row"> {{ form.create_treatment }} <label for="{{form.create_treatment.auto_id}}"> {% trans "Associate a treatment" %} </label> </div> <div id="new-treatment"> - {% for field in form %} - {% if field.name != 'container' and field.name != 'create_treatment' %} - {% if forloop.counter0|divisibleby:2 %} + {% with force_large_col=True %}{% for field in form %} + {% if field.name != 'reference_container' and field.name != 'container' and field.name != 'create_treatment' %} + {% if forloop.counter|divisibleby:2 %} <div class="form-row">{% endif %} {% include "blocks/bs_field_snippet.html" %} {% if not forloop.counter0|divisibleby:2 %} </div>{% endif %} {% endif %} - {% endfor %} + {% endfor %}{% endwith %} </div> {% endblock %} diff --git a/archaeological_finds/templates/ishtar/forms/qa_findbasket_duplicate.html b/archaeological_finds/templates/ishtar/forms/qa_findbasket_duplicate.html new file mode 100644 index 000000000..b9ec50f22 --- /dev/null +++ b/archaeological_finds/templates/ishtar/forms/qa_findbasket_duplicate.html @@ -0,0 +1,22 @@ +{% extends "ishtar/forms/qa_base.html" %} +{% load i18n inline_formset table_form %} + +{% block main_form %} +<div class="alert alert-info"> + {% trans "Items of the basket will be attached to the new basket but not the shares." %} +</div> +{% if form.non_field_errors %} +<div class="alert alert-danger" role="alert"> + {{form.non_field_errors}} +</div> +{% endif %} +<div class="form-row"> + <div class="form-group col-lg-6 required"> + <label>{% trans "Label" %}</label> + </div> + {% with form.label as field %} + {% include "blocks/bs_field_snippet.html" %} + {% endwith %} +</div> +{% endblock %} + diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html index c20ca66ee..7ea16fecb 100644 --- a/archaeological_finds/templates/ishtar/sheet_basefind.html +++ b/archaeological_finds/templates/ishtar/sheet_basefind.html @@ -1,6 +1,10 @@ {% load i18n window_field from_dict link_to_window window_tables window_header humanize %} - <p class='window-refs text-center'>{{base_find.complete_id }}</p> - <p class='window-refs text-center'>{{base_find.short_id }}</p> +<div id="{{window_id}}-base-find-{{forloop.counter}}" role="tabpanel" + class="tab-pane fade{% if forloop.first %} show active{% endif %}"> + <p class='window-refs text-center'>{{ base_find.complete_id }}</p> + {% if base_find.complete_id != base_find.short_id %} + <p class='window-refs text-center'>{{ base_find.short_id }}</p> + {% endif %} {% if base_find.external_id %} <p class='window-refs text-center external-id'> <small title="{% trans 'Internal ID' %}"> @@ -77,11 +81,5 @@ {% endwith %}{% endwith %} {% endif %} </div> - -{% if first %} - </div> </div> -<div class="subsection"> -{% endif %} -{% if forloop.counter0 %}<hr/>{% endif %} diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 021ea5652..7171c3deb 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -1,10 +1,10 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_field from_dict link_to_window window_tables window_header humanize %} +{% load i18n ishtar_helpers window_field from_dict link_to_window window_tables window_header humanize %} {% block head_title %}<strong>{% trans "Find" %}</strong>{% if item.denomination %} - {{item.denomination|default:""}}{% endif %} - {{item.label|default:""}}{% endblock %} {% block toolbar %} -{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next 1 %} +{% window_find_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next 1 baskets %} {% endblock %} {% block content %} @@ -15,243 +15,387 @@ </div> {% endif %} +{# trick to set to null non existing variable #} +{% with permission_view_document=permission_view_document %} +{% with permission_view_own_document=permission_view_own_document %} -{% with nb_image=item.images.count %} -{% if nb_image %} -<div class="clearfix"> - <div class="card float-left col-12 col-md-6 col-lg-4"> - {% include "ishtar/blocks/window_image.html" %} - <div class="card-body"> - </div> - </div> -{% endif %} +{% with display_identification=item.integrities.count|or_:item.remarkabilities.count|or_:item.conservatory_state|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|or_:item.datings.count|or_:item.dating_comment %} +{% with display_warehouse_treatments=item.container|or_:item.container_ref|or_:item.upstream_treatment|or_:item.downstream_treatment|or_:item.treatments.count %} +{% with can_view_documents=permission_view_own_document|or_:permission_view_document %} +{% with display_documents=can_view_documents|and_:item.documents.count %} - <h2>{% trans "Associated base finds"%}</h2> +<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> + </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 / Dimensions" %} + </a> + </li> + {% if display_identification %} + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-preservation-tab" + data-toggle="tab" href="#{{window_id}}-preservation" role="tab" + aria-controls="{{window_id}}-preservation" aria-selected="false"> + {% trans "Datings / Preservation" %} + </a> + </li> + {% endif %} + {% if display_warehouse_treatments %} + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-warehouse-tab" + data-toggle="tab" href="#{{window_id}}-warehouse" role="tab" + aria-controls="{{window_id}}-warehouse" aria-selected="false"> + {% trans "Warehouse / Treatments" %} + </a> + </li> + {% endif %} + {% if display_documents %} + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-documents-tab" + data-toggle="tab" href="#{{window_id}}-documents" role="tab" + aria-controls="{{window_id}}-treatments" aria-selected="false"> + {% trans "Documents" %} + </a> + </li> + {% endif %} + {% if item.data %} + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-json-tab" + data-toggle="tab" href="#{{window_id}}-json" role="tab" + aria-controls="{{window_id}}-json" aria-selected="false"> + {% trans "Custom fields" %} + </a> + </li> + {% endif %} +</ul> - <div class="subsection"> - {% for base_find in item.base_finds.all %} - {% with first=forloop.first|add:nb_image %} - {% include "ishtar/sheet_basefind.html" %} - {% endwith %} - {% endfor %} - </div> -{% endwith %} +<div class="tab-content" id="{{window_id}}-tab-content"> -<h3>{% trans "Identification" %}</h3> + <div class="tab-pane fade show active" id="{{window_id}}-basefind" + role="tabpanel" aria-labelledby="{{window_id}}-basefind-tab"> + {% with nb_image=item.images.count %} + {% if nb_image %} + <div class="clearfix"> + <div class="card float-left col-12 col-md-6 col-lg-4"> + {% include "ishtar/blocks/window_image.html" %} + <div class="card-body"> + </div> + </div> + {% endif %} -<div class='text-center'> - {% include "ishtar/blocks/sheet_external_id.html" %} -</div> + <ul class="nav nav-pills" role="tablist"> + {% for base_find in item.base_finds.all %} + <li class="nav-item"> + <a class="nav-link{% if forloop.first %} active{% endif %}" + data-toggle="tab" href="#{{window_id}}-base-find-{{forloop.counter}}" + role="tab"> + {{base_find.short_id}} + </a> + </li> + {% endfor %} + </ul> -<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 "Seal number" item.seal_number %} - {% trans "Administrative index" as admin_index_label %} - {% field_flex admin_index_label item.administrative_index %} - {% field_flex_full "Mark" item.mark "<pre>" "</pre>" %} -</div> + <div class="tab-content"> + {% for base_find in item.base_finds.all %} + {% with first=forloop.first|add:nb_image %} + {% include "ishtar/sheet_basefind.html" %} + {% endwith %} + {% endfor %} + </div> + {% if nb_image %} + </div> + {% endif %} + {% endwith %} + </div> -<h3>{% trans "Description" %}</h3> -<div class='row'> - {% field_flex_full "Description" item.description "<pre>" "</pre>" %} - {% field_flex "Is complete?" item.is_complete %} - {% field_flex_multiple "Material types" item.material_types %} - {% field_flex "Material type quality" item.material_type_quality %} - {% field_flex_multiple "Object types" item.object_types %} - {% field_flex "Object type quality" item.object_type_quality %} - {% field_flex "Find number" item.find_number %} - {% field_flex "Minimum number of individuals (MNI)" item.min_number_of_individuals %} - {% 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 "Communicability" item.communicabilities %} - {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} -</div> + <div class="tab-pane fade" id="{{window_id}}-identification" + role="tabpanel" aria-labelledby="{{window_id}}-identification-tab"> + <h3>{% trans "Identification" %}</h3> -{% 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 "Diameter (cm)" item.diameter %} - {% field_flex "Thickness (cm)" item.thickness %} - {% 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 %} - -<h3>{% trans "Sheet" %}</h3> -<div class='row'> - {% trans "Checked" as checked_label %} - {% field_flex checked_label item.checked_type %} - {% field_flex "Check date" item.check_date %} - {% include "ishtar/blocks/sheet_creation_section.html" %} -</div> - -{% if item.integrities.count or item.remarkabilities.count or item.conservatory_state 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 %} -<h3>{% trans "Preservation" %}</h3> -<div class='row'> - {% field_flex_multiple "Integrity / interest" item.integrities %} - {% field_flex_multiple "Remarkability" item.remarkabilities %} - {% 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 "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 "<pre>" "</pre>" %} -</div> -{% endif %} + <div class='text-center'> + {% include "ishtar/blocks/sheet_external_id.html" %} + </div> -{% if item.dating or item.dating_comment %} -<h3>{% trans "Dating" %}</h3> -{% if item.datings.count %} -<table id='{{window_id}}-datings' class="table table-striped"> - <tr> - <th>{% trans "Period" %}</th> - <th>{% trans "Start date" %}</th> - <th>{% trans "End date" %}</th> - <th>{% trans "Dating type" %}</th> - <th>{% trans "Quality" %}</th> - <th>{% trans "Precise dating" %}</th> - </tr> -{% for dating in item.datings.all %} - <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 %} - {% field_flex_full "Comment on dating" item.dating_comment "<pre>" "</pre>" %} -{% endif %} + <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 "Seal number" item.seal_number %} + {% trans "Administrative index" as admin_index_label %} + {% field_flex admin_index_label item.administrative_index %} + {% field_flex_full "Mark" item.mark "<pre>" "</pre>" %} + </div> -{% include "ishtar/blocks/sheet_json.html" %} + <h3>{% trans "Description" %}</h3> + <div class='row'> + {% field_flex_full "Description" item.description "<pre>" "</pre>" %} + {% field_flex "Is complete?" item.is_complete %} + {% field_flex_multiple "Material types" item.material_types %} + {% field_flex "Material type quality" item.material_type_quality %} + {% field_flex_multiple "Object types" item.object_types %} + {% field_flex "Object type quality" item.object_type_quality %} + {% field_flex "Find number" item.find_number %} + {% field_flex "Minimum number of individuals (MNI)" item.min_number_of_individuals %} + {% 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 "Communicability" item.communicabilities %} + {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} + </div> -{% if item.container %} -<h3>{% trans "Warehouse"%}</h3> -<div class='row'> - {% 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.cached_division %} -</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 %} -{% if item.upstream_treatment or item.downstream_treatment %} -<h3>{% trans "Treatments"%}</h3> + <h3>{% trans "Sheet" %}</h3> + <div class='row'> + {% trans "Checked" as checked_label %} + {% field_flex checked_label item.checked_type %} + {% field_flex "Check date" item.check_date %} + {% include "ishtar/blocks/sheet_creation_section.html" %} + </div> + </div> + {% if display_identification %} + <div class="tab-pane fade" id="{{window_id}}-preservation" + role="tabpanel" aria-labelledby="{{window_id}}-preservation-tab"> + {% if item.integrities.count or item.remarkabilities.count or item.conservatory_state 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 %} + <h3>{% trans "Preservation" %}</h3> + <div class='row'> + {% field_flex_multiple "Integrity / interest" item.integrities %} + {% field_flex_multiple "Remarkability" item.remarkabilities %} + {% 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 "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 "<pre>" "</pre>" %} + </div> + {% endif %} -{% if item.upstream_treatment %} -<h3>{% trans "Upstream treatment" %}</h3> -<table id='{{window_id}}-upstream' class="table table-striped"> - <tr> - <th> </th> - <th>{% trans "Year - index" %}</th> - <th>{% trans "Label" %}</th> - <th>{% trans "Type" %}</th> - <th>{% trans "State" %}</th> - <th>{% trans "Related finds (max. 15 displayed)" %}</th> - <th>{% trans "Doer" %}</th> - <th>{% trans "Container" %}</th> - <th>{% trans "Start date" %}</th> - <th>{% trans "End date" %}</th> - </tr> - {% for items, treatment in item.limited_upstream_treatments %} - <tr> - <td> - <a class="display_details" href="#" - onclick="load_window('{% url 'show-treatment' treatment.id %}/');"> - <i class="fa fa-info-circle" aria-hidden="true"></i> - </a> - </td> - <td class='string'>{{ treatment.year }} - {{treatment.index}}</td> - <td class='string'>{{ treatment.label|default_if_none:"-" }}</td> - <td class='string'>{{ treatment.treatment_types_lbl }}</td> - <td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td> - <td class='item-list'>{% for item in items %}<span>{{item}} {{ item|link_to_window}}</span>{% endfor %}</td> - <td class='string'>{{ treatment.person|default_if_none:"-" }}</td> - <td class='string'>{{ treatment.container|default_if_none:"-" }}</td> - <td class='string'>{{ treatment.start_date|default_if_none:"-" }}</td> - <td class='string'>{{ treatment.end_date|default_if_none:"-" }}</td> - </tr> - {% endfor %} -</table> -<p class='tool'><a class='badge' href="{% url 'get-upstreamtreatment' 'csv' %}?submited=1&find_id={{item.pk}}" target="_blank" title='{% trans "Export as CSV"%}'>{% trans "CSV" %}</a> ({{ENCODING}})</p> -{% endif %} + {% if item.datings.count or item.dating_comment %} + <h3>{% trans "Dating" %}</h3> + {% if item.datings.count %} + <table id='{{window_id}}-datings' class="table table-striped"> + <tr> + <th>{% trans "Period" %}</th> + <th>{% trans "Start date" %}</th> + <th>{% trans "End date" %}</th> + <th>{% trans "Dating type" %}</th> + <th>{% trans "Quality" %}</th> + <th>{% trans "Precise dating" %}</th> + </tr> + {% for dating in item.datings.all %} + <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 %} + {% field_flex_full "Comment on dating" item.dating_comment "<pre>" "</pre>" %} + {% endif %} + </div> + {% endif %} + {% if display_warehouse_treatments %} + <div class="tab-pane fade" id="{{window_id}}-warehouse" + role="tabpanel" aria-labelledby="{{window_id}}-warehouse-tab"> + {% if item.container_ref %} + <h3>{% trans "Warehouse - reference container"%}</h3> + <div class='row'> + {% field_flex_detail "Container" item.container_ref %} + {% field_flex "Container ID" item.container_ref.cached_location %} + {% field_flex_detail "Responsible warehouse" item.container_ref.responsible %} + {% field_flex_detail "Location (warehouse)" item.container_ref.location %} + {% field_flex "Precise localisation" item.container_ref.cached_division %} + </div> + {% endif %} + {% if item.container and item.container_ref.pk != item.container.pk %} + <h3>{% trans "Warehouse - current container"%}</h3> + <div class='row'> + {% 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.cached_division %} + </div> + {% endif %} + {% if item.upstream_treatment or item.downstream_treatment or item.treatments.count %} + {% if item.treatments.all %} + <h3>{% trans "Treatments"%}</h3> + <table id='{{window_id}}-treatments' class="table table-striped"> + <tr> + <th> </th> + <th>{% trans "Year - index" %}</th> + <th>{% trans "Label" %}</th> + <th>{% trans "Type" %}</th> + <th>{% trans "State" %}</th> + <th>{% trans "Related finds (max. 15 displayed)" %}</th> + <th>{% trans "Doer" %}</th> + <th>{% trans "Container" %}</th> + <th>{% trans "Start date" %}</th> + <th>{% trans "End date" %}</th> + </tr> + {% for treatment in item.treatments.all %} + <tr> + <td> + <a class="display_details" href="#" + onclick="load_window('{% url 'show-treatment' treatment.id %}/');"> + <i class="fa fa-info-circle" aria-hidden="true"></i> + </a> + </td> + <td class='string'>{{ treatment.year }} - {{treatment.index}}</td> + <td class='string'>{{ treatment.label|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.treatment_types_lbl }}</td> + <td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td> + <td class='item-list'>{% for it in treatment.limited_finds %}<span>{{it}} {{it|link_to_window}}</span>{% endfor %}</td> + <td class='string'>{{ treatment.person|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.container|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.start_date|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.end_date|default_if_none:"-" }}</td> + </tr> + {% endfor %} + </table> + {% endif %} -{% if item.downstream_treatment %} -<h3>{% trans "Downstream treatment" %}</h3> -<table id='{{window_id}}-downstream' class="table table-striped"> - <tr> - <th> </th> - <th>{% trans "Year - index" %}</th> - <th>{% trans "Label" %}</th> - <th>{% trans "Type" %}</th> - <th>{% trans "State" %}</th> - <th>{% trans "Related finds (max. 15 displayed)" %}</th> - <th>{% trans "Doer" %}</th> - <th>{% trans "Container" %}</th> - <th>{% trans "Start date" %}</th> - <th>{% trans "End date" %}</th> - </tr> - {% for items, treatment in item.limited_downstream_treatments %} - <tr> - <td> - <a class="display_details" href="#" - onclick="load_window('{% url 'show-treatment' treatment.id %}/');"> - <i class="fa fa-info-circle" aria-hidden="true"></i> - </a> - </td> - <td class='string'>{{ treatment.year }} - {{treatment.index}}</td> - <td class='string'>{{ treatment.label|default_if_none:"-" }}</td> - <td class='string'>{{ treatment.treatment_types_lbl }}</td> - <td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td> - <td class='item-list'>{% for item in items %}<span>{{item}} {{ item|link_to_window}}</span>{% endfor %}</td> - <td class='string'>{{ treatment.person|default_if_none:"" }}</td> - <td class='string'>{{ treatment.container|default_if_none:"-" }}</td> - <td class='string'>{{ treatment.start_date|default_if_none:"" }}</td> - <td class='string'>{{ treatment.end_date|default_if_none:"" }}</td> - </tr> - {% endfor %} -</table> + {% if item.upstream_treatment %} + <h3>{% trans "Upstream treatment" %}</h3> + <table id='{{window_id}}-upstream' class="table table-striped"> + <tr> + <th> </th> + <th>{% trans "Year - index" %}</th> + <th>{% trans "Label" %}</th> + <th>{% trans "Type" %}</th> + <th>{% trans "State" %}</th> + <th>{% trans "Related finds (max. 15 displayed)" %}</th> + <th>{% trans "Doer" %}</th> + <th>{% trans "Container" %}</th> + <th>{% trans "Start date" %}</th> + <th>{% trans "End date" %}</th> + </tr> + {% for items, treatment in item.limited_upstream_treatments %} + <tr> + <td> + <a class="display_details" href="#" + onclick="load_window('{% url 'show-treatment' treatment.id %}/');"> + <i class="fa fa-info-circle" aria-hidden="true"></i> + </a> + </td> + <td class='string'>{{ treatment.year }} - {{treatment.index}}</td> + <td class='string'>{{ treatment.label|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.treatment_types_lbl }}</td> + <td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td> + <td class='item-list'>{% for it in items %}<span>{{it}} {{it|link_to_window}}</span>{% endfor %}</td> + <td class='string'>{{ treatment.person|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.container|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.start_date|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.end_date|default_if_none:"-" }}</td> + </tr> + {% endfor %} + </table> + <p class='tool'><a class='badge' href="{% url 'get-upstreamtreatment' 'csv' %}?submited=1&find_id={{item.pk}}" target="_blank" title='{% trans "Export as CSV"%}'>{% trans "CSV" %}</a> ({{ENCODING}})</p> + {% endif %} -<p class='tool'><a class='badge' href="{% url 'get-downstreamtreatment' 'csv' %}?submited=1&find_id={{item.pk}}" target="_blank">{% trans "CSV" %}</a> ({{ENCODING}})</p> -{% endif %} + {% if item.downstream_treatment %} + <h3>{% trans "Downstream treatment" %}</h3> + <table id='{{window_id}}-downstream' class="table table-striped"> + <tr> + <th> </th> + <th>{% trans "Year - index" %}</th> + <th>{% trans "Label" %}</th> + <th>{% trans "Type" %}</th> + <th>{% trans "State" %}</th> + <th>{% trans "Related finds (max. 15 displayed)" %}</th> + <th>{% trans "Doer" %}</th> + <th>{% trans "Container" %}</th> + <th>{% trans "Start date" %}</th> + <th>{% trans "End date" %}</th> + </tr> + {% for items, treatment in item.limited_downstream_treatments %} + <tr> + <td> + <a class="display_details" href="#" + onclick="load_window('{% url 'show-treatment' treatment.id %}/');"> + <i class="fa fa-info-circle" aria-hidden="true"></i> + </a> + </td> + <td class='string'>{{ treatment.year }} - {{treatment.index}}</td> + <td class='string'>{{ treatment.label|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.treatment_types_lbl }}</td> + <td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td> + <td class='item-list'>{% for it in items %}<span>{{it}} {{ it|link_to_window}}</span>{% endfor %}</td> + <td class='string'>{{ treatment.person|default_if_none:"" }}</td> + <td class='string'>{{ treatment.container|default_if_none:"-" }}</td> + <td class='string'>{{ treatment.start_date|default_if_none:"" }}</td> + <td class='string'>{{ treatment.end_date|default_if_none:"" }}</td> + </tr> + {% endfor %} + </table> -{% endif %} + <p class='tool'><a class='badge' href="{% url 'get-downstreamtreatment' 'csv' %}?submited=1&find_id={{item.pk}}" target="_blank">{% trans "CSV" %}</a> ({{ENCODING}})</p> + {% endif %} + {% endif %} + </div> + {% endif %} + {% if display_documents %} + <div class="tab-pane fade" id="{{window_id}}-documents" + role="tabpanel" aria-labelledby="{{window_id}}-documents-tab"> + {% trans "Associated documents" as finds_docs %} + {% dynamic_table_document finds_docs 'documents' 'finds' item.pk '' output %} + </div> + {% endif %} + {% if item.data %} + <div class="tab-pane fade" id="{{window_id}}-json" + role="tabpanel" aria-labelledby="{{window_id}}-json-tab"> + {% include "ishtar/blocks/sheet_json.html" %} + </div> + {% endif %} +</div> -{% trans "Associated documents" as finds_docs %} -{% if item.documents.count %} -{% dynamic_table_document finds_docs 'documents' 'finds' item.pk '' output %} -{% endif %} +{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} {% endblock %} + diff --git a/archaeological_finds/templates/ishtar/sheet_findbasket.html b/archaeological_finds/templates/ishtar/sheet_findbasket.html index 3c3ca1d3f..4a101d8f2 100644 --- a/archaeological_finds/templates/ishtar/sheet_findbasket.html +++ b/archaeological_finds/templates/ishtar/sheet_findbasket.html @@ -12,8 +12,9 @@ <div class='row'> {% field_flex "Label" item.label %} {% field_flex_detail "Owned by" item.user.person %} - {% field_flex_multiple "Shared_with" item.shared_with %} {% field_flex "Comment" item.comment %} + {% field_flex_multiple_full "Shared (read) with" item.shared_with %} + {% field_flex_multiple_full "Shared (read/edit) with" item.shared_write_with %} </div> <h3>{% trans "Content" %}</h3> diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html index 1a3bb931f..78460d002 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatment.html +++ b/archaeological_finds/templates/ishtar/sheet_treatment.html @@ -1,7 +1,7 @@ {% extends "ishtar/sheet.html" %} {% load i18n window_field from_dict link_to_window window_tables window_ope_tables window_header humanize %} -{% block head_title %}<strong>{% trans "Treatment" %}</strong> - {{ item.label|default:"" }}{% endblock %} +{% block head_title %}<strong>{% trans "Treatment" %}</strong> - {{ item|default:"" }}{% endblock %} {% block toolbar %} {% window_nav item window_id 'show-treatment' 'treatment_modify' 'show-historized-treatment' 'revert-treatment' previous next 1 %} @@ -9,73 +9,130 @@ {% block content %} -<div class="row"> - <div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12"> - <div class="card"> - {% include "ishtar/blocks/window_image.html" %} - <div class="card-body"> - <p class="card-text"> - <p class="window-refs">{{ item.label|default:"" }}</p> - {% if item.other_reference %} - <p class="window-refs">{{ item.other_reference }}</p>{% endif %} - <p class="window-refs">{{ item.year }} - {{ item.index }}</p> - {% if item.external_id %} - <p class="window-refs">{{ item.external_id }}</p>{% endif %} - {% if item.end_date %} - <p class="window-refs">{% trans "Closed" context "Treatment" %} ({{item.end_date}})</p> - {% else %} - <p class="window-refs">{% trans "Active" context "Treatment" %}</p> - {% endif %} - </p> +<ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist"> + <li class="nav-item"> + <a class="nav-link active" id="{{window_id}}-treatment-tab" + data-toggle="tab" href="#{{window_id}}-treatment" role="tab" + aria-controls="{{window_id}}-treatment" aria-selected="true"> + {% trans "Treatment" %} + </a> + </li> + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-find-tab" + data-toggle="tab" href="#{{window_id}}-find" role="tab" + aria-controls="{{window_id}}-find" aria-selected="true"> + {% trans "Finds" %} + </a> + </li> + {% if item.documents.count %} + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-documents-tab" + data-toggle="tab" href="#{{window_id}}-documents" role="tab" + aria-controls="{{window_id}}-documents" aria-selected="true"> + {% trans "Documents" %} + </a> + </li> + {% endif %} + {% if item.administrative_act.count %} + <li class="nav-item"> + <a class="nav-link" id="{{window_id}}-admin-tab" + data-toggle="tab" href="#{{window_id}}-admin" role="tab" + aria-controls="{{window_id}}-admin" aria-selected="true"> + {% trans "Administrative acts" %} + </a> + </li> + {% endif %} +</ul> + +<div class="tab-content" id="{{window_id}}-tab-content"> + <div class="tab-pane fade show active" id="{{window_id}}-treatment" + role="tabpanel" aria-labelledby="{{window_id}}-treatment-tab"> + <div class="row"> + <div class="offset-lg-4 col-lg-4 offset-md-3 col-md-6 offset-sm-1 col-sm-10 col-12"> + <div class="card"> + {% include "ishtar/blocks/window_image.html" %} + <div class="card-body"> + <p class="card-text"> + <p class="window-refs">{{ item.label|default:"" }}</p> + {% if item.other_reference %} + <p class="window-refs">{{ item.other_reference }}</p>{% endif %} + <p class="window-refs">{{ item.year }} - {{ item.index }}</p> + {% if item.external_id %} + <p class="window-refs">{{ item.external_id }}</p>{% endif %} + {% if item.end_date %} + <p class="window-refs">{% trans "Closed" context "Treatment" %} ({{item.end_date}})</p> + {% else %} + <p class="window-refs">{% trans "Active" context "Treatment" %}</p> + {% endif %} + </p> + </div> + </div> </div> </div> + + <div class="row"> + {% field_flex_multiple "Treatment type" item.treatment_types %} + {% field_flex "State" item.treatment_state %} + {% field_flex_detail "Associated request" item.file %} + {% field_flex "Location" item.location %} + {% field_flex "Container" item.container %} + {% field_flex "Responsible" item.person %} + {% field_flex "Organization" item.organization %} + {% field_flex "Start date" item.start_date %} + {% field_flex "Closing date" item.end_date %} + {% field_flex "Estimated cost" item.estimated_cost|intcomma '' " "|add:CURRENCY %} + {% field_flex "Quoted cost" item.quoted_cost|intcomma '' " "|add:CURRENCY %} + {% field_flex "Realized cost" item.realized_cost|intcomma '' " "|add:CURRENCY %} + {% field_flex "Insurance cost" item.insurance_cost|intcomma '' " "|add:CURRENCY %} + {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} + {% field_flex_full "Description" item.description "<pre>" "</pre>" %} + {% field_flex_full "Goal" item.goal "<pre>" "</pre>" %} + + {% include "ishtar/blocks/sheet_json.html" %} + </div> </div> -</div> -<div class="row"> - {% field_flex_multiple "Treatment type" item.treatment_types %} - {% field_flex "State" item.treatment_state %} - {% field_flex_detail "Associated request" item.file %} - {% field_flex "Location" item.location %} - {% field_flex "Container" item.container %} - {% field_flex "Responsible" item.person %} - {% field_flex "Organization" item.organization %} - {% field_flex "Start date" item.start_date %} - {% field_flex "Closing date" item.end_date %} - {% field_flex "Estimated cost" item.estimated_cost|intcomma '' " "|add:CURRENCY %} - {% field_flex "Quoted cost" item.quoted_cost|intcomma '' " "|add:CURRENCY %} - {% field_flex "Realized cost" item.realized_cost|intcomma '' " "|add:CURRENCY %} - {% field_flex "Insurance cost" item.insurance_cost|intcomma '' " "|add:CURRENCY %} - {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} - {% field_flex_full "Description" item.description "<pre>" "</pre>" %} - {% field_flex_full "Goal" item.goal "<pre>" "</pre>" %} - - {% include "ishtar/blocks/sheet_json.html" %} -</div> + <div class="tab-pane fade" id="{{window_id}}-find" + role="tabpanel" aria-labelledby="{{window_id}}-find-tab"> + {% trans "Related finds" as finds %} + {% if item.finds.count %} + {% dynamic_table_document finds 'finds_for_treatment' 'treatments' item.pk 'TABLE_COLS_FOR_OPE' output %} + {% endif %} -{% trans "Upstream finds" as finds %} -{% if item.upstream.count %} -{% dynamic_table_document finds 'finds_for_treatment' 'downstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %} -{% endif %} + {% trans "Upstream finds" as finds %} + {% if item.upstream.count %} + {% dynamic_table_document finds 'finds_for_treatment' 'downstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %} + {% endif %} -{% trans "Downstream finds" as finds %} -{% if item.downstream.count %} -{% dynamic_table_document finds 'finds_for_treatment' 'upstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %} -{% endif %} + {% trans "Downstream finds" as finds %} + {% if item.downstream.count %} + {% dynamic_table_document finds 'finds_for_treatment' 'upstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %} + {% endif %} -{% trans "Related operations" as related_operations %} -{% dynamic_table_document related_operations 'operations' 'related_treatment' item.pk 'TABLE_COLS' output %} + {% comment %} + {% trans "Related operations" as related_operations %} + {% dynamic_table_document related_operations 'operations' 'related_treatment' item.pk 'TABLE_COLS' output %} + {% endcomment %} -{% comment %} -{% if item.source.count %} -{% trans "Associated documents" as associated_docs %} -{% dynamic_table_document associated_docs 'treatments_docs' 'treatment' item.pk '' output %} -{% endif %} -{% endcomment %} -{% if item.administrative_act.count %} -{% trans "Administrative acts" as admact_lbl %} -{% table_administrativact admact_lbl item.administrative_act.all %} -{% endif %} + </div> + {% if item.documents.count %} + <div class="tab-pane fade" id="{{window_id}}-documents" + role="tabpanel" aria-labelledby="{{window_id}}-documents-tab"> + {% trans "Associated documents" as treat_docs %} + {% dynamic_table_document treat_docs 'documents' 'treatments' item.pk '' output %} + </div> + {% endif %} + + {% if item.administrative_act.count %} + <div class="tab-pane fade" id="{{window_id}}-admin" + role="tabpanel" aria-labelledby="{{window_id}}-admin-tab"> + {% trans "Administrative acts" as admact_lbl %} + {% table_administrativact admact_lbl item.administrative_act.all %} + </div> + {% endif %} + + +</div> {% endblock %} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html index 08398a6c2..072285262 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html @@ -34,6 +34,7 @@ <div class="row"> {% field_flex "Type" item.type %} {% field_flex_detail "Responsible" item.in_charge %} + {% field_flex_detail "Associated basket" item.associated_basket %} {% field_flex "Creation date" item.creation_date %} {% field_flex "Reception date" item.reception_date %} {% field_flex "Closing date" item.end_date %} diff --git a/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html b/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html new file mode 100644 index 000000000..ffd5f0398 --- /dev/null +++ b/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html @@ -0,0 +1,25 @@ +{% extends "ishtar/wizard/confirm_wizard.html" %} +{% load i18n link_to_window %} + +{% block "warning_message" %} +{% if current_object.treatment_files.count %} +<div class="alert alert-{% if has_downstream %}danger{% else %}warning{% endif%}"> + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> + {% trans "This basket is attached to treatments requests:" %} + <ul>{% for tf in current_object.treatment_files.all %} + <li>{{ tf }} {{tf|link_to_window}}</li> + {% endfor %}</ul> + {% trans "Are you sure you want to delete this basket?" %} +</div> +{% endif %} +<div class="alert alert-info"> + {% trans "Items inside the basket (these items will not be deleted):" %} +</div> +<ul>{% for item in current_object.items.all %} + <li>{{item}} {{item|link_to_window}}</li> +{% endfor %}</ul> + +<div class="alert alert-info"> + {% trans "Basket informations:" %} +</div> +{% endblock %} diff --git a/archaeological_finds/templates/ishtar/wizard/wizard_simplefind.html b/archaeological_finds/templates/ishtar/wizard/wizard_simplefind.html new file mode 100644 index 000000000..b1d77ba81 --- /dev/null +++ b/archaeological_finds/templates/ishtar/wizard/wizard_simplefind.html @@ -0,0 +1,13 @@ +{% extends "ishtar/wizard/default_wizard.html" %} +{% load i18n %} +{% block form_head %} +<div class="alert alert-warning"> + <i class="fa fa-exclamation-triangle"></i> + {% trans 'This find is related to many base finds. To edit field related to base finds edit the corresponding find between theses:' %} + <ul>{% for base_find in wizard.form.base_finds %} + {% with find=base_find.get_main_find %}<li> + {{find.short_label }} + <a href="{% url 'find_modify' find.pk %}"><i class="fa fa-pencil"></i></a> + </li>{% endwith %}{% endfor %}</ul> +</div> +{% endblock %} diff --git a/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html b/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html new file mode 100644 index 000000000..be46bfd05 --- /dev/null +++ b/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html @@ -0,0 +1,27 @@ +{% extends "ishtar/wizard/confirm_wizard.html" %} +{% load i18n link_to_window %} + +{% block "warning_message" %} +{% with has_downstream=current_object.downstream.count %} +<div class="alert alert-{% if has_downstream %}danger{% else %}warning{% endif%}"> + <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> + {% trans "Are you sure you want to delete this treatment?" %} +{% if has_downstream %} + {% trans "The following finds will be deleted and restored to a previous version."%} + <ul>{% for item in current_object.downstream.all %} + <li> + {{item}} {{item|link_to_window}} + </li> + {% endfor %}</ul> + {% trans "All changes made to the associated finds since this treatment record will be lost!" %} +{% endif %} +</div> + +<div class="alert alert-info"> + {% trans "Treatment informations:" %} +</div> + + + +{% endwith %} +{% endblock %} |
