summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models.py4
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment.html34
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment_pdf.html18
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment_window.html3
-rw-r--r--archaeological_finds/urls.py4
-rw-r--r--archaeological_finds/views.py4
6 files changed, 65 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index a886485b5..2957c656d 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -807,8 +807,8 @@ class Treatment(BaseHistorizedItem, OwnPerms):
help_text=_(
u"Location where the treatment is done. Target warehouse for "
u"a move."))
- other_location = models.CharField(_(u"Other location"), max_length=200,
- blank=True, null=True)
+ other_location = models.CharField(_(u"Location (not referenced)"),
+ max_length=200, blank=True, null=True)
person = models.ForeignKey(
Person, verbose_name=_(u"Doer"), blank=True, null=True,
on_delete=models.SET_NULL, related_name='treatments')
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html
new file mode 100644
index 000000000..20ea9e3c4
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_treatment.html
@@ -0,0 +1,34 @@
+{% extends "ishtar/sheet.html" %}
+{% load i18n window_field from_dict link_to_window window_tables window_header humanize %}
+{% load url from future %}
+
+{% block head_title %}{% trans "Treatment" %}{% endblock %}
+{% block content %}
+{% window_nav item window_id 'show-treatment' %}
+
+<ul class='form-flex'>
+ {% field_li "Treatment type" item.treatment_type %}
+ {% field_li "Container" item.container %}
+ {% field_li "Location" item.location %}
+ {% field_li "Location (not referenced)" item.other_location %}
+ {% field_li "Doer" item.person %}
+ {% field_li "Start date" item.start_date %}
+ {% field_li "End date" item.end_date %}
+</ul>
+{% if item.description or item.comment %}
+{% field "Description" item.description "<pre>" "</pre>" %}
+{% field "Comment" item.comment "<pre>" "</pre>" %}
+{% endif %}
+
+{% trans "Upstream finds" as finds %}
+{% if item.upstream.count %}
+{% dynamic_table_document finds 'finds_for_treatment' 'downstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %}
+{% endif %}
+
+{% trans "Downstream finds" as finds %}
+{% if item.downstream.count %}
+{% dynamic_table_document finds 'finds_for_treatment' 'upstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %}
+{% endif %}
+
+
+{% endblock %}
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html b/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html
new file mode 100644
index 000000000..08df52e97
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_treatment_pdf.html
@@ -0,0 +1,18 @@
+{% extends "ishtar/sheet_treatment.html" %}
+{% block header %}
+<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" />
+{% endblock %}
+{% block main_head %}
+{{ block.super }}
+<div id="pdfheader">
+ Ishtar &ndash; {{APP_NAME}} &ndash; {{item}}
+</div>
+{% endblock %}
+{%block head_sheet%}{%endblock%}
+{%block main_foot%}
+<div id="pdffooter">
+ &ndash; <pdf:pagenumber/> &ndash;
+</div>
+</body>
+</html>
+{%endblock%}
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment_window.html b/archaeological_finds/templates/ishtar/sheet_treatment_window.html
new file mode 100644
index 000000000..fb0757d10
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/sheet_treatment_window.html
@@ -0,0 +1,3 @@
+{% extends "ishtar/sheet_treatment.html" %}
+{% block main_head %}{%endblock%}
+{% block main_foot %}{%endblock%}
diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py
index bbb123d09..220087d33 100644
--- a/archaeological_finds/urls.py
+++ b/archaeological_finds/urls.py
@@ -119,6 +119,10 @@ urlpatterns += patterns(
name='get-own-find-for-ope', kwargs={'force_own': True}),
url(r'get-find-for-ope/(?P<type>.+)?$', 'get_find_for_ope',
name='get-find-for-ope'),
+ url(r'get-find-for-treatment/own/(?P<type>.+)?$', 'get_find_for_treatment',
+ name='get-own-find-for-treatment', kwargs={'force_own': True}),
+ url(r'get-find-for-treatment/(?P<type>.+)?$', 'get_find_for_treatment',
+ name='get-find-for-treatment'),
url(r'get-find-full/own/(?P<type>.+)?$', 'get_find',
name='get-own-find-full', kwargs={'full': True, 'force_own': True}),
url(r'get-find-full/(?P<type>.+)?$', 'get_find',
diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py
index f0c67c231..1f3213504 100644
--- a/archaeological_finds/views.py
+++ b/archaeological_finds/views.py
@@ -45,6 +45,10 @@ get_find = get_item(models.Find, 'get_find', 'find')
get_find_for_ope = get_item(models.Find, 'get_find', 'find',
own_table_cols=models.Find.TABLE_COLS_FOR_OPE)
+get_find_for_treatment = get_item(
+ models.Find, 'get_find', 'find',
+ own_table_cols=models.Find.TABLE_COLS_FOR_OPE, base_request={})
+
show_treatment = show_item(models.Treatment, 'treatment')
get_treatment = get_item(models.Treatment, 'get_treatement', 'treatment')