summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-02 01:23:43 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-02 01:23:43 +0200
commite1ab754e554cc4ce98e7a79897d16cfe5c53c765 (patch)
treea5a6533a9fd04ae7a0a22fdfc74b4974a86fa7f5 /archaeological_finds
parent0572dd58583bc7e81c21ad18a52f7fc39baed08f (diff)
downloadIshtar-e1ab754e554cc4ce98e7a79897d16cfe5c53c765.tar.bz2
Ishtar-e1ab754e554cc4ce98e7a79897d16cfe5c53c765.zip
Sheet refactoring with images
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/templates/ishtar/sheet_basefind.html87
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html118
2 files changed, 107 insertions, 98 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html
new file mode 100644
index 000000000..c20ca66ee
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_basefind.html
@@ -0,0 +1,87 @@
+{% 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>
+ {% if base_find.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 %}
+
+ <div class='row'>
+ {% field_flex_detail "Operation" base_find.context_record.operation first %}
+ {% field_flex_detail "Archaeological site" base_find.context_record.archaeological_site first %}
+ {% field_flex_detail "Context record" base_find.context_record first %}
+ {% field_flex "Town" base_find.context_record.town.label_with_areas '' '' first %}
+ {% field_flex "Parcel" base_find.context_record.parcel '' '' first %}
+
+ {# START discovery dates #}
+ {% if not base_find.discovery_date_taq %}
+ {% trans "Discovery date" as discovery_date_label %}
+ {% field_flex discovery_date_label base_find.discovery_date '' '' first %}
+ {% elif base_find.discovery_date.year == base_find.discovery_date_taq.year and base_find.discovery_date_taq|date:"d-m" == "31-12" and base_find.discovery_date|date:"d-m" == "01-01" %}
+ {% trans "Discovery year" as discovery_year_label %}
+ {% field_flex discovery_year_label base_find.discovery_date.year '' '' first %}
+ {% else %}
+ {% trans "Discovery date (TPQ)" as discovery_tpq_label %}
+ {% field_flex discovery_tpq_label base_find.discovery_date '' '' first %}
+ {% trans "Discovery date (TAQ)" as discovery_taq_label %}
+ {% field_flex discovery_taq_label base_find.discovery_date_taq '' '' first %}
+ {% endif %}
+ {# END discovery dates #}
+
+ {% field_flex "Excavation ID" base_find.excavation_id '' '' first %}
+ {% field_flex "Batch/object" base_find.batch '' '' first %}
+ {% 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 '' '' first %}
+ {% endif %}
+
+ {% field_flex "Special interest" base_find.special_interest '' '' first %}
+ {% field_flex_full "Description" base_find.description "<pre>" "</pre>" first %}
+ {% field_flex_full "Comment" base_find.comment "<pre>" "</pre>" first %}
+ </div>
+
+ {% 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 %}
+ &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>
+ </div>
+ {% endif %}
+ <h3>{% trans "Sheet"%}</h3>
+ <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 '' '' first %}
+ {% 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 %}
+ {% trans "Last modified by" as lastmodifiedby_label %}
+ {% field_flex lastmodifiedby_label modifier|safe '' '' first %}
+ {% 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 f36dd6afe..55c02d8c7 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -9,114 +9,36 @@
{% 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" title="{% trans 'Denomination' %}">{{ item.denomination|default:"" }}</p>
- <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 %} &ndash; {% 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 %} &ndash; {% 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>
-
{% 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>
+ {% trans "This sheet has a downstream treatment: it is related to an old version of the find." %}</p>
</div>
{% endif %}
-<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>
- {% if base_find.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 %}
-
- <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 %}
- {% trans "Last modified by" as lastmodifiedby_label %}
- {% field_flex lastmodifiedby_label modifier|safe %}
- {% endwith %}{% endwith %}
- {% endif %}
- {% field_flex "Excavation ID" base_find.excavation_id %}
- {% 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 %}
+<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">
+ <p class="card-text">
+ </p>
+ </div>
+ </div>
- {# START discovery dates #}
- {% if not base_find.discovery_date_taq %}
- {% trans "Discovery date" as discovery_date_label %}
- {% field_flex discovery_date_label base_find.discovery_date %}
- {% elif base_find.discovery_date.year == base_find.discovery_date_taq.year and base_find.discovery_date_taq|date:"d-m" == "31-12" and base_find.discovery_date|date:"d-m" == "01-01" %}
- {% trans "Discovery year" as discovery_year_label %}
- {% field_flex discovery_year_label base_find.discovery_date.year %}
- {% else %}
- {% trans "Discovery date (TPQ)" as discovery_tpq_label %}
- {% field_flex discovery_tpq_label base_find.discovery_date %}
- {% trans "Discovery date (TAQ)" as discovery_taq_label %}
- {% field_flex discovery_taq_label base_find.discovery_date_taq %}
- {% endif %}
- {# END discovery dates #}
+ <h2>{% trans "Associated base finds"%}</h2>
- {% field_flex "Special interest" base_find.special_interest %}
- {% field_flex_detail "Context record" base_find.context_record %}
- {% field_flex "Town" base_find.context_record.town.label_with_areas %}
- {% 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_full "Description" base_find.description "<pre>" "</pre>" %}
- {% field_flex_full "Comment" base_find.comment "<pre>" "</pre>" %}
+ <div class="subsection">
+ {% for base_find in item.base_finds.all %}
+ {% with first=forloop.first|add:item.images.count %}
+ {% include "ishtar/sheet_basefind.html" %}
+ {% endwith %}
+ {% endfor %}
</div>
- {% 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 %}
- &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>
- </div>
- {% endif %}
+<h3>{% trans "Identification" %}</h3>
+<div class='text-center'>
+ {% include "ishtar/blocks/sheet_external_id.html" %}
</div>
-{% if forloop.counter0 %}<hr/>{% endif %}
-{% endfor %}
-
-<h3>{% trans "Identification" %}</h3>
<div class='row'>
{% field_flex "Denomination" item.denomination %}
@@ -127,7 +49,6 @@
{% field_flex "Seal number" item.seal_number %}
{% trans "Administrative index" as admin_index_label %}
{% field_flex admin_index_label item.administrative_index %}
- {% include "ishtar/blocks/sheet_creation_section.html" %}
{% field_flex_full "Mark" item.mark "<pre>" "</pre>" %}
</div>
@@ -176,6 +97,7 @@
{% field_flex checked_label item.checked|from_dict:item.history_object.CHECK_DICT %}
{% endif%}
{% 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 %}