# HG changeset patch # User Sverre Rabbelier # Date 1233152311 0 # Node ID 04229d710ce92ecae4a2ed50d7012380a9194c2a # Parent d6a9fef4c1a432bc4f5ce4572074c00ae1d6570d Allow for setting a edit_cancel_redirect Defaults to list view for the entity but can be overriden by setting the parameter manually. Falls back to history.go(-1) if not set. Patch by: Sverre Rabbelier diff -r d6a9fef4c1a4 -r 04229d710ce9 app/soc/templates/soc/models/edit.html --- a/app/soc/templates/soc/models/edit.html Wed Jan 28 14:16:46 2009 +0000 +++ b/app/soc/templates/soc/models/edit.html Wed Jan 28 14:18:31 2009 +0000 @@ -49,7 +49,11 @@ - + {% if edit_cancel_redirect %} + + {% else %} + + {% endif %} {% if entity %} diff -r d6a9fef4c1a4 -r 04229d710ce9 app/soc/views/helper/params.py --- a/app/soc/views/helper/params.py Wed Jan 28 14:16:46 2009 +0000 +++ b/app/soc/views/helper/params.py Wed Jan 28 14:18:31 2009 +0000 @@ -100,6 +100,7 @@ new_params['missing_redirect'] = '/%(url_name)s/create' % params new_params['delete_redirect'] = '/%(url_name)s/list' % params new_params['invite_redirect'] = '/request/list' + new_params['edit_cancel_redirect'] = '/%(url_name)s/list' % params new_params['sidebar'] = None new_params['sidebar_grouping'] = 'main' diff -r d6a9fef4c1a4 -r 04229d710ce9 app/soc/views/models/base.py --- a/app/soc/views/models/base.py Wed Jan 28 14:16:46 2009 +0000 +++ b/app/soc/views/models/base.py Wed Jan 28 14:18:31 2009 +0000 @@ -707,6 +707,7 @@ context['entity_type_plural'] = params['name_plural'] context['entity_type_short'] = params['name_short'] context['entity_type_url'] = params['url_name'] + context['edit_cancel_redirect'] = params.get('edit_cancel_redirect') context['return_url'] = request.path if params.get('export_content_type') and entity: