diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-12-18 19:32:54 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-12-18 19:32:54 +0100 |
commit | 09b87ba5e8f84b4d012d7472ac4841f818b606a5 (patch) | |
tree | 3a2067a780b1ee960d6f61bb3f106bb10f914882 /archaeological_operations | |
parent | ab191a5873011db4b44adf6d4e532681c29b4cb3 (diff) | |
download | Ishtar-09b87ba5e8f84b4d012d7472ac4841f818b606a5.tar.bz2 Ishtar-09b87ba5e8f84b4d012d7472ac4841f818b606a5.zip |
Operations: display relations in sheet files
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/models.py | 1 | ||||
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_operation.html | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 58281250f..90215b4c6 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -467,6 +467,7 @@ class RecordRelations(GeneralRecordRelations, models.Model): class Meta: verbose_name = _(u"Operation record relation") verbose_name_plural = _(u"Operation record relations") + ordering = ('left_record', 'relation_type') post_delete.connect(post_delete_record_relation, sender=RecordRelations) diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 545b1c143..0435022c1 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -93,6 +93,17 @@ <p><label>{%trans "Altitude (m NGF):"%}</label> <span class='value'>{{ item.altitude }}</span></p> {% endcomment %} +{% if item.right_relations.count %} +<h3>{% trans "Relations"%}</h3> +{% for rel in item.right_relations.all %} +{% ifchanged rel.relation_type %} +{% if forloop.counter0 %}</ul>{% endif %} +<h4>{{rel.relation_type}}</h4><ul>{% endifchanged %} +<li><a href="#" onclick="load_window('/show-operation/{{rel.right_record.pk}}/');" class="display_details">{% trans "Details" %}</a> {{rel.right_record}}</li> +{% if forloop.last %}</ul>{% endif %} +{% endfor %} +{% endif %} + {% trans "Associated parcels" as parcels_label %} {% include "ishtar/blocks/window_tables/parcels.html" %} |