From 1802bffb4d452550e9349875aeee81db8d030b44 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 14 Feb 2019 06:08:16 +0100 Subject: Sheets (operations, site, context records and finds): display small map --- .../templates/ishtar/sheet_contextrecord.html | 11 ++++-- .../templates/ishtar/sheet_basefind.html | 22 +++--------- .../templates/ishtar/sheet_site.html | 40 +++++++++++----------- .../templates/ishtar/blocks/sheet_coordinates.html | 17 +++++++++ 4 files changed, 50 insertions(+), 40 deletions(-) create mode 100644 ishtar_common/templates/ishtar/blocks/sheet_coordinates.html diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index d53dbcc6b..0e3138583 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -150,10 +150,15 @@

{% trans "Localisation"%}

-
- {% field_flex_multiple "Towns" item.operation.towns %} - {% field_flex_detail "Operation" item.operation %} + {% with geo_item=item %} + {% include "ishtar/blocks/sheet_simple_map.html"%} +
+ {% field_flex_multiple_full "Towns" item.operation.towns %} + {% field_flex_detail_full "Operation" item.operation %} + {% include "ishtar/blocks/sheet_coordinates.html"%} +
+ {% endwith %}
{% else %} diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html index fa96ddf0e..aa41ee34b 100644 --- a/archaeological_finds/templates/ishtar/sheet_basefind.html +++ b/archaeological_finds/templates/ishtar/sheet_basefind.html @@ -65,27 +65,15 @@
{% endif %} -

{% trans "Map"%}

+

{% trans "Localisation"%}

{% with geo_item=base_find %} {% include "ishtar/blocks/sheet_simple_map.html"%} +
+ {% include "ishtar/blocks/sheet_coordinates.html"%} + {% field_flex_full "Point of topographic reference" base_find.topographic_localisation %} +
{% endwith %} - {% field_flex "Point of topographic reference" base_find.topographic_localisation %} -
-
{% trans "Coordinates" %}
-
- {% 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 %} - {% endif %} -
-
{% endif %} diff --git a/archaeological_operations/templates/ishtar/sheet_site.html b/archaeological_operations/templates/ishtar/sheet_site.html index 14c30bd38..a293cb10b 100644 --- a/archaeological_operations/templates/ishtar/sheet_site.html +++ b/archaeological_operations/templates/ishtar/sheet_site.html @@ -40,26 +40,6 @@ {% field_flex_full "Comment" item.comment "
" "
" %} -{% if next %} -{% if item|m2m_listing:'towns' or item.locality_ngi or item.locality_cadastral %} -

{% trans "Localisation"%}

-
- {% field_flex_full "Towns" item|m2m_listing:'towns'|join:" ; " %} - {% field_flex_full "National Geographic Institute locality" item.locality_ngi "
" "
" %} - {% field_flex_full "Cadastral locality" item.locality_cadastral "
" "
" %} -
-{% endif %} -{% else %} -{% if item.towns.count or item.locality_ngi or item.locality_cadastral %} -

{% trans "Localisation"%}

-
- {% field_flex_full "Towns" item.towns_codes|join:" ; " %} - {% field_flex_full "National Geographic Institute locality" item.locality_ngi "
" "
" %} - {% field_flex_full "Cadastral locality" item.locality_cadastral "
" "
" %} -
-{% endif %} -{% endif %} - {% if item.affmar_number or item.drassm_number or item.oceanographic_service_localisation or item.shipwreck_code or item.sinking_date or item.discovery_area or item.shipwreck_name %}

{% trans "Underwater"%}

@@ -74,6 +54,26 @@ {% endif %} +{% if item.x or item.towns.count or item|m2m_listing:'towns' or item.locality_ngi or item.locality_cadastral %} +

{% trans "Localisation"%}

+
+ {% with geo_item=item %} + {% include "ishtar/blocks/sheet_simple_map.html"%} + +
+ {% include "ishtar/blocks/sheet_coordinates.html"%} + {% if next %} + {% field_flex_full "Towns" item|m2m_listing:'towns'|join:" ; " %} + {% else %} + {% field_flex_full "Towns" item.towns_codes|join:" ; " %} + {% endif %} + {% field_flex_full "National Geographic Institute locality" item.locality_ngi "
" "
" %} + {% field_flex_full "Cadastral locality" item.locality_cadastral "
" "
" %} +
+ {% endwith %} +
+{% endif %} + {% include "ishtar/blocks/sheet_json.html" %} {% trans "Operations" as operations %} diff --git a/ishtar_common/templates/ishtar/blocks/sheet_coordinates.html b/ishtar_common/templates/ishtar/blocks/sheet_coordinates.html new file mode 100644 index 000000000..c29f7de61 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/sheet_coordinates.html @@ -0,0 +1,17 @@ +{% load i18n %}{% if geo_item.x or geo_item.y or geo_item.z %} +
+
{% trans "Coordinates" %}
+
+ {% trans "X:"%} {{geo_item.x|default_if_none:"-"}} + {% if geo_item.estimated_error_x %} ({% trans "error:" %} {{geo_item.estimated_error_x}}){% endif %}, + {% trans "Y:"%} {{geo_item.y|default_if_none:"-"}}, + {% if geo_item.estimated_error_y %} ({% trans "error:" %} {{geo_item.estimated_error_y}}){% endif %}, + {% trans "Z:"%} {{geo_item.z|default_if_none:"-"}} + {% if geo_item.estimated_error_z %} ({% trans "error:" %} {{geo_item.estimated_error_z}}){% endif %} + {% if geo_item.spatial_reference_system %} + – {{geo_item.spatial_reference_system.label}}{% if geo_item.spatial_reference_system.srid %} - + {% trans "SRID"%} {{geo_item.spatial_reference_system.srid}}{% endif %} + {% endif %} +
+
+{% endif %} -- cgit v1.2.3