From e3be9f73db23550c651315ad00cba8f38c43e77d Mon Sep 17 00:00:00 2001
From: Étienne Loks
Date: Tue, 24 Oct 2017 10:57:00 +0200
Subject: UI: specific template for navbar
---
ishtar_common/static/js/ishtar.js | 6 +-
ishtar_common/static/media/styles.css | 6 +-
ishtar_common/templates/base.html | 65 +--------------
ishtar_common/templates/navbar.html | 59 +++++++++++++
ishtar_common/templates/sheet_ope.html | 146 ---------------------------------
5 files changed, 69 insertions(+), 213 deletions(-)
create mode 100644 ishtar_common/templates/navbar.html
delete mode 100644 ishtar_common/templates/sheet_ope.html
(limited to 'ishtar_common')
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 318c17315..215fa369b 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -195,8 +195,10 @@ $(document).ready(function(){
$('#to_bottom_arrow').hide();
$('#to_top_arrow').hide();
}
- $('#language_selector').change(function(){
- $('#language_form').submit();
+ $('#language-selector a').click(function(){
+ $('#language-selector input[name="language"]').val(
+ $(this).attr("data-lang"));
+ $('#language-form').submit();
});
load_shortcut_menu();
if ($.isFunction($(".prettyPhoto a").prettyPhoto)){
diff --git a/ishtar_common/static/media/styles.css b/ishtar_common/static/media/styles.css
index d0acf06f7..844d089b2 100644
--- a/ishtar_common/static/media/styles.css
+++ b/ishtar_common/static/media/styles.css
@@ -1,10 +1,14 @@
-
+/* colors */
small{
color: #666;
}
+#language-form{
+ display: none;
+}
+
/* à adapter */
#message,
#message div{
diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html
index 06322da04..ce383ba6c 100644
--- a/ishtar_common/templates/base.html
+++ b/ishtar_common/templates/base.html
@@ -48,70 +48,7 @@
{{raw_css |safe}}{% endif %}{% endcomment %}
-
+ {% include "navbar.html" %}
diff --git a/ishtar_common/templates/navbar.html b/ishtar_common/templates/navbar.html
new file mode 100644
index 000000000..acb606591
--- /dev/null
+++ b/ishtar_common/templates/navbar.html
@@ -0,0 +1,59 @@
+{% load i18n %}
+
+ {% block header %}
+
+
+
+
+
+
+
+ {% endblock %}
+
diff --git a/ishtar_common/templates/sheet_ope.html b/ishtar_common/templates/sheet_ope.html
deleted file mode 100644
index 1e18e8b7e..000000000
--- a/ishtar_common/templates/sheet_ope.html
+++ /dev/null
@@ -1,146 +0,0 @@
-{% extends "sheet.html" %}
-{% load i18n %}
-{% block content %}
-
-{% trans "General"%}
- {{ item.year }}
- {{ item.numeric_reference }}
-
-{% if item.patriarche_code %} {{ item.patriarche_code }}
{%endif%}
-{% if item.patriarche_code_not_recorded %}{%endif%}
-
- {{ item.internal_reference }}
-
- {{ item.history.all.0.history_date }}
-
- {{ item.begin_date }}
- {{ item.end_date }}
-
- {{ item.head_scientist.full_label }}
- {% if item.is_active %}{%trans "Active file"%}
-{% else %}{%trans "Closed operation"%}
- {{ item.closing.date }} {%trans "by" %} {{ item.closing.user }}
-{% endif %}
- {{ item.operation_type }}
- {{ item.total_surface }} m2 ({{ item.total_surface_ha }} ha)
- {{ item.cost }} Euros, ({{ item.cost_by_m2 }} Euros/m2)
- {{ item.duration }} {%trans "Day"%}s
-
- {{ item.remains.all|join:", " }}
- {{ item.periods.all|join:", " }}
-
-{% if item.related_file %}
- {{ item.related_file }}
-{% if item.related_file.is_preventive %}
-{% if item.operator_reference_code %} {{ item.operator_reference_code }}
{% endif %}
-{% if item.related_file.town_planning_service %} {{ item.related_file.town_planning_service }}
{% endif %}
-{% if item.related_file.permit_type %} {{ item.related_file.permit_type }}
{% endif %}
-{% if item.related_file.permit_reference %} {{ item.related_file.permit_reference }}
{% endif %}
-{% if item.related_file.general_contractor.attached_to %} {{ item.related_file.general_contractor.attached_to }}
{% endif %}
-{% if item.related_file.general_contractor %} {{ item.related_file.general_contractor.full_label }}
{% endif %}
-{% endif %}
-{% endif %}
-
-{% if item.comment %} {{ item.comment }}
{%endif%}
-
-{% trans "Localisation"%}
- {{ item.towns.all|join:", " }}
-
- {{ item.address }}
-{% if item.address_complement %} {{ item.address_complement }}
{%endif%}
-{% if item.postal_code %} {{ item.postal_code }}
{%endif%}
-
- {{ item.lambert_x }}
- {{ item.lambert_y }}
- {{ item.altitude }}
-
-
- {%trans "Associated parcels"%}
-
- | {% trans "Commune" %} |
- {% trans "Year" %} |
- {% trans "Section" %} |
- {% trans "Parcel" %} |
- {% trans "Owner" %} |
-
- {% for parcels in item.parcel.all %}
-
- | {{operation.commune}} |
- {{operation.year}} |
- {{operation.section}} |
- {{operation.parcel}} |
- {{operation.parcel.owner}} |
-
- {% empty %}
- | {% trans "No parcel associated to this operation" %} |
- {% endfor %}
-
-
-{% trans "Admninistrative acts"%}
-
- {%trans "Admninistrative acts"%}
-
- | {% trans "Year" %} |
- {% trans "Reference" %} |
- {% trans "Type" %} |
- {% trans "Date" %} |
-
- {% for act in item.administrative_act.all %}
-
- | {{act.signature_date.year}} |
- {{act.ref_sra}} |
- {{act.act_type}} |
- {{act.signature_date}} |
-
- {% empty %}
- | {% trans "No administrative act associated to this operation" %} |
- {% endfor %}
-
-
-{% trans "Documentation"%}
-
- {%trans "Documents"%}
-
- | {% trans "Title" %} |
- {% trans "Type" %} |
- {% trans "Authors" %} |
- {% trans "Localisation" %} |
-
- {% for doc in item.doc.all %}
-
- | {{ doc.title }} |
- {{doc.type}} |
- {{ doc.author.all|join:", " }} |
- {{ doc.localisation }} |
-
- {% empty %}
- | {% trans "No document associated to this operation" %} |
- {% endfor %}
-
-
-{% trans "Context Records"%}
-
- {%trans "Context Records"%}
-
- | {% trans "ID" %} |
- {% trans "Type" %} |
- {% trans "Chronology" %} |
- {% trans "Description" %} |
- {% trans "Parcel" %} |
- |
-
- {% for record_unit in item.record_unit.all %}
-
- | {{ record_unit.label }} |
- {{record_unit.unit_type}} |
- {{ record_unit.period.all|join:", " }} |
- {{ record_unit.description }} |
- {{ record_unit.section_and_parcel }} |
- {% trans "Details" %} |
-
- {% empty %}
- | {% trans "No context record associated to this operation" %} |
- {% endfor %}
-
-
-{% endblock %}
--
cgit v1.2.3