diff options
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 48 | ||||
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find_window.html | 3 | ||||
-rw-r--r-- | archaeological_finds/urls.py | 8 | ||||
-rw-r--r-- | archaeological_finds/views.py | 2 |
4 files changed, 60 insertions, 1 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html new file mode 100644 index 000000000..208447905 --- /dev/null +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -0,0 +1,48 @@ +{% extends "ishtar/sheet.html" %} +{% load i18n %} +{% block content %} +<div class='tool'>{%trans "Export as:"%} <a href='{% url show-find item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-find item.pk "pdf" %}'>{%trans "PDF file"%}</a></div> + +<h3>{% trans "Find"%}</h3> + +{% if item.image %} +plouf +<img href='{{item.image.url}}' alt="{{image.label}}"/> +{% endif%} + +<p><label>{%trans "Name"%}{% trans ":"%}</label> +<span class='value'>{{item.label}}</span></p> +{% if item.description %}<p><label>{%trans "Description"%}{% trans ":"%}</label> +<span class='value'>{{item.description}}</span></p>{% endif%} +<p><label>{%trans "Material type"%}{% trans ":"%}</label> +<span class='value'>{{item.material_type}}</span></p> +<p><label>{%trans "Dating"%}{% trans ":"%}</label> +<span class='value'>{{item.dating}}</span></p> +{% if item.volume %}<p><label>{%trans "Volume (l)"%}{% trans ":"%}</label> +<span class='value'>{{item.volume}}</span></p>{% endif%} +{% if item.weight %}<p><label>{%trans "Weight (g)"%}{% trans ":"%}</label> +<span class='value'>{{item.weight}}</span></p>{% endif%} +{% if item.find_number %}<p><label>{%trans "Find number"%}{% trans ":"%}</label> +<span class='value'>{{item.find_number}}</span></p>{% endif%} +{% if item.upstream_treatment %}<p><label>{%trans "Upstream treatment"%}{% trans ":"%}</label> +<span class='value'>{{item.upstream_treatment}}</span></p>{% endif%} +{% if item.downstream_treatment %}<p><label>{%trans "Downstream treatment"%}{% trans ":"%}</label> +<span class='value'>{{item.downstream_treatment}}</span></p>{% endif%} +{% if item.container %}<p><label>{%trans "Container"%}{% trans ":"%}</label> +<span class='value'>{{item.container}}</span></p>{% endif%} + +<h3>{% trans "Associated base finds"%}</h3> + +{% for base_find in item.base_finds.all %} +<p><label>{%trans "Complete ID"%}{% trans ":"%}</label> +<span class='value'>{{base_find.complete_id}}</span></p> +<p><label>{%trans "Related context record"%}{% trans ":"%}</label> +<span class='value'><a href="#" onclick='load_window("{% url show-contextrecord base_find.context_record.pk ''%}");'>{{ base_find.context_record }}</a></span></p> +<p><label>{%trans "Related parcel"%}{% trans ":"%}</label> +<span class='value'>{{base_find.context_record.parcel}}</span></p> +<p><label>{%trans "Related operation"%}{% trans ":"%}</label> +<span class='value'><a href="#" onclick='load_window("{% url show-operation base_find.context_record.operation.pk ''%}");'>{{ base_find.context_record.operation }}</a></span></p> +{% if forloop.counter0 %}<hr/>{% endif %} +{% endfor %} + +{% endblock %} diff --git a/archaeological_finds/templates/ishtar/sheet_find_window.html b/archaeological_finds/templates/ishtar/sheet_find_window.html new file mode 100644 index 000000000..3ef9ebc92 --- /dev/null +++ b/archaeological_finds/templates/ishtar/sheet_find_window.html @@ -0,0 +1,3 @@ +{% extends "ishtar/sheet_find.html" %} +{% block main_head %}{%endblock%} +{% block main_foot %}{%endblock%} diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index 3d45eb106..eb1c8fcaf 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2012 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -47,4 +47,10 @@ urlpatterns += patterns('archaeological_finds.views', name='get-find-full', kwargs={'full':True}), url(r'get-findsource/(?P<type>.+)?$', 'get_findsource', name='get-findsource'), + url(r'show-find/(?P<pk>.+)?/(?P<type>.+)?$', 'show_find', + name='show-find'), + url(r'show-historized-find/(?P<pk>.+)?/(?P<date>.+)?$', + 'show_find', name='show-historized-find'), + url(r'revert-find/(?P<pk>.+)/(?P<date>.+)$', + 'revert_find', name='revert-find'), ) diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 1cf93e080..17f1a3f4d 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -46,6 +46,8 @@ get_findsource = get_item(models.FindSource, 'get_findsource', 'findsource', 'find__dating__period':'find__dating__period__pk', 'find__description':'find__description__icontains', }) +show_find = show_item(models.Find, 'find') +revert_find = revert_item(models.Find) find_creation_wizard = FindWizard.as_view([ ('selecrecord-find_creation', RecordFormSelection), |