From f3cb91ccbaf0c90f74e99fffb8e2122bd1d0db0e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 17 Jan 2014 14:07:18 +0100 Subject: Improve ref display on administrativ acts (refs #1621) --- archaeological_operations/models.py | 14 ++++++++------ .../templates/ishtar/sheet_administrativeact.html | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index aa72d24ec..f705ce7be 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -446,12 +446,14 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): full_ref_lbl = _(u"Ref.") @property def full_ref(self): - keys = ['year', 'index'] - if settings.COUNTRY == 'fr': - keys.append('ref_sra') - return settings.JOINT.join( - [getattr(self, k) and unicode(getattr(self, k)) or '-' - for k in keys]) + lbl = [] + if self.year: + lbl.append(unicode(self.year)) + if self.index: + lbl.append(u"n°%d" %self.index) + if settings.COUNTRY == 'fr' and self.ref_sra: + lbl.append(u"[%s]" % self.ref_sra) + return u" ".join(lbl) @property def year(self): diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html index da80f6747..2cceb0222 100644 --- a/archaeological_operations/templates/ishtar/sheet_administrativeact.html +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html @@ -11,6 +11,7 @@

{% trans "General"%}

{{ item.year }}

{% if item.index %}

{{ item.index }}

{% endif %} +{% if item.ref_sra %}

{{ item.ref_sra }}

{% endif %}

{{ item.act_type }}

{{ item.signature_date }}

{{ item.in_charge.full_label }}

-- cgit v1.2.3