From 9b5f5ca0a065c33db57670ba166b1424bcc18cd2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 Dec 2013 22:35:21 +0100 Subject: Allow modification from the window (refs #1574) --- archaeological_finds/templates/ishtar/sheet_find.html | 1 + archaeological_finds/urls.py | 2 ++ archaeological_finds/views.py | 10 ++++++++++ 3 files changed, 13 insertions(+) (limited to 'archaeological_finds') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 7e45637d8..89f335e1a 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -22,6 +22,7 @@ {% endif %}
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}
+
{% trans "Modify" %}
{% if item.image %} diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index 8a3a2fdb6..bf49b021d 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -29,6 +29,8 @@ urlpatterns = patterns('', views.find_creation_wizard, name='find_creation'), url(r'find_modification/(?P.+)?$', views.find_modification_wizard, name='find_modification'), + url(r'find_modify/(?P.+)/$', + views.find_modify, name='find_modify'), url(r'find_source_creation/(?P.+)?$', views.find_source_creation_wizard, name='find_source_creation'), diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index b01cd4934..b5a3debce 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -17,6 +17,8 @@ # See the file COPYING for details. +from django.core.urlresolvers import reverse +from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ from ishtar_common.views import get_item, show_item, revert_item @@ -72,6 +74,14 @@ find_modification_wizard = FindModificationWizard.as_view([ label=_(u"Find modification"), url_name='find_modification',) +def find_modify(request, pk): + view = find_modification_wizard(request) + FindModificationWizard.session_set_value( + request, 'selec-find_modification', 'pk', pk, reset=True) + return redirect(reverse('find_modification', + kwargs={'step':'find-find_modification'})) + + find_source_creation_wizard = FindSourceWizard.as_view([ ('selec-find_source_creation', SourceFindFormSelection), ('source-find_source_creation', SourceForm), -- cgit v1.2.3