summaryrefslogtreecommitdiff
path: root/archaeological_operations/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-05 17:05:03 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-05 17:05:03 +0200
commit10c8a694f2ffcfc001f5deddcb7d633d9f00b7cc (patch)
tree0fa618c50ef4dff1e59924f46d78548e9b714cb4 /archaeological_operations/templates
parent466195bd302ffcabdbcbbef882a269093584d865 (diff)
downloadIshtar-10c8a694f2ffcfc001f5deddcb7d633d9f00b7cc.tar.bz2
Ishtar-10c8a694f2ffcfc001f5deddcb7d633d9f00b7cc.zip
Operation: display statistics on the sheet (refs #2989)
Diffstat (limited to 'archaeological_operations/templates')
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html230
1 files changed, 138 insertions, 92 deletions
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index f0846f11f..f8421c830 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -6,110 +6,69 @@
{% block content %}
{% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next %}
-{% if previous or next %}
-<div class='tool'>
-{%if previous%}
-<a href="#" onclick='load_window("{% url show-historized-operation item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;'>{%trans "Previous version"%} ({{previous}})</a>
-{% endif %}
-{% if previous and next %} - {% endif %}
-{%if next%}
-<a href="#" onclick='if(confirm("{%trans "Are you sure to rollback to this version?"%}")){load_url("{% url revert-operation item.pk item.history_date|date:"c"%}");closeAllWindows();load_window("{% url show-operation item.pk None %}");}'>Rollback</a> -
-<a href="#" onclick='load_window("{% url show-historized-operation item.pk next|date:"c" %}");$("#{{window_id}}").hide();return false;'>{%trans "Next version"%} ({{next}})</a>
-{% endif %}
-</div>
-{% endif %}
-
-<div class='tool'>{%trans "Export as:"%} <a href='{% url show-operation item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-operation item.pk "pdf" %}'>{%trans "PDF file"%}</a></div>
-
-<div class='tool modify'><a href='{% url operation_modify item.pk %}'>{% trans "Modify" %}</a></div>
-
{% if item.virtual_operation %}
<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {% trans "This operation is virtual." %}</p>
{% endif %}
-
-<h3>{% trans "General"%}</h3>
-{% if item.common_name %}<p><label>{%trans "Name:"%}</label> <span class='value'>{{ item.common_name }}</span></p>{% endif %}
-{% if item.year %}<p><label>{%trans "Year:"%}</label> <span class='value strong'>{{ item.year }}</span></p>{% endif %}
-{% if item.operation_code %}<p><label>{%trans "Numerical reference:"%}</label> <span class='value strong'>{{ item.operation_code }}</span></p>{% endif %}
-
-{% if item.code_patriarche %}<p><label>{%trans "Patriarche OA code:"%}</label> <span class='value'>OA{{ item.code_patriarche }}</span></p>{%else%}
-<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {%trans "Patriarche OA code not yet recorded!"%}</p>{%endif%}
-{% field "Old code" item.old_code %}
-
-<p><label>{%trans "Last modification date:"%}</label> <span class='value'>{% if item.history_date %}{{ item.history_date }}{% else %}{{ item.history.all.0.history_date }}{% endif %}</span></p> <!-- date = now -->
-<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
-
-{% if item.start_date %}<p><label>{%trans "Begining date:"%}</label> <span class='value'>{{ item.start_date }}</span></p>
-<p><label>{%trans "Excavation end date:"%}</label> <span class='value'>{{ item.excavation_end_date|default:"-" }}</span></p>
-{%endif%}
-{% if item.scientist %}<p><label>{%trans "Head scientist:"%}</label> <span class='value'>{{ item.scientist.full_label }} <a href='#' onclick='load_window("{% url show-person item.scientist.pk ''%}");'><i class="fa fa-info-circle" aria-hidden="true"></i></a></span></p>{%endif%}
-{% if item.in_charge %}<p><label>{%trans "In charge:"%}</label> <span class='value'>{{ item.in_charge.full_label }}</span></p>{%endif%}
-{% if item.operator %}<p><label>{%trans "Operator:"%}</label> <span class='value'>{{ item.operator }} <a href='#' onclick='load_window("{% url show-organization item.operator.pk ''%}");'><i class="fa fa-info-circle" aria-hidden="true"></i></a></span></p>{% endif %}
-<p><label>{%trans "State:"%}</label> <span class='value'>{% if item.is_active %}{%trans "Active file"%}</span></p>
-{% else %}{%trans "Closed operation"%}</span></p>
-{% if item.closing.date %}<p><label>{%trans "Closing date:"%}</label> <span class='value'>{{ item.closing.date }} <strong>{%trans "by" %}</strong> {{ item.closing.user }}</span></p>{% endif %}
-{% endif %}
-{% field "Report delivery date" item.report_delivery_date %}
-{% field "Report processing" item.report_processing %}
-<p><label>{%trans "Type:"%}</label> <span class='value'>{{ item.operation_type }}</span></p>
-{% if item.surface %}<p><label>{%trans "Surface:"%}</label> <span class='value'>{{ item.surface }} m<sup>2</sup> ({{ item.surface_ha }} ha)</span></p>{% endif %}
-{% if item.cost %}<p><label>{%trans "Cost:"%}</label> <span class='value'>{{ item.cost }} &euro;{% if item.cost_by_m2 %}, ({{ item.cost_by_m2 }} &euro;/m<sup>2</sup>){%endif%}</span></p>{%endif%}
-{% if item.duration %}<p><label>{%trans "Duration:"%}</label> <span class='value'>{{ item.duration }} {%trans "Day"%}s</span></p>{%endif%}
-
-{% field_multiple "Remains" item.remains %}
-{% field_multiple "Periods" item.periods %}
-
-{% if item.QUALITY_DICT %}
-{% field "Record quality" item.record_quality|from_dict:item.QUALITY_DICT %}
+{% if not item.code_patriarche %}
+<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> {%trans "Patriarche OA code not yet recorded!"%}</p>
{% endif %}
-{% if item.history_object and item.history_object.QUALITY_DICT %}
-{% field "Record quality" item.record_quality|from_dict:item.history_object.QUALITY_DICT %}
-{% endif %}
-
-{% field "Abstract" item.abstract %}
-{% if item.associated_file %}
-<p><label>{%trans "Associated file:"%}</label> <span class='value'><a href='#' onclick='load_window("{% url show-file item.associated_file.pk ''%}")'>{{ item.associated_file }}</a></span></p><!-- Displayed as Year/index/Commune/Common_name This should be a link to the file sheet of the related file -->
-{% if item.associated_file.is_preventive %}
-{#{% if item.operator_reference_code %}<p><label>{%trans "Operator's reference code:"%}</label> <span class='value'>{{ item.operator_reference_code }}</span></p>{% endif %}#}
-
-{% field "Responsible for town planning service" item.associated_file.responsible_town_planning_service.full_address %}
+<h3>{% trans "General"%}</h3>
+<ul class='form-flex'>
+{% field_li "Name" item.common_name %}
+{% field_li "Year" item.year %}
+{% field_li "Numerical reference" item.operation_code %}
+{% field_li "Code patriarche" item.code_patriarche 'OA' %}
+{% field_li "Old code" item.old_code %}
+<li><label>{%trans "Last modification date:"%}</label> <span class='value'>{% if item.history_date %}{{ item.history_date }}{% else %}{{ item.history.all.0.history_date }}{% endif %}</span></li> <!-- date = now -->
+{% field_li "Created by" item.history_creator.ishtaruser.full_label %}
+{% field_li "Begining date" item.start_date %}
+{% field_li "Excavation end date" item.excavation_end_date|default:"-" %}
+{% field_li_detail "Head scientist" item.scientist %}
+{% field_li_detail "In charge" item.in_charge %}
+{% field_li_detail "Operator" item.operator %}
+<li><label>{%trans "State:"%}</label> <span class='value'>{% if item.is_active %}{%trans "Active file"%}</span></p>
+{% else %}{%trans "Closed operation"%}</span></li> {% endif %}
+{% if item.closing.date %}<li><label>{%trans "Closing date:"%}</label> <span class='value'>{{ item.closing.date }} <strong>{%trans "by" %}</strong> {{ item.closing.user }}</span></li>{% endif %}
+{% field_li "Report delivery date" item.report_delivery_date %}
+{% field_li "Report processing" item.report_processing %}
+{% field_li "Type" item.operation_type %}
+{% if item.surface %}<li><label>{%trans "Surface:"%}</label> <span class='value'>{{ item.surface }} m<sup>2</sup> ({{ item.surface_ha }} ha)</span></li>{% endif %}
+{% if item.cost %}<li><label>{%trans "Cost:"%}</label> <span class='value'>{{ item.cost }} &euro;{% if item.cost_by_m2 %}, ({{ item.cost_by_m2 }} &euro;/m<sup>2</sup>){%endif%}</span></li>{%endif%}
+{% if item.duration %}<li><label>{%trans "Duration:"%}</label> <span class='value'>{{ item.duration }} {%trans "Day"%}s</span></li>{%endif%}
+{% field_li_multiple "Remains" item.remains %}
+{% field_li_multiple "Periods" item.periods %}
+{% if item.QUALITY_DICT %}{% field_li "Record quality" item.record_quality|from_dict:item.QUALITY_DICT %}{% endif %}
+{% if item.history_object and item.history_object.QUALITY_DICT %}{% field_li "Record quality" item.record_quality|from_dict:item.history_object.QUALITY_DICT %}{% endif %}
+{% field_li "Abstract" item.abstract %}
+{% field_li_detail "Associated file" item.associated_file %}
+{% field_li "Responsible for town planning service" item.associated_file.responsible_town_planning_service.full_address %}
{% if item.associated_file.town_planning_service %}
- {% field "Town planning service organization" item.associated_file.town_planning_service.full_address %}
+ {% field_li "Town planning service organization" item.associated_file.town_planning_service.full_address %}
{% else %}
- {% field "Town planning service organization" item.associated_file.responsible_town_planning_service.attached_to.full_address %}
+ {% field_li "Town planning service organization" item.associated_file.responsible_town_planning_service.attached_to.full_address %}
{% endif %}
-
-{% if item.associated_file.permit_type %}<p><label>{%trans "Permit type:"%}</label> <span class='value'>{{ item.associated_file.permit_type }}</span></p>{% endif %}
-{% if item.associated_file.permit_reference %}<p><label>{%trans "Permit reference:"%}</label> <span class='value'>{{ item.associated_file.permit_reference }}</span></p>{% endif %}
-
-{% field "General contractor" item.associated_file.general_contractor.full_address %}
+{% field_li "Permit type" item.associated_file.permit_type %}
+{% field_li "Permit reference" item.associated_file.permit_reference %}
+{% field_li "General contractor" item.associated_file.general_contractor.full_address %}
{% if item.associated_file.corporation_general_contractor %}
- {% field "General contractor organization" item.associated_file.corporation_general_contractor.full_address %}
+ {% field_li "General contractor organization" item.associated_file.corporation_general_contractor.full_address %}
{% else%}
- {% field "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %}
-{% endif %}
-
-{% endif %}
+ {% field_li "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %}
{% endif %}
-
-{% field "Comment" item.comment "<pre>" "</pre>" %}
+{% field_li "Comment" item.comment "<pre>" "</pre>" %}
+</ul>
{% if item.towns.count %}
<h3>{% trans "Localisation"%}</h3>
-<p><label>{%trans "Towns:"%}</label> <span class='value'>{{ item.towns.all|join:", " }}</span></p>
+<ul class='form-flex'>
+{% field_li_multiple "Towns" item.towns %}
+{% field_li "Main address" item.associated_file.address %}
+{% field_li "Complement" item.associated_file.address_complement %}
+{% field_li "Postal code" item.associated_file.postal_code %}
+</ul>
{% endif %}
-{% if item.associated_file.address %}<p><label>{%trans "Main address:"%}</label> <span class='value'>{{ item.associated_file.address }}</span></p>
-{% if item.associated_file.address_complement %}<p><label>{%trans "Complement:"%}</label> <span class='value'>{{ item.associated_file.address_complement }}</span></p>{%endif%}
-{% if item.associated_file.postal_code %}<p><label>{%trans "Postal code:"%}</label> <span class='value'>{{ item.associated_file.postal_code }}</span></p>{%endif%}
-{%endif%}
-{% comment %}
-<p><label>{%trans "Lambert X:"%}</label> <span class='value'>{{ item.lambert_x }}</span></p>
-<p><label>{%trans "Lambert Y:"%}</label> <span class='value'>{{ item.lambert_y }}</span></p>
-<p><label>{%trans "Altitude (m NGF):"%}</label> <span class='value'>{{ item.altitude }}</span></p>
-{% endcomment %}
-
{% if item.right_relations.count %}
<h3>{% trans "Relations"%}</h3>
{% for rel in item.right_relations.all %}
@@ -130,8 +89,8 @@
{% include "ishtar/blocks/window_tables/parcels.html" %}
{% if item.administrative_act %}
-{% trans "Administrative acts" as administrativeacts_label %}
-{% table_administrativact administrativeacts_label item.administrative_act.all %}
+<h3>{% trans "Administrative acts" %}</h3>
+{% table_administrativact "" item.administrative_act.all %}
{% endif %}
{% trans "Document from this operation" as operation_docs %}
@@ -139,9 +98,9 @@
{% dynamic_table_document operation_docs 'operation_docs' 'operation' item.pk '' output %}
{% endif %}
-{% trans "Context records" as context_records %}
{% if item.context_record.count %}
-{% dynamic_table_document context_records 'context_records_for_ope' 'operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
+<h3>{% trans "Context records" %}</h3>
+{% dynamic_table_document '' 'context_records_for_ope' 'operation' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
{% trans "Documents from associated context records" as cr_docs %}
@@ -159,4 +118,91 @@
{% dynamic_table_document finds_docs 'finds_docs' 'find__base_finds__context_record__operation' item.pk '' output %}
{% endif %}
+<h3>{% trans "Statistics" %}</h3>
+
+<h4>{% trans "Administrative acts" %}</h4>
+<ul class='form-flex'>
+{% field_li "Number of administrative acts" item.nb_acts %}
+{% field_li "Number of indexed administrative acts" item.nb_indexed_acts %}
+</ul>
+
+<h4>{% trans "Context records" %}</h4>
+<ul class='form-flex'>
+{% field_li "Number of context records" item.nb_context_records %}
+</ul>
+<ul class='form-flex'>
+{% if item.nb_context_records_by_type %}
+<li><table class='clean-table small'>
+ <tr><th>{% trans "Type" %}</th><th>{% trans "Number" %}</th></tr>
+{% for label, nb in item.nb_context_records_by_type %}
+ <tr><td>{{label}}</td><td>{{nb}}</td></tr>
+{% endfor %}
+</table></li>
+{% endif %}
+{% if item.nb_context_records_by_periods %}
+<li><table class='clean-table small'>
+ <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr>
+{% for label, nb in item.nb_context_records_by_periods %}
+ <tr><td>{{label}}</td><td>{{nb}}</td></tr>
+{% endfor %}
+</table></li>
+{% endif %}
+</ul>
+
+<h4>{% trans "Finds" %}</h4>
+<ul class='form-flex'>
+{% field_li "Number of finds" item.nb_finds %}
+</ul>
+<ul class='form-flex'>
+{% if item.nb_finds_by_material_type %}
+<li><table class='clean-table small'>
+ <tr><th>{% trans "Material type" %}</th><th>{% trans "Number" %}</th></tr>
+{% for label, nb in item.nb_finds_by_material_type %}
+ <tr><td>{{label}}</td><td>{{nb}}</td></tr>
+{% endfor %}
+</table></li>
+{% endif %}
+{% if item.nb_finds_by_types %}
+<li><table class='clean-table small'>
+ <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>
+{% endfor %}
+</table></li>
+{% endif %}
+{% if item.nb_finds_by_periods %}
+<li><table class='clean-table small'>
+ <tr><th>{% trans "Period" %}</th><th>{% trans "Number" %}</th></tr>
+{% for label, nb in item.nb_finds_by_periods %}
+ <tr><td>{{label}}</td><td>{{nb}}</td></tr>
+{% endfor %}
+</table></li>
+{% endif %}
+</ul>
+
+<h4>{% trans "Sources" %}</h4>
+<ul class='form-flex'>
+{% field_li "Number of sources" item.nb_documents %}
+</ul>
+<ul class='form-flex'>
+{% if item.nb_documents_by_types %}
+<li><table class='clean-table small'>
+ <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>
+{% endfor %}
+</table></li>
+{% endif %}
+</ul>
+
+{% if item.nb_stats_finds_by_ue %}
+<h4>{% trans "Finds by context records" %}</h4>
+<ul class='form-flex'>
+{% field_li "Mean" item.nb_stats_finds_by_ue.mean %}
+{% field_li "Min" item.nb_stats_finds_by_ue.min %}
+{% field_li "Max" item.nb_stats_finds_by_ue.max %}
+{% field_li "Mode" item.nb_stats_finds_by_ue.mode %}
+</ul>
+{% endif %}
+
{% endblock %}