From 7adba01875d7b64a641d0562a9ec233de6a376cc 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) --- .../templates/ishtar/sheet_operation.html | 2 ++ archaeological_operations/urls.py | 2 ++ archaeological_operations/views.py | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 2768fd96c..945b3f4e5 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -23,6 +23,8 @@
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}
+
{% trans "Modify" %}
+

{% trans "General"%}

{% if item.common_name %}

{{ item.common_name }}

{% endif %}

{{ item.year }}

diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py index e0daa8590..bd207dd80 100644 --- a/archaeological_operations/urls.py +++ b/archaeological_operations/urls.py @@ -48,6 +48,8 @@ urlpatterns = patterns('', url(r'operation_modification/(?P.+)?$', views.operation_modification_wizard, name='operation_modification'), + url(r'operation_modify/(?P.+)/$', + views.operation_modify, name='operation_modify'), url(r'operation_closing/(?P.+)?$', views.operation_closing_wizard, name='operation_closing'), url(r'operation_deletion/(?P.+)?$', diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index e2fa5c868..0c4609181 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -20,9 +20,10 @@ import json import os +from django.core.urlresolvers import reverse from django.db.models import Q from django.http import HttpResponse -from django.shortcuts import render_to_response +from django.shortcuts import render_to_response, redirect from django.template.defaultfilters import slugify from django.utils.translation import ugettext_lazy as _, pgettext_lazy @@ -227,6 +228,13 @@ operation_modification_wizard = OperationModificationWizard.as_view([ }, url_name='operation_modification',) +def operation_modify(request, pk): + view = operation_modification_wizard(request) + OperationModificationWizard.session_set_value(request, + 'selec-operation_modification', 'pk', pk, reset=True) + return redirect(reverse('operation_modification', + kwargs={'step':'general-operation_modification'})) + operation_closing_wizard = OperationClosingWizard.as_view([ ('selec-operation_closing', OperationFormSelection), ('date-operation_closing', ClosingDateFormSelection), -- cgit v1.2.3