summaryrefslogtreecommitdiff
path: root/archaeological_context_records/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-10-28 21:32:30 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-10-28 21:32:30 +0100
commitedf06a984dda8678c296a58875ffae7aaf5c192a (patch)
treeaf6cbbeb81036c1e20a188359cffd5d9b63debaf /archaeological_context_records/wizards.py
parent188338115899e9f7dafe61f6a672ec79bbd07433 (diff)
downloadIshtar-edf06a984dda8678c296a58875ffae7aaf5c192a.tar.bz2
Ishtar-edf06a984dda8678c296a58875ffae7aaf5c192a.zip
Display a reminder of items concerned by the current edition (refs #1218)
Diffstat (limited to 'archaeological_context_records/wizards.py')
-rw-r--r--archaeological_context_records/wizards.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/archaeological_context_records/wizards.py b/archaeological_context_records/wizards.py
index afed15c4e..60dab44d6 100644
--- a/archaeological_context_records/wizards.py
+++ b/archaeological_context_records/wizards.py
@@ -34,6 +34,7 @@ class RecordWizard(Wizard):
step = self.steps.current
if not step:
return
+ # manage manualy on creation
if step.endswith('_creation'): # an operation has been selected
main_form_key = 'selec-' + self.url_name
try:
@@ -46,21 +47,16 @@ class RecordWizard(Wizard):
if current_cr:
return current_cr.operation
- # get_template_context
def get_context_data(self, form, **kwargs):
"""
Get the operation "reminder" on top of wizard forms
"""
context = super(RecordWizard, self).get_context_data(form)
+
operation = self.get_current_operation()
- if not operation:
+ if not operation or self.steps.current.startswith('selec-'):
return context
- items = []
- if hasattr(operation, 'code_patriarche') and operation.code_patriarche:
- items.append(unicode(operation.code_patriarche))
- items.append("-".join((unicode(operation.year),
- unicode(operation.operation_code))))
- context['reminder'] = _("Current operation: ") + " - ".join(items)
+ context['reminders'] = ((_("Operation"), unicode(operation)),)
return context
def get_form(self, step=None, data=None, files=None):