From 223aa279414dae547db923212babc0b5017745c0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 25 Aug 2013 18:41:39 +0200 Subject: Basic template for Find sheet (refs #1314) --- .../templates/ishtar/sheet_find.html | 48 ++++++++++++++++++++++ .../templates/ishtar/sheet_find_window.html | 3 ++ archaeological_finds/urls.py | 8 +++- archaeological_finds/views.py | 2 + 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 archaeological_finds/templates/ishtar/sheet_find.html create mode 100644 archaeological_finds/templates/ishtar/sheet_find_window.html 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 %} +
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}
+ +

{% trans "Find"%}

+ +{% if item.image %} +plouf +{{image.label}} +{% endif%} + +

+{{item.label}}

+{% if item.description %}

+{{item.description}}

{% endif%} +

+{{item.material_type}}

+

+{{item.dating}}

+{% if item.volume %}

+{{item.volume}}

{% endif%} +{% if item.weight %}

+{{item.weight}}

{% endif%} +{% if item.find_number %}

+{{item.find_number}}

{% endif%} +{% if item.upstream_treatment %}

+{{item.upstream_treatment}}

{% endif%} +{% if item.downstream_treatment %}

+{{item.downstream_treatment}}

{% endif%} +{% if item.container %}

+{{item.container}}

{% endif%} + +

{% trans "Associated base finds"%}

+ +{% for base_find in item.base_finds.all %} +

+{{base_find.complete_id}}

+

+{{ base_find.context_record }}

+

+{{base_find.context_record.parcel}}

+

+{{ base_find.context_record.operation }}

+{% if forloop.counter0 %}
{% 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 +# Copyright (C) 2010-2013 Étienne Loks # 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.+)?$', 'get_findsource', name='get-findsource'), + url(r'show-find/(?P.+)?/(?P.+)?$', 'show_find', + name='show-find'), + url(r'show-historized-find/(?P.+)?/(?P.+)?$', + 'show_find', name='show-historized-find'), + url(r'revert-find/(?P.+)/(?P.+)$', + '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), -- cgit v1.2.3