From ebe47cf4d963caf5f765509eec7b6e80a42a084b Mon Sep 17 00:00:00 2001
From: Étienne Loks
Date: Wed, 7 Sep 2016 12:46:34 +0200
Subject: Display a message to warn about related items and history - many
improvment on sheet layout
---
archaeological_context_records/forms.py | 10 ++-
archaeological_context_records/models.py | 2 +-
.../templates/ishtar/sheet_contextrecord.html | 96 +++++++++++-----------
.../templates/ishtar/sheet_file.html | 8 +-
.../templates/ishtar/sheet_operation.html | 7 +-
ishtar_common/static/media/style.css | 17 +++-
.../templates/ishtar/blocks/window_nav.html | 3 +
version.py | 2 +-
8 files changed, 84 insertions(+), 61 deletions(-)
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index daaf5f5ed..d468e3a3c 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -138,10 +138,12 @@ class RecordFormGeneral(ManageOldType, forms.Form):
validators=[validators.MaxLengthValidator(200)])
description = forms.CharField(label=_(u"Description"),
widget=forms.Textarea, required=False)
- length = forms.IntegerField(label=_(u"Length (m)"), required=False)
- width = forms.IntegerField(label=_(u"Width (m)"), required=False)
- thickness = forms.IntegerField(label=_(u"Thickness (m)"), required=False)
- depth = forms.IntegerField(label=_(u"Depth (m)"), required=False)
+ comment = forms.CharField(label=_(u"General comment"),
+ widget=forms.Textarea, required=False)
+ length = forms.FloatField(label=_(u"Length (m)"), required=False)
+ width = forms.FloatField(label=_(u"Width (m)"), required=False)
+ thickness = forms.FloatField(label=_(u"Thickness (m)"), required=False)
+ depth = forms.FloatField(label=_(u"Depth (m)"), required=False)
unit = forms.ChoiceField(label=_("Unit"), required=False, choices=[])
location = forms.CharField(
label=_(u"Location"), widget=forms.Textarea,
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 637c386f0..a98f7792a 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -131,7 +131,7 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
related_name='context_record')
label = models.CharField(_(u"ID"), max_length=200)
description = models.TextField(_(u"Description"), blank=True, null=True)
- comment = models.TextField(_(u"Comment"), blank=True, null=True)
+ comment = models.TextField(_(u"General comment"), blank=True, null=True)
opening_date = models.DateField(_(u"Date d'ouverture"),
blank=True, null=True)
closing_date = models.DateField(_(u"End date"), blank=True, null=True)
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index 493a00f1b..2c2bf98fe 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -10,49 +10,50 @@
{% endif%}
-{% if item.operation.code_patriarche %}
-
-{% else %}
-
-
-{%endif%}
-{{item.full_label}}
- {{ item.creation_date }}
- {{ item.history_creator.ishtaruser.full_label }}
-{%if item.unit %}
- {{ item.unit }}
-{%endif%}
- {{ item.datings.all|join:", " }}
+
{% field "Comment on datings" item.datings_comment "" "
" %}
- {{ item.parcel.town }}
- {{ item.parcel.short_label }}
{% if item.description or item.lenght or item.width or item.depth or item.thickness or item.comment %}
{% trans "Description"%}
-
- {{ item.description }}
-{% if item.comment %} {{ item.comment }}
{% endif %}
-{% if item.lenght %} {{ item.length }}
{%endif%}
-{% if item.width %} {{ item.width }}
{%endif%}
-{% if item.depth %} {{ item.depth }}
{%endif%}
-{% if item.width %} {{ item.thickness }}
{%endif%}
+{% field "Description" item.description "" "
" %}
+{% field "Comment" item.comment "" "
" %}
+
{% endif %}
{% if item.activity or item.identification or item.interpretation %}
{% trans "Interpretation"%}
-{% if item.activity %} {{ item.activity }}
{%endif%}
-{% if item.identification %} {{ item.identification }}
{%endif%}
-{% if item.interpretation %} {{ item.interpretation }}
{%endif%}
+
+{% field "Filling" item.filling "" "
" %}
+{% field "Interpretation" item.interpretation "" "
" %}
{% endif %}
{% if item.taq or item.taq_estimated or item.tpq or item.tpq_estimated %}
{% trans "Datations"%}
-{% if item.taq %} {{ item.taq }}
{%endif%}
-{% if item.taq_estimated %} {{ item.taq_estimated }}
{%endif%}
-{% if item.tpq %} {{ item.tpq }}
{%endif%}
-{% if item.tpq_estimated %} {{ item.tpq_estimated }}
{%endif%}
-{%endif%}
+
+{% endif %}
{% if item.right_relations.count %}
{% trans "In relation with"%}
@@ -86,33 +87,28 @@
{% if item.operation %}
{% trans "Operation summary"%}
- {{ item.operation.year }}
-{% field "Numerical reference" item.operation.operation_code %}
-{% if item.operation.code_patriarche %}
-
-{{ item.operation.code_patriarche }}
-{% else %}
-{%endif%}
-{#{{ item.operation.internal_reference }}
#}
-{% if item.operation.scientist %} {{ item.operation.scientist.full_label }}
{%endif%}
-
-{% if item.operation.is_active %}
-{%trans "Active file"%}
-{% else %}
-{%trans "Closed operation"%}
- {{ item.operation.closing.date }}
-{%trans "by" %} {{ item.operation.closing.user }}
+{% if not item.operation.code_patriarche %}
+
+{% endif %}
+
{% field "Comment" item.operation.comment "" "
" %}
{% trans "Localisation"%}
{{ item.operation.towns.all|join:", " }}
{{ item.operation }}
-{# TODO: Displayed as Year/index/Commune/Common_name This should be a link to the file sheet of the related operation #}
{% else %}
{% endif %}
diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html
index 9c42c8f76..5165a0425 100644
--- a/archaeological_files/templates/ishtar/sheet_file.html
+++ b/archaeological_files/templates/ishtar/sheet_file.html
@@ -9,7 +9,7 @@
{% window_file_nav item window_id previous next %}
{% else %}
{% window_nav item window_id 'show-file' 'file_modify' 'show-historized-file' 'revert-file' previous next %}
-{%endif%}
+{% endif %}
{% trans "General"%}
@@ -43,8 +43,8 @@
{% if item.related_file %} {{ item.related_file }}{% endif %}
-{% field_li "Comment" item.comment "" "
" %}
+{% field "Comment" item.comment "" "
" %}
{% trans "Localisation"%}
{% if item.towns.count %} {{ item.towns.all|join:", " }}
{% endif %}
@@ -100,6 +100,8 @@
{% endif %}
+{% if not next %}
+
{% trans "Associated parcels" as parcels_label %}
{% include "ishtar/blocks/window_tables/parcels.html" %}
@@ -159,4 +161,6 @@
+
+{% endif %}
{% endblock %}
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 1b2a1961d..ba63dfa1c 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -44,7 +44,6 @@
{% 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 %}
@@ -60,9 +59,11 @@
{% else%}
{% field_li "General contractor organization" item.associated_file.general_contractor.attached_to.full_address %}
{% endif %}
-{% field_li "Comment" item.comment "" "
" %}
+{% field "Abstract" item.abstract "" "
" %}
+{% field "Comment" item.comment "" "
" %}
+{% if not next %}
{% if item.towns.count %}
{% trans "Localisation"%}
{% endif %}
+{% endif %}
+
{% endblock %}
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css
index c6a151dc8..beff03393 100644
--- a/ishtar_common/static/media/style.css
+++ b/ishtar_common/static/media/style.css
@@ -163,6 +163,14 @@ h4{
margin:10px 0;
}
+pre {
+ padding: 0.5em 1em;
+ white-space: pre-wrap;
+ white-space: -moz-pre-wrap;
+ white-space: -pre-wrap;
+ white-space: -o-pre-wrap;
+}
+
select{
max-width:550px;
}
@@ -621,7 +629,6 @@ ul.form-flex li li label {
padding:0.2em;
margin-left:auto;
margin-right:auto;
- width:600px;
background-color:#F1F2F6;
}
@@ -1090,13 +1097,21 @@ p.alert{
color:#D14;
}
+p.info-box{
+ color: #1c94c4;
+}
+
div.form p.alert{
background-color:#FFF;
}
+#window p.info-box,
#window p.alert{
background-color:#EEE;
+ padding: 6px 16px;
padding-left: 30px;
+ width: auto;
+ margin: 6px 10px;
}
#window p.alert label{
diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html
index c225a5822..13069b1eb 100644
--- a/ishtar_common/templates/ishtar/blocks/window_nav.html
+++ b/ishtar_common/templates/ishtar/blocks/window_nav.html
@@ -45,3 +45,6 @@
ODT PDF
+{% if next %}
+ {% trans "Relation between items are not historized." %}
+{% endif %}
diff --git a/version.py b/version.py
index 91c10f4b1..a60a5fe30 100644
--- a/version.py
+++ b/version.py
@@ -1,4 +1,4 @@
-VERSION = (0, 97, 7)
+VERSION = (0, 97, 7, 1)
def get_version():
--
cgit v1.2.3