From 01b5bc5bd7e053fdfc160d3ecc8b105ca5bd5691 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 19 Nov 2018 10:15:39 +0100 Subject: Sheet find: use tabs and pills --- .../templates/ishtar/sheet_basefind.html | 14 +- .../templates/ishtar/sheet_find.html | 595 ++++++++++++--------- .../templates/ishtar/blocks/sheet_json.html | 2 + scss/custom.scss | 5 + 4 files changed, 351 insertions(+), 265 deletions(-) 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 %} -

{{base_find.complete_id }}

-

{{base_find.short_id }}

+
+

{{ base_find.complete_id }}

+ {% if base_find.complete_id != base_find.short_id %} +

{{ base_find.short_id }}

+ {% endif %} {% if base_find.external_id %}

@@ -77,11 +81,5 @@ {% endwith %}{% endwith %} {% endif %}

- -{% if first %} - -
-{% endif %} -{% if forloop.counter0 %}
{% endif %} diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index a3ad9fca5..4d6fe568c 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -15,276 +15,357 @@
{% endif %} + -{% with nb_image=item.images.count %} -{% if nb_image %} -
-
- {% include "ishtar/blocks/window_image.html" %} -
-
-
-{% endif %} +
-

{% trans "Associated base finds"%}

+
+ {% with nb_image=item.images.count %} + {% if nb_image %} +
+
+ {% include "ishtar/blocks/window_image.html" %} +
+
+
+ {% endif %} -
- {% for base_find in item.base_finds.all %} - {% with first=forloop.first|add:nb_image %} - {% include "ishtar/sheet_basefind.html" %} - {% endwith %} - {% endfor %} -
-{% endwith %} + -

{% trans "Identification" %}

+
+ {% for base_find in item.base_finds.all %} + {% with first=forloop.first|add:nb_image %} + {% include "ishtar/sheet_basefind.html" %} + {% endwith %} + {% endfor %} +
+ {% if nb_image %} +
+ {% endif %} + {% endwith %} +
-
- {% include "ishtar/blocks/sheet_external_id.html" %} -
+
+

{% trans "Identification" %}

