summaryrefslogtreecommitdiff
path: root/chimere/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/views.py')
-rw-r--r--chimere/views.py69
1 files changed, 37 insertions, 32 deletions
diff --git a/chimere/views.py b/chimere/views.py
index c6fba50..9189caa 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -153,7 +153,8 @@ def get_edit_page(redirect_url, item_cls, item_form):
notifySubmission(item)
response_dct = get_base_response(area_name)
return redirect(redirect_url + '-item',
- area_name if area_name else '', item.ref_item.pk),\
+ area_name if area_name else '', item.ref_item.pk,
+ 'submited'),\
None
else:
form = item_form(instance=init_item)
@@ -162,7 +163,7 @@ def get_edit_page(redirect_url, item_cls, item_form):
get_edit_marker = get_edit_page('chimere:edit', Marker, MarkerForm)
-def edit(request, area_name="", item_id=None):
+def edit(request, area_name="", item_id=None, submited=False):
"""
Edition page
"""
@@ -173,21 +174,23 @@ def edit(request, area_name="", item_id=None):
# get the "manualy" declared_fields. Ie: properties
declared_fields = form.declared_fields.keys()
- response_dct.update({'actions':actions,
- 'action_selected':('contribute', 'edit'),
- 'error_message':'',
- 'map_layer':settings.CHIMERE_MAP_LAYER,
- 'form':form,
- 'dated':settings.CHIMERE_DAYS_BEFORE_EVENT,
- 'extra_head':form.media,
- 'marker_id':item_id,
- 'sub_categories':SubCategory.getAvailable(['M', 'B'],
- area_name),
- 'point_widget':PointChooserWidget().render('point',
- init_item.point if init_item else None,
- area_name=area_name),
- 'properties':declared_fields,
- })
+ response_dct.update({
+ 'actions':actions,
+ 'action_selected':('contribute', 'edit'),
+ 'error_message':'',
+ 'map_layer':settings.CHIMERE_MAP_LAYER,
+ 'form':form,
+ 'dated':settings.CHIMERE_DAYS_BEFORE_EVENT,
+ 'extra_head':form.media,
+ 'marker_id':item_id,
+ 'sub_categories':SubCategory.getAvailable(['M', 'B'],
+ area_name),
+ 'point_widget':PointChooserWidget().render('point',
+ init_item.point if init_item else None,
+ area_name=area_name),
+ 'properties':declared_fields,
+ 'submited':submited
+ })
# manualy populate the custom widget
if 'subcategory' in form.data and form.data['subcategory']:
response_dct['current_category'] = int(form.data['subcategory'])
@@ -258,7 +261,7 @@ def processRouteFile(request, area_name='', file_id=None):
get_edit_route = get_edit_page('chimere:editroute', Route, RouteForm)
-def editRoute(request, area_name="", item_id=None):
+def editRoute(request, area_name="", item_id=None, submited=False):
"""
Route edition page
"""
@@ -269,20 +272,22 @@ def editRoute(request, area_name="", item_id=None):
# get the "manualy" declared_fields. Ie: properties
declared_fields = form.declared_fields.keys()
- response_dct.update({'actions':actions,
- 'action_selected':('contribute', 'edit-route'),
- 'error_message':'',
- 'map_layer':settings.CHIMERE_MAP_LAYER,
- 'form':form,
- 'dated':settings.CHIMERE_DAYS_BEFORE_EVENT,
- 'extra_head':form.media,
- 'sub_categories':SubCategory.getAvailable(['R', 'B'],
- area_name),
- 'route_widget':RouteChooserWidget().render('route',
- init_item.route if init_item else None,
- area_name=area_name, routefile_id='',),
- 'properties':declared_fields
- })
+ response_dct.update({
+ 'actions':actions,
+ 'action_selected':('contribute', 'edit-route'),
+ 'error_message':'',
+ 'map_layer':settings.CHIMERE_MAP_LAYER,
+ 'form':form,
+ 'dated':settings.CHIMERE_DAYS_BEFORE_EVENT,
+ 'extra_head':form.media,
+ 'sub_categories':SubCategory.getAvailable(['R', 'B'],
+ area_name),
+ 'route_widget':RouteChooserWidget().render('route',
+ init_item.route if init_item else None,
+ area_name=area_name, routefile_id='',),
+ 'properties':declared_fields,
+ 'submited':submited
+ })
# manualy populate the custom widget
if 'subcategory' in form.data and form.data['subcategory']:
response_dct['current_category'] = int(form.data['subcategory'])