From 2b2935ccf265216a33345c2fd953c205ce143827 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 24 Apr 2023 17:30:07 +0200 Subject: Sheet area --- ishtar_common/templates/ishtar/sheet_area.html | 129 +++++++++++++++++++++ ishtar_common/templates/ishtar/sheet_area_pdf.html | 14 +++ .../templates/ishtar/sheet_area_window.html | 3 + ishtar_common/templates/ishtar/sheet_town.html | 23 ++-- 4 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 ishtar_common/templates/ishtar/sheet_area.html create mode 100644 ishtar_common/templates/ishtar/sheet_area_pdf.html create mode 100644 ishtar_common/templates/ishtar/sheet_area_window.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/sheet_area.html b/ishtar_common/templates/ishtar/sheet_area.html new file mode 100644 index 000000000..8c343f9aa --- /dev/null +++ b/ishtar_common/templates/ishtar/sheet_area.html @@ -0,0 +1,129 @@ +{% extends "ishtar/sheet.html" %} +{% load i18n ishtar_helpers window_tables window_header window_field from_dict link_to_window %} + +{% block head_title %}{% trans "Area" %} - {{item.name}}{% if item.reference %} ({{item.reference}}){% endif %}{% endblock %} + +{% block toolbar %} +{% window_nav item window_id 'show-area' %} +{% endblock %} + +{% block content %} + +{# trick to set to null non existing variable #} +{% with permission_view_document=permission_view_document %} +{% with permission_view_own_document=permission_view_own_document %} +{% with permission_change_own_geovectordata=permission_change_own_geovectordata %} +{% with permission_change_geovectordata=permission_change_geovectordata %} + +{% with permission_change_geo=permission_change_own_geovectordata|or_:permission_change_geovectordata %} + +{% with perm_documents=permission_view_own_document|or_:permission_view_document %} +{% with has_documents=item|safe_or:"documents.count|documents_list" %} +{% with display_documents=perm_documents|and_:has_documents %} + +{% if output != "ODT" and output != "PDF" %} + +{% endif %} + +
+
+ +
+
+ {% include "ishtar/blocks/window_image.html" %} +
+
+
+ {% if item.reference %} + {{ item.reference }}{% endif %} +
+
+
+

{{item.name}}

+
+
+
+ +
+
+
{% trans "Towns" %}
+
{% for town in item.towns.all %}{% if forloop.counter0 %} ; {% endif %}{{town}}{{town|simple_link_to_window}}{% endfor %}
+
+ {% with has_image=item.images.count %} + {% if not has_image %} +
+
+ {% endif %} + {% if has_image %} +
{#
#} + {% endif %} + {% endwith %} +
+ {% comment %} + {% if PROFILE.mapping and geo_item.main_geodata %} +

{% trans "Geographic localisation" %}

+
+ {% with geo_item=item %} + {% include "ishtar/blocks/sheet_map.html"%} + {% endwith %} +
+ {% endif %} + {% endcomment %} + + {% if display_documents and item.documents.count %} + {% trans "Documents" as area_docs %} + {% dynamic_table_document area_docs 'documents' 'areas' item.pk '' output %} + {% endif %} + +
+ {% if not is_external and SHOW_GEO %} +
+ {% with geo_item=item %}{% include "ishtar/blocks/sheet_geographic.html" %}{% endwith %} +
+ {% endif %} + + + + + + +{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} + +{% endblock %} \ No newline at end of file diff --git a/ishtar_common/templates/ishtar/sheet_area_pdf.html b/ishtar_common/templates/ishtar/sheet_area_pdf.html new file mode 100644 index 000000000..fd5dd223c --- /dev/null +++ b/ishtar_common/templates/ishtar/sheet_area_pdf.html @@ -0,0 +1,14 @@ +{% extends "ishtar/sheet_area.html" %} +{% block header %} +{% endblock %} +{% block main_head %} +{{ block.super }} +
+Ishtar – {{APP_NAME}} – {{item}} +
+{% endblock %} +{%block head_sheet%}{%endblock%} +{%block main_foot%} + + +{%endblock%} diff --git a/ishtar_common/templates/ishtar/sheet_area_window.html b/ishtar_common/templates/ishtar/sheet_area_window.html new file mode 100644 index 000000000..407a6b817 --- /dev/null +++ b/ishtar_common/templates/ishtar/sheet_area_window.html @@ -0,0 +1,3 @@ +{% extends "ishtar/sheet_area.html" %} +{% block main_head %}{%endblock%} +{% block main_foot %}{%endblock%} diff --git a/ishtar_common/templates/ishtar/sheet_town.html b/ishtar_common/templates/ishtar/sheet_town.html index 425effd8b..2b0cf6e4b 100644 --- a/ishtar_common/templates/ishtar/sheet_town.html +++ b/ishtar_common/templates/ishtar/sheet_town.html @@ -1,5 +1,5 @@ {% extends "ishtar/sheet.html" %} -{% load i18n ishtar_helpers window_tables window_header window_field from_dict %} +{% load i18n ishtar_helpers window_tables window_header window_field from_dict link_to_window %} {% block head_title %}{% trans "Town" %} - {{item.name}}{% if item.numero_insee %} ({{item.numero_insee}}){% endif %}{% endblock %} @@ -51,13 +51,12 @@ {% include "ishtar/blocks/window_image.html" %}
-
+
{% if item.numero_insee %} - {{ item.numero_insee }}{% endif %} + {{ item.numero_insee }}{% endif %}
-
+

{{item.name}}

@@ -65,29 +64,37 @@
{% if item.surface %} -
-
{%trans "Surface"%}
+
+
{% trans "Surface" %}
{{ item.surface }} m2 ({{ item.surface_ha }} ha)
{% endif %} + {% if item.areas.count %} +
+
{% trans "Areas" %}
+
{% for area in item.areas.all %}{% if forloop.counter0 %} ; {% endif %}{{area}}{{area|simple_link_to_window}}{% endfor %}
+
+ {% endif %} {% with has_image=item.images.count %} {% if not has_image %}
{% endif %} {% if has_image %} -
{#
#} +
{% endif %} {% endwith %}
+ {% if PROFILE.mapping and geo_item.main_geodata %}

{% trans "Geographic localisation" %}

{% with geo_item=item %} {% include "ishtar/blocks/sheet_map.html"%} {% endwith %}
+ {% endif %} {% if display_documents and item.documents.count %} {% trans "Documents" as town_docs %} -- cgit v1.2.3