diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-19 19:47:04 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-19 19:47:04 +0100 |
commit | dba959d5d244f2e02c8ff22f4a8789c7d3ad3cfa (patch) | |
tree | a16dd9013a8cb8363808bd550f4415fafad71193 | |
parent | 37a52a77a7cf2b02c5a811af7a81def1751ea737 (diff) | |
download | Ishtar-dba959d5d244f2e02c8ff22f4a8789c7d3ad3cfa.tar.bz2 Ishtar-dba959d5d244f2e02c8ff22f4a8789c7d3ad3cfa.zip |
Improve find sheet
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 %}<strong>{% trans "Context record source" %}</strong> - {{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 %} -<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> -{% endif%} -{% if item.downstream_treatment %} -<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> - {% trans "This sheet has a downstream treatment: it is related to an old version of the find." %}</p> -{% endif %} +{% block head_title %}<strong>{% trans "Find" %}</strong> - {{item.label|default:""}}{% endblock %} -<p class="window-refs" title="{% trans 'Free ID' %}">{{ item.label|default:"" }}</p> -<p class='window-refs' title="{% trans 'Base find - Complete ID' %}">{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.complete_id}}{% endfor %}</p> -<p class='window-refs' title="{% trans 'Base find - Short ID' %}">{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.short_id}}{% endfor %}</p> -<p class="window-refs" title="{% trans 'Find - Administrative ID' %}">{{ item.administrative_index|default:"" }}</p> -{% 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 %} -<ul class='form-flex'> - {% field_li "Previous ID" item.previous_id %} +<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"> + {% if item.image %} + <img class='card-img-top' src="{{item.thumbnail.url}}"> + {% endif%} + <div class="card-body"> + <p class="card-text"> + <p class="window-refs" title="{% trans 'Free ID' %}">{{ item.label|default:"" }}</p> + <p class='window-refs' title="{% trans 'Base find - Complete ID' %}">{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.complete_id}}{% endfor %}</p> + <p class='window-refs' title="{% trans 'Base find - Short ID' %}">{% for base_find in item.base_finds.all %}{% if forloop.counter0 %} – {% endif %}{{base_find.short_id}}{% endfor %}</p> + <p class="window-refs" title="{% trans 'Find - Administrative ID' %}">{{ item.administrative_index|default:"" }}</p> + {% include "ishtar/blocks/sheet_external_id.html" %} + </p> + </div> + </div> + </div> +</div> - {% include "ishtar/blocks/sheet_creation_section.html" %} - {% trans "Administrative index" as admin_index_label %} - {% field_li admin_index_label item.administrative_index %} -{% field_li_multiple "Material types" item.material_types %} -{% field_li "Dating" item.dating %} -{% field_li "Length (cm)" item.length %} -{% field_li "Width (cm)" item.width %} -{% field_li "Height (cm)" item.height %} -{% field_li "Diameter (cm)" item.diameter %} -{% field_li "Thickness (cm)" item.thickness %} -{% field_li "Volume (l)" item.volume %} -{% field_li "Weight" item.weight_string %} -{% if item.dimensions_comment %} -</ul> -{% field "Dimensions comment" item.dimensions_comment "<pre>" "</pre>" %} -<ul class='form-flex'> +{% if item.downstream_treatment %} +<div class="alert alert-warning" role="alert"> + {% trans "This sheet has a downstream treatment: it is related to an old version of the find." %}</p> +</div> {% endif %} -{% field_li "Find number" item.find_number %} -{% field_li "Minimum number of individuals (MNI)" item.min_number_of_individuals %} -{% field_li_multiple "Object types" item.object_types %} -{% field_li_multiple "Integrity / interest" item.integrities %} -{% field_li_multiple "Remarkability" item.remarkabilities %} -{% field_li "Estimated value" item.estimated_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} -{% if item.CHECK_DICT %} -{% field_li "Checked" item.checked|from_dict:item.CHECK_DICT %} -{% endif%} -{% if item.history_object and item.history_object.CHECK_DICT %} -{% field_li "Checked" item.checked|from_dict:item.history_object.CHECK_DICT %} -{% endif%} -</ul> +<div class='row'> + {% 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 "<pre>" "</pre>" %} -{% field "Description" item.description "<pre>" "</pre>" %} -{% field "Comment" item.comment "<pre>" "</pre>" %} + {% 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 "<pre>" "</pre>" %} + {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} +</div> {% 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 %} <h4>{% trans "Preservation" %}</h4> -<ul class='form-flex'> - {% field_li "Conservatory state" item.conservatory_state %} - {% field_li_multiple "Alteration" item.alterations %} - {% field_li_multiple "Alteration cause" item.alteration_causes %} - {% field_li_multiple "Recommended treatments" item.preservation_to_considers %} - {% field_li "Treatment emergency" item.treatment_emergency %} - {% field_li "Insurance value" item.insurance_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %} - {% field_li "Appraisal date" item.appraisal_date %} -</ul> - {% field "Conservatory comment" item.conservatory_comment "<pre>" "</pre>" %} +<div class='row'> + {% 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 "<pre>" "</pre>" %} +</div> {% endif %} {% if item.container %} <h3>{% trans "Warehouse"%}</h3> -{% 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 %} +<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.divisions_lbl %} +</div> {% endif %} {% if item.upstream_treatment or item.downstream_treatment %} @@ -88,9 +98,7 @@ {% if item.upstream_treatment %} <h4>{% trans "Upstream treatment" %}</h4> -<div class='clean-table'> -<div class='clean-table-wrap'> -<table id='{{window_id}}-upstream'> +<table id='{{window_id}}-upstream' class="table table-striped"> <tr> <th> </th> <th>{% trans "Year - index" %}</th> @@ -123,16 +131,12 @@ </tr> {% endfor %} </table> -</div> -</div> <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.downstream_treatment %} <h4>{% trans "Downstream treatment" %}</h4> -<div class='clean-table'> -<div class='clean-table-wrap'> -<table id='{{window_id}}-downstream'> +<table id='{{window_id}}-downstream' class="table table-striped"> <tr> <th> </th> <th>{% trans "Year - index" %}</th> @@ -165,8 +169,6 @@ </tr> {% endfor %} </table> -</div> -</div> <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 %} @@ -176,63 +178,63 @@ <h3>{% trans "Associated base finds"%}</h3> {% for base_find in item.base_finds.all %} -<p class='window-refs'>{{base_find.complete_id }}</p> -<p class='window-refs'>{{base_find.short_id }}</p> +<p class='window-refs text-center'>{{base_find.complete_id }}</p> +<p class='window-refs text-center'>{{base_find.short_id }}</p> {% if base_find.external_id %} -<p class='window-refs external-id'> +<p class='window-refs text-center external-id'> <small title="{% trans 'Internal ID' %}"> <i class="fa fa-key" aria-hidden="true"></i> {{base_find.external_id|default:''}} </small> </p>{% endif %} -<ul class='form-flex'> -{% with item.history_creation_date|date:"SHORT_DATETIME_FORMAT" as creation_date %} -{% with item.history_creator.ishtaruser.full_label|add:"<br/><i>"|add:creation_date|add:"</i>" as creator %} -{% field_li "Created by" creator|safe %} -{% endwith %} -{% endwith %} -{% if item.history_creation_date != item.last_edition_date %} -{% with item.last_edition_date|date:"SHORT_DATETIME_FORMAT" as edition_date %} -{% with item.history_modifier.ishtaruser.full_label|add:"<br/><i>"|add:edition_date|add:"</i>" as modifier %} -{% field_li "Last modified by" modifier|safe %} -{% endwith %} -{% endwith %} -{% endif %} -{% field_li "Batch/object" base_find.batch %} -{% if base_find.history_object and base_find.history_object.IS_ISOLATED_DICT %} -{% field_li "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %} -{% endif %} -{% field_li "Discovery date" base_find.discovery_date %} -{% field_li "Special interest" base_find.special_interest %} -{% field_li_detail "Context record" base_find.context_record %} -{% field_li "Town" base_find.context_record.parcel.town %} -{% field_li "Parcel" base_find.context_record.parcel %} -{% field_li_detail "Operation" base_find.context_record.operation %} -{% field_li "Point of topographic reference" base_find.topographic_localisation %} - -{% if base_find.x or base_find.y %} - <li><label>{% trans "Coordinates" %}</label> - <span class="value"> - {% 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 %}) +<div class='row'> + {% with item.history_creation_date|date:"SHORT_DATETIME_FORMAT" as creation_date %} + {% with item.history_creator.ishtaruser.full_label|add:"<br/><i>"|add:creation_date|add:"</i>" as creator %} + {% field_flex "Created by" creator|safe %} + {% endwith %}{% endwith %} + {% if item.history_creation_date != item.last_edition_date %} + {% with item.last_edition_date|date:"SHORT_DATETIME_FORMAT" as edition_date %} + {% with item.history_modifier.ishtaruser.full_label|add:"<br/><i>"|add:edition_date|add:"</i>" as modifier %} + {% field_flex "Last modified by" modifier|safe %} + {% endwith %}{% endwith %} {% endif %} - </span> -{% endif %} -</ul> + {% 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 "<pre>" "</pre>" %} -{% field "Comment" base_find.comment "<pre>" "</pre>" %} + {% if base_find.x or base_find.y %} + <dl class="col-12 col-md-6 col-lg-4 d-flex flex-wrap row"> + <dt class="col-5">{% trans "Coordinates" %}</dt> + <dd class="col-7"> + {% 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 %} + </dd> + </dl> + {% endif %} + {% field_flex_full "Description" base_find.description "<pre>" "</pre>" %} + {% field_flex_full "Comment" base_find.comment "<pre>" "</pre>" %} +</div> {% if forloop.counter0 %}<hr/>{% endif %} {% endfor %} {% if item.source.count %} <h3>{% trans "Documents"%}</h3> -<table id='{{window_id}}-docs'> +<table id='{{window_id}}-docs' class="table table-striped"> <caption>{%trans "Documents"%}</caption> <tr> <th> </th> @@ -254,11 +256,6 @@ {% empty %} {% endfor %} </table> - -<script type='text/javascript'> -tableToGrid('#{{window_id}}-docs', { - width: null, shrinkToFit: false}); -</script> {% 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 @@ <div class='row'> {% if item.nb_context_records_by_type %} <div class="col-12 col-md-6 col-lg-4"> - <table class="table"> + <table class="table table-striped"> <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr> {% for label, nb in item.nb_context_records_by_type %} <tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr> @@ -239,7 +239,7 @@ {% endif %} {% if item.nb_context_records_by_periods %} <div class="col-12 col-md-6 col-lg-4"> - <table class="table"> + <table class="table table-striped"> <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr> {% for label, nb in item.nb_context_records_by_periods %} <tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr> @@ -256,7 +256,7 @@ <div class='row'> {% if item.nb_finds_by_material_type %} <div class="col-12 col-md-6 col-lg-4"> - <table class="table"> + <table class="table table-striped"> <tr><th>{% trans "Material type" %}</th><th>{% trans "Number" %}</th></tr> {% for label, nb in item.nb_finds_by_material_type %} <tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr> @@ -266,7 +266,7 @@ {% endif %} {% if item.nb_finds_by_types %} <div class="col-12 col-md-6 col-lg-4"> - <table class="table"> + <table class="table table-striped"> <tr><th>{% trans "Object type" %}</th><th>{% trans "Number" %}</th></tr> {% for label, nb in item.nb_finds_by_types %} <tr><td>{{label}}</td><td>{{nb}}</td></tr> @@ -276,7 +276,7 @@ {% endif %} {% if item.nb_finds_by_periods %} <div class="col-12 col-md-6 col-lg-4"> - <table class="table"> + <table class="table table-striped"> <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr> {% for label, nb in item.nb_finds_by_periods %} <tr><td>{{label|default:"-"}}</td><td>{{nb}}</td></tr> @@ -293,7 +293,7 @@ <div class='row'> {% if item.nb_documents_by_types %} <div class="col-12 col-md-6 col-lg-4"> - <table class="table"> + <table class="table table-striped"> <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr> {% for label, nb in item.nb_documents_by_types %} <tr><td>{{label}}</td><td>{{nb}}</td></tr> 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 %} <div class="card"> + {% if form_label %} <div class="card-header"> {{form_label}} - </div> + </div>{% endif %} <div class="card-body form-row"> <table class='table'> {% for data in form_data %} |