summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-18 21:02:28 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-18 21:02:28 +0100
commit7e18d11323fb433e21b5d1e93c5faa57a486949e (patch)
treef34e05d48c5bf89d7a0d0e3fa0ce4ff1971fefd3
parentc1df9a80ece30549b17aec91c26f97806c1f4a38 (diff)
downloadIshtar-7e18d11323fb433e21b5d1e93c5faa57a486949e.tar.bz2
Ishtar-7e18d11323fb433e21b5d1e93c5faa57a486949e.zip
Context record sheet: add site
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html12
-rw-r--r--archaeological_context_records/views.py6
2 files changed, 17 insertions, 1 deletions
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index cca8f5375..d26996705 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -127,6 +127,18 @@
{% trans "No operation linked to this context record!" %}
</div>
{% endif %}
+
+{% if item.archaeological_site %}
+<h3>{% trans SITE_LABEL %}</h3>
+<div class='row'>
+ {% field_flex "Reference" item.archaeological_site.reference %}
+ {% field_flex "Name" item.archaeological_site.name %}
+ {% field_flex_multiple "Periods" item.archaeological_site.periods %}
+ {% field_flex_multiple "Remains" item.archaeological_site.remains %}
+ {% field_flex_full "Towns" item.archaeological_site.towns_codes|join:" ; " %}
+</div>
+{% endif %}
+
{% trans "Document from this context record" as cr_docs %}
{% if item.source.count %}
{% dynamic_table_document cr_docs 'context_records_docs' 'context_record' item.pk '' output %}
diff --git a/archaeological_context_records/views.py b/archaeological_context_records/views.py
index 242ccadec..7fa72a6b2 100644
--- a/archaeological_context_records/views.py
+++ b/archaeological_context_records/views.py
@@ -27,12 +27,16 @@ from django.utils.translation import ugettext_lazy as _
from ishtar_common.forms_common import AuthorFormset, SourceForm
from ishtar_common.views import get_item, show_item, revert_item
+from archaeological_operations.views import site_extra_context
from ishtar_common.wizards import SearchWizard
from wizards import *
from forms import *
import models
-show_contextrecord = show_item(models.ContextRecord, 'contextrecord')
+show_contextrecord = show_item(
+ models.ContextRecord, 'contextrecord',
+ extra_dct=site_extra_context
+)
revert_contextrecord = revert_item(models.ContextRecord)