summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_operations/models.py1
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html11
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" %}