summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-03-03 09:28:47 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-03-03 09:28:47 +0100
commit325c9c32c1a55ffcceaecb16ab4d7aa20b87eccc (patch)
tree83230252d0d39e0d5356f33aa15dcea615695d07
parent32d5f1a47dca42bbdebebeddc77bdd38fa7a04a3 (diff)
downloadIshtar-325c9c32c1a55ffcceaecb16ab4d7aa20b87eccc.tar.bz2
Ishtar-325c9c32c1a55ffcceaecb16ab4d7aa20b87eccc.zip
Sheet find: reorganization
-rw-r--r--archaeological_finds/models_finds.py9
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html105
-rw-r--r--scss/custom.scss9
3 files changed, 80 insertions, 43 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 13b6ddfce..088fc14b7 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -821,6 +821,15 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel,
return u" ; ".join([unicode(dating) for dating in self.datings.all()])
@property
+ def excavation_ids(self):
+ return u" - ".join(
+ [base_find['excavation_id']
+ for base_find in self.base_finds.values(
+ 'excavation_id').order_by('pk').all()
+ if base_find['excavation_id']])
+
+
+ @property
def materials(self):
return u" ; ".join([unicode(material)
for material in self.material_types.all()])
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index c2116efe8..5d2d58ac9 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -1,7 +1,7 @@
{% extends "ishtar/sheet.html" %}
{% load i18n window_field from_dict link_to_window window_tables window_header humanize %}
-{% block head_title %}<strong>{% trans "Find" %}</strong> - {{item.label|default:""}}{% endblock %}
+{% block head_title %}<strong xmlns:h2="http://www.w3.org/1999/html">{% trans "Find" %}</strong> - {{item.label|default:""}}{% endblock %}
{% block toolbar %}
{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next 1 %}
@@ -33,45 +33,34 @@
</div>
{% endif %}
+<h3>{% trans "Identification" %}</h3>
+
<div class='row'>
+ {% 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 %}
- {% 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_full "Description" item.description "<pre>" "</pre>" %}
+ {% include "ishtar/blocks/sheet_creation_section.html" %}
{% field_flex_full "Mark" item.mark "<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 %}
+</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_multiple "Object types" item.object_types %}
{% 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_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 "Estimated value" item.estimated_value|default_if_none:''|intcomma '' ' '|add:CURRENCY %}
{% field_flex_full "Comment" item.comment "<pre>" "</pre>" %}
- {% trans "Checked" as checked_label %}
- {% if item.CHECK_DICT %}
- {% field_flex checked_label item.checked|from_dict:item.CHECK_DICT %}
- {% endif%}
- {% if item.history_object and item.history_object.CHECK_DICT %}
- {% field_flex checked_label item.checked|from_dict:item.history_object.CHECK_DICT %}
- {% endif%}
- {% field_flex "Check date" item.check_date %}
</div>
-{% include "ishtar/blocks/sheet_json.html" %}
-
-{% if item.dating or item.dating_comment %}
-<h3>{% trans "Dating" %}</h3>
- {% field_flex "Dating" item.dating %}
- {% field_flex_full "Comment on dating" item.dating_comment "<pre>" "</pre>" %}
-{% 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 %}
<h3>{% trans "Dimensions" %}</h3>
<div class='row'>
@@ -87,20 +76,43 @@
</div>
{% endif %}
-{% 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 %}
+<h3>{% trans "Sheet" %}</h3>
+<div class='row'>
+ {% trans "Checked" as checked_label %}
+ {% if item.CHECK_DICT %}
+ {% field_flex checked_label item.checked|from_dict:item.CHECK_DICT %}
+ {% endif%}
+ {% if item.history_object and item.history_object.CHECK_DICT %}
+ {% field_flex checked_label item.checked|from_dict:item.history_object.CHECK_DICT %}
+ {% endif%}
+ {% field_flex "Check date" item.check_date %}
+</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 %}
+{% include "ishtar/blocks/sheet_json.html" %}
+
+{% if item.dating or item.dating_comment %}
+<h3>{% trans "Dating" %}</h3>
+ {% field_flex "Dating" item.dating %}
+ {% field_flex_full "Comment on dating" item.dating_comment "<pre>" "</pre>" %}
+{% endif %}
+
{% if item.container %}
<h3>{% trans "Warehouse"%}</h3>
<div class='row'>
@@ -194,8 +206,9 @@
{% endif %}
-<h3>{% trans "Associated base finds"%}</h3>
+<h2>{% trans "Associated base finds"%}</h2>
+<div class="subsection">
{% for base_find in item.base_finds.all %}
<p class='window-refs text-center'>{{base_find.complete_id }}</p>
<p class='window-refs text-center'>{{base_find.short_id }}</p>
@@ -232,24 +245,32 @@
{% field_flex "Parcel" base_find.context_record.parcel %}
{% field_flex_detail "Operation" base_find.context_record.operation %}
{% field_flex_detail "Archaeological site" base_find.context_record.archaeological_site %}
- {% field_flex "Point of topographic reference" base_find.topographic_localisation %}
+ {% field_flex_full "Description" base_find.description "<pre>" "</pre>" %}
+ {% field_flex_full "Comment" base_find.comment "<pre>" "</pre>" %}
+</div>
- {% 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.x or base_find.y or base_find.topographic_localisation %}
+<h3>{% trans "Coordinates"%}</h3>
+<div class='row'>
+ {% field_flex "Point of topographic reference" base_find.topographic_localisation %}
+ <dl class="col-12 d-flex flex-wrap row">
+ <dt class="col-2">{% trans "Coordinates" %}</dt>
+ <dd class="col-10">
+ {% trans "X:"%} {{base_find.x|default_if_none:"-"}}
+ {% if base_find.estimated_error_x %} ({% trans "error:" %} {{base_find.estimated_error_x}}){% endif %},
+ {% trans "Y:"%} {{base_find.y|default_if_none:"-"}},
+ {% if base_find.estimated_error_y %} ({% trans "error:" %} {{base_find.estimated_error_y}}){% endif %},
+ {% trans "Z:"%} {{base_find.z|default_if_none:"-"}}
+ {% if base_find.estimated_error_z %} ({% trans "error:" %} {{base_find.estimated_error_z}}){% endif %}
{% 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 %})
+ &ndash; {{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>
+{% endif %}
+
</div>
{% if forloop.counter0 %}<hr/>{% endif %}
{% endfor %}
diff --git a/scss/custom.scss b/scss/custom.scss
index abe8a143e..436ef9579 100644
--- a/scss/custom.scss
+++ b/scss/custom.scss
@@ -169,11 +169,18 @@ textarea {
text-shadow: 2px 2px 2px rgba(150, 150, 150, 0.70);
}
+.sheet .subsection{
+ background-color: $gray-200;
+}
+
+.sheet .row{
+ padding: 0.5em 0.75em;
+}
+
.clean-table h4{
margin-top: 1em;
}
-
.container{
margin-top: 1em;
margin-bottom: 8em;