diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-07 12:46:34 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-07 12:46:34 +0200 |
commit | 4b59390d44c62bacf230502e685ebe3fe3213675 (patch) | |
tree | e739aa2aa9e518ff453cfb40d64a6a8126b131bf | |
parent | 0226b621f5265825f78b56e0ffff1877fa174693 (diff) | |
download | Ishtar-4b59390d44c62bacf230502e685ebe3fe3213675.tar.bz2 Ishtar-4b59390d44c62bacf230502e685ebe3fe3213675.zip |
Display a message to warn about related items and history - many improvment on sheet layout
-rw-r--r-- | archaeological_context_records/forms.py | 10 | ||||
-rw-r--r-- | archaeological_context_records/models.py | 2 | ||||
-rw-r--r-- | archaeological_context_records/templates/ishtar/sheet_contextrecord.html | 96 | ||||
-rw-r--r-- | archaeological_files/templates/ishtar/sheet_file.html | 8 | ||||
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_operation.html | 7 | ||||
-rw-r--r-- | ishtar_common/static/media/style.css | 17 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_nav.html | 3 | ||||
-rw-r--r-- | 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 @@ <a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> {% endif%} -{% if item.operation.code_patriarche %} -<p><label>{%trans "Complete ID:"%}</label> -{% else %} -<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Patriarche OA code not yet recorded!"%}</label></p> -<p><label>{%trans "Temporary ID:"%}</label> -{%endif%} -<span class='value'>{{item.full_label}}</span></p> -<p><label>{%trans "Creation date:"%}</label> <span class='value'>{{ item.creation_date }}</span></p> -<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p> -{%if item.unit %} -<p><label>{% trans "Type:" %}</label> <span class='value'>{{ item.unit }}</span></p> -{%endif%} -<p><label>{% trans "Chronology:" %}</label> <span class='value'>{{ item.datings.all|join:", " }}</span></p> +<ul class='form-flex'> +<li><label>{% if item.operation.code_patriarche %}{%trans "Complete ID:"%}{% else %}{%trans "Temporary ID:"%}{% endif %}</label><span class='value'>{{item.full_label}}</span></li> +{% field_li "Creation date" item.creation_date %} +{% field_li "Created by" item.history_creator.ishtaruser.full_label %} +{% field_li "Type" item.unit %} +{% field_li_multiple "Chronology" item.datings %} +{% field_li "Town" item.parcel.town %} +{% field_li "Parcel" item.parcel.short_label %} +</ul> {% field "Comment on datings" item.datings_comment "<pre>" "</pre>" %} -<p><label>{% trans "Place:" %}</label> <span class='value'>{{ item.parcel.town }}</span></p> -<p><label>{% trans "Parcel:" %}</label> <span class='value'>{{ item.parcel.short_label }}</span></p> {% if item.description or item.lenght or item.width or item.depth or item.thickness or item.comment %} <h3>{% trans "Description"%}</h3> - -<p><label>{% trans "Description:" %}</label> <span class='value'>{{ item.description }}</span></p> -{% if item.comment %}<p><label>{% trans "Comment:" %}</label> <span class='value'>{{ item.comment }}</span></p>{% endif %} -{% if item.lenght %}<p><label>{% trans "Length (m):" %}</label> <span class='value'>{{ item.length }}</span></p>{%endif%} -{% if item.width %}<p><label>{% trans "Width (m):" %}</label> <span class='value'>{{ item.width }}</span></p>{%endif%} -{% if item.depth %}<p><label>{% trans "Depth (m):" %}</label> <span class='value'>{{ item.depth }}</span></p>{%endif%} -{% if item.width %}<p><label>{% trans "Thickness (m):" %}</label> <span class='value'>{{ item.thickness }}</span></p>{%endif%} +{% field "Description" item.description "<pre>" "</pre>" %} +{% field "Comment" item.comment "<pre>" "</pre>" %} +<ul class='form-flex'> +{% field_li "Length (m)" item.lenght %} +{% field_li "Width (m)" item.width %} +{% field_li "Depth (m)" item.depth %} +{% field_li "Thickness (m)" item.thickness %} +</ul> {% endif %} {% if item.activity or item.identification or item.interpretation %} <h3>{% trans "Interpretation"%}</h3> -{% if item.activity %}<p><label>{% trans "Activity:" %}</label> <span class='value'>{{ item.activity }}</span></p>{%endif%} -{% if item.identification %}<p><label>{% trans "Identification:" %}</label> <span class='value'>{{ item.identification }}</span></p>{%endif%} -{% if item.interpretation %}<p><label>{% trans "Interpretation:" %}</label> <span class='value'>{{ item.interpretation }}</span></p>{%endif%} +<ul class='form-flex'> +{% field_li "Activity" item.activity %} +{% field_li "Identification" item.identification %} +{% field_li "Has furniture?" item.has_furniture %} +</ul> +{% field "Filling" item.filling "<pre>" "</pre>" %} +{% field "Interpretation" item.interpretation "<pre>" "</pre>" %} {% endif %} {% if item.taq or item.taq_estimated or item.tpq or item.tpq_estimated %} <h3>{% trans "Datations"%}</h3> -{% if item.taq %}<p><label>{% trans "TAQ:" %}</label> <span class='value'>{{ item.taq }}</span></p>{%endif%} -{% if item.taq_estimated %}<p><label>{% trans "Estimated TAQ:" %}</label> <span class='value'>{{ item.taq_estimated }}</span></p>{%endif%} -{% if item.tpq %}<p><label>{% trans "TPQ:" %}</label> <span class='value'>{{ item.tpq }}</span></p>{%endif%} -{% if item.tpq_estimated %}<p><label>{% trans "Estimated TPQ:" %}</label> <span class='value'>{{ item.tpq_estimated }}</span></p>{%endif%} -{%endif%} +<ul class='form-flex'> +{% field_li "TAQ" item.taq %} +{% field_li "Estimated TAQ" item.taq_estimated %} +{% field_li "TPQ" item.tpq %} +{% field_li "Estimated TPQ" item.tpq_estimated %} +</ul> +{% endif %} {% if item.right_relations.count %} <h3>{% trans "In relation with"%}</h3> @@ -86,33 +87,28 @@ {% if item.operation %} <h3>{% trans "Operation summary"%}</h3> -<p><label>{%trans "Year:"%}</label> <span class='value'>{{ item.operation.year }}</span></p> -{% field "Numerical reference" item.operation.operation_code %} -{% if item.operation.code_patriarche %} -<p><label>{%trans "Patriarche OA code:"%}</label> -<span class='value'>{{ item.operation.code_patriarche }}</span></p> -{% else %}<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Patriarche OA code not yet recorded!"%}</label></p> -{%endif%} -{#<p><label>{%trans "Operation's name:"%}</label><span class='value'>{{ item.operation.internal_reference }}</span></p>#} -{% if item.operation.scientist %}<p><label>{%trans "Head scientist:"%}</label> <span class='value'>{{ item.operation.scientist.full_label }} <a href='#' onclick='load_window("{% url show-person item.operation.scientist.pk ''%}");'><i class="fa fa-info-circle" aria-hidden="true"></i></a></span></p>{%endif%} -<p><label>{%trans "State:"%}</label> -{% if item.operation.is_active %} -<span class='value'>{%trans "Active file"%}</span></p> -{% else %} -<span class='value'>{%trans "Closed operation"%}</span></p> -<p><label>{%trans "Closing date:"%}</label> <span class='value'>{{ item.operation.closing.date }} -<strong>{%trans "by" %}</strong> {{ item.operation.closing.user }}</span></p> +{% if not item.operation.code_patriarche %} +<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "Patriarche OA code not yet recorded!"%}</label></p> +{% endif %} +<ul class='form-flex'> +{% field_li "Year" item.operation.year %} +{% field_li "Numerical reference" item.operation.operation_code %} +{% field_li "Patriarche OA code" item.operation.code_patriarche %} +{% field_li_detail "Head scientist" item.operation.scientist %} +<li><label>{%trans "State:"%}</label><span class='value'>{% if item.operation.is_active %}{% trans "Active file" %}{% else %}{%trans "Closed operation" %}{% endif %}</span></li> +{% if not item.operation.is_active %} +<li><label>{%trans "Closing date:"%}</label> <span class='value'>{{ item.operation.closing.date }} <strong>{%trans "by" %}</strong> {{ item.operation.closing.user }}</span></li> {% endif %} -<p><label>{%trans "Type:"%}</label> <span class='value'>{{ item.operation.operation_type }}</span></p> -<p><label>{%trans "Remains:"%}</label> <span class='value'>{{ item.operation.remains.all|join:", " }}</span></p> -<p><label>{%trans "Periods:"%}</label> <span class='value'>{{ item.operation.periods.all|join:", " }}</span></p> +{% field_li "Type" item.operation.operation_type %} +{% field_li_multiple "Remains" item.operation.remains %} +{% field_li_multiple "Periods" item.operation.periods %} +</ul> {% field "Comment" item.operation.comment "<pre>" "</pre>" %} <h3>{% trans "Localisation"%}</h3> <p><label>{%trans "Towns:"%}</label> <span class='value'>{{ item.operation.towns.all|join:", " }}</span></p> <p><label>{%trans "Related operation:"%}</label> <span class='value'><a href="#" onclick='load_window("{% url show-operation item.operation.pk ''%}");'>{{ item.operation }}</a></span></p> -{# TODO: Displayed as Year/index/Commune/Common_name This should be a link to the file sheet of the related operation #} {% else %}<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "No operation linked to this context unit!"%}</label></p> {% 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 %} <h3>{% trans "General"%}</h3> @@ -43,8 +43,8 @@ {% if item.related_file %}<li><label>{%trans "Related file:"%}</label> <span class='value'><a href='#' onclick='load_window("{% url show-file item.related_file.pk ''%}")'>{{ item.related_file }}</a></span></li>{% endif %} -{% field_li "Comment" item.comment "<pre>" "</pre>" %} </ul> +{% field "Comment" item.comment "<pre>" "</pre>" %} <h3>{% trans "Localisation"%}</h3> {% if item.towns.count %}<p><label>{%trans "Towns:"%}</label> <span class='value'>{{ item.towns.all|join:", " }}</span></p>{% 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 @@ </table> </div> </div> + +{% 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 "<pre>" "</pre>" %} </ul> +{% field "Abstract" item.abstract "<pre>" "</pre>" %} +{% field "Comment" item.comment "<pre>" "</pre>" %} +{% if not next %} {% if item.towns.count %} <h3>{% trans "Localisation"%}</h3> <ul class='form-flex'> @@ -209,4 +210,6 @@ </ul> {% 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 @@ <a class='badge' href='{% url show_url item.pk "odt" %}' title='{% trans "Export as OpenOffice.org file"%}'>ODT</a> <a class='badge' href='{% url show_url item.pk "pdf" %}' title='{% trans "Export as PDF file"%}'>PDF</a> </div> <hr class='clear'> +{% if next %} + <p class='info-box'><i class="fa fa-info-circle" aria-hidden="true"></i> <em>{% trans "Relation between items are not historized." %}</em></p> +{% 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(): |