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 /archaeological_context_records | |
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
Diffstat (limited to 'archaeological_context_records')
-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 |
3 files changed, 53 insertions, 55 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 %} |