-
- {% 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 "
" "
" %} -
+
+ {% include "ishtar/blocks/sheet_external_id.html" %} +
-

{% trans "Description" %}

-
- {% field_flex_full "Description" item.description "
" "
" %} - {% 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 "
" "
" %} - {% field_flex_full "Inscription" item.inscription "
" "
" %} - {% field_flex "Manufacturing place" item.manufacturing_place %} - {% field_flex_multiple "Communicability" item.communicabilities %} - {% field_flex_full "Comment" item.comment "
" "
" %} -
+
+ {% 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 "
" "
" %} +
-{% 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 %} -

{% trans "Dimensions" %}

-
- {% 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 "
" "
" %} -
-{% endif %} +

{% trans "Description" %}

+
+ {% field_flex_full "Description" item.description "
" "
" %} + {% 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 "
" "
" %} + {% field_flex_full "Inscription" item.inscription "
" "
" %} + {% field_flex "Manufacturing place" item.manufacturing_place %} + {% field_flex_multiple "Communicability" item.communicabilities %} + {% field_flex_full "Comment" item.comment "
" "
" %} +
-

{% trans "Sheet" %}

-
- {% 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" %} -
+ {% 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 %} +

{% trans "Dimensions" %}

+
+ {% 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 "
" "
" %} +
+ {% endif %} -{% 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 %} -

{% trans "Preservation" %}

-
- {% 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 "
" "
" %} -
-{% endif %} +

{% trans "Sheet" %}

+
+ {% 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" %} +
+
+
+ {% 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 %} +

{% trans "Preservation" %}

+
+ {% 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 "
" "
" %} +
+ {% endif %} -{% if item.dating or item.dating_comment %} -

{% trans "Dating" %}

-{% if item.datings.count %} - - - - - - - - - -{% for dating in item.datings.all %} - - - - - - - - -{% endfor %} -
{% trans "Period" %}{% trans "Start date" %}{% trans "End date" %}{% trans "Dating type" %}{% trans "Quality" %}{% trans "Precise dating" %}
- {{dating.period}} - - {{dating.start_date|default_if_none:"-"}} - - {{dating.end_date|default_if_none:"-"}} - - {{dating.dating_type|default_if_none:"-"}} - - {{dating.quality|default_if_none:"-"}} - - {{dating.precise_dating|default_if_none:"-"}} -
-{% endif %} - {% field_flex_full "Comment on dating" item.dating_comment "
" "
" %} -{% endif %} + {% if item.datings.count or item.dating_comment %} +

{% trans "Dating" %}

+ {% if item.datings.count %} + + + + + + + + + + {% for dating in item.datings.all %} + + + + + + + + + {% endfor %} +
{% trans "Period" %}{% trans "Start date" %}{% trans "End date" %}{% trans "Dating type" %}{% trans "Quality" %}{% trans "Precise dating" %}
+ {{dating.period}} + + {{dating.start_date|default_if_none:"-"}} + + {{dating.end_date|default_if_none:"-"}} + + {{dating.dating_type|default_if_none:"-"}} + + {{dating.quality|default_if_none:"-"}} + + {{dating.precise_dating|default_if_none:"-"}} +
+ {% endif %} + {% field_flex_full "Comment on dating" item.dating_comment "
" "
" %} + {% endif %} +
+
+ {% if item.container %} +

{% trans "Warehouse"%}

+
+ {% 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 %} +
+ {% endif %} + {% if item.upstream_treatment or item.downstream_treatment or item.treatments.count %} + {% if item.treatments.all %} +

{% trans "Treatments"%}

+ + + + + + + + + + + + + + {% for treatment in item.treatments.all %} + + + + + + + + + + + + + {% endfor %} +
 {% trans "Year - index" %}{% trans "Label" %}{% trans "Type" %}{% trans "State" %}{% trans "Related finds (max. 15 displayed)" %}{% trans "Doer" %}{% trans "Container" %}{% trans "Start date" %}{% trans "End date" %}
+ + + + {{ treatment.year }} - {{treatment.index}}{{ treatment.label|default_if_none:"-" }}{{ treatment.treatment_types_lbl }}{{ treatment.treatment_state|default_if_none:"-" }}{% for it in treatment.limited_finds %}{{it}} {{it|link_to_window}}{% endfor %}{{ treatment.person|default_if_none:"-" }}{{ treatment.container|default_if_none:"-" }}{{ treatment.start_date|default_if_none:"-" }}{{ treatment.end_date|default_if_none:"-" }}
+ {% endif %} -{% include "ishtar/blocks/sheet_json.html" %} + {% if item.upstream_treatment %} +

{% trans "Upstream treatment" %}

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

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

+ {% endif %} -{% if item.container %} -

{% trans "Warehouse"%}

-
- {% 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 %} -
-{% endif %} + {% if item.downstream_treatment %} +

{% trans "Downstream treatment" %}

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

{% trans "Treatments"%}

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

{% trans "Upstream treatment" %}

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

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

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

{% trans "Downstream treatment" %}

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

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

-{% endif %} - -{% endif %} - -{% trans "Associated documents" as finds_docs %} -{% if item.documents.count %} -{% dynamic_table_document finds_docs 'documents' 'finds' item.pk '' output %} -{% endif %} +

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

+ {% endif %} + {% endif %} +
+ {% if item.documents.count %} +
+ {% trans "Associated documents" as finds_docs %} + {% dynamic_table_document finds_docs 'documents' 'finds' item.pk '' output %} +
+ {% endif %} +
+ {% include "ishtar/blocks/sheet_json.html" %} +
+
{% endblock %} + diff --git a/ishtar_common/templates/ishtar/blocks/sheet_json.html b/ishtar_common/templates/ishtar/blocks/sheet_json.html index 8927eb057..df9340c6f 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_json.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_json.html @@ -5,5 +5,7 @@ {% if forloop.first %}
{% endif %} {% field_flex label value %} {% if forloop.last %}
{% endif %} +{% empty %} +{% trans "No data" %} {% endfor %} {% endfor %} diff --git a/scss/custom.scss b/scss/custom.scss index f0168d469..09074de0b 100644 --- a/scss/custom.scss +++ b/scss/custom.scss @@ -136,6 +136,11 @@ pre { background-color: white; } + +.tab-content{ + padding-top: 1em; +} + .input-progress.form-control:focus, .input-progress{ background-color: $gray-300; -- cgit v1.2.3