summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/sheet_town.html
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/templates/ishtar/sheet_town.html')
-rw-r--r--ishtar_common/templates/ishtar/sheet_town.html127
1 files changed, 127 insertions, 0 deletions
diff --git a/ishtar_common/templates/ishtar/sheet_town.html b/ishtar_common/templates/ishtar/sheet_town.html
new file mode 100644
index 000000000..425effd8b
--- /dev/null
+++ b/ishtar_common/templates/ishtar/sheet_town.html
@@ -0,0 +1,127 @@
+{% extends "ishtar/sheet.html" %}
+{% load i18n ishtar_helpers window_tables window_header window_field from_dict %}
+
+{% block head_title %}<strong>{% trans "Town" %}</strong> - {{item.name}}{% if item.numero_insee %} ({{item.numero_insee}}){% endif %}{% endblock %}
+
+{% block toolbar %}
+{% window_nav item window_id 'show-town' %}
+{% 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" %}
+<ul class="nav nav-tabs" id="{{window_id}}-tabs" role="tablist">
+ <li class="nav-item">
+ <a class="nav-link active" id="{{window_id}}-general-tab"
+ data-toggle="tab" href="#{{window_id}}-general" role="tab"
+ aria-controls="{{window_id}}-general" aria-selected="false">
+ {% trans "General" %}
+ </a>
+ </li>
+ {% if not is_external and SHOW_GEO %}
+ <li class="nav-item">
+ <a class="nav-link" id="{{window_id}}-geodata-tab"
+ data-toggle="tab" href="#{{window_id}}-geodata" role="tab"
+ aria-controls="{{window_id}}-geodata" aria-selected="false">
+ {% trans "Geographic data" %}
+ </a>
+ </li>
+ {% endif %}
+</ul>
+{% endif %}
+
+<div class="tab-content" id="{{window_id}}-tab-content">
+ <div class="tab-pane fade show active" id="{{window_id}}-general"
+ role="tabpanel" aria-labelledby="{{window_id}}-general-tab">
+
+ <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">
+ <div class="row">
+ <div class="col main">
+ {% if item.numero_insee %}
+ <strong>{{ item.numero_insee }}</strong
+ >{% endif %}
+ </div>
+ </div>
+ <div class="card-text">
+ <p class='window-refs' title="{% trans 'Name' %}">{{item.name}}</p>
+ </div>
+ </div>
+ </div>
+
+ <div class="row">
+ {% if item.surface %}
+ <dl class="col-12 col-md-6 col-lg-3 flex-wrap">
+ <dt>{%trans "Surface"%}</dt>
+ <dd>
+ {{ item.surface }} m<sup>2</sup> ({{ item.surface_ha }} ha)
+ </dd>
+ </dl>
+ {% endif %}
+ {% with has_image=item.images.count %}
+ {% if not has_image %}
+ </div>
+ </div>
+ {% endif %}
+ {% if has_image %}
+ </div> {# <div> #}
+ {% endif %}
+ {% endwith %}
+ <hr class="clearfix">
+ <h3>{% trans "Geographic localisation" %}</h3>
+ <div class="row">
+ {% with geo_item=item %}
+ {% include "ishtar/blocks/sheet_map.html"%}
+ {% endwith %}
+ </div>
+
+ {% if display_documents and item.documents.count %}
+ {% trans "Documents" as town_docs %}
+ {% dynamic_table_document town_docs 'documents' 'towns' item.pk '' output %}
+ {% endif %}
+
+ </div>
+ {% if not is_external and SHOW_GEO %}
+ <div class="tab-pane fade" id="{{window_id}}-geodata"
+ role="tabpanel" aria-labelledby="{{window_id}}-geodata-tab">
+ {% with geo_item=item %}{% include "ishtar/blocks/sheet_geographic.html" %}{% endwith %}
+ </div>
+ {% endif %}
+
+</div>
+
+
+<script type="text/javascript">
+$(document).ready( function () {
+ datatable_options = {
+ "dom": 'ltip',
+ };
+ $.extend(datatable_options, datatables_static_default);
+ if (datatables_i18n) datatable_options['language'] = datatables_i18n;
+ $('.datatables').each(
+ function(){
+ var dt_id = "#" + $(this).attr('id');
+ if (! $.fn.DataTable.isDataTable(dt_id) ) {
+ $(dt_id).DataTable(datatable_options);
+ }
+ });
+} );
+</script>
+
+{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %}
+
+{% endblock %} \ No newline at end of file