# HG changeset patch # User Pawel Solyga # Date 1242905111 -7200 # Node ID 068540d91bde21e1c357f885094ad1c202d64e4f # Parent 4e487ffd4102fd8255b9f5619684c9c90dc5c27b Now clicking cancel button returns user to previous page. Fixes issue 569. If you don't want that behaviour you can define cancel_redirect and user will be redirected to given url on "Cancel" button click instead of redirecting to previous page. Patch by: Daniel Hans & Pawel Solyga diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/club_admin/manage.html --- a/app/soc/templates/soc/club_admin/manage.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/club_admin/manage.html Thu May 21 13:25:11 2009 +0200 @@ -23,7 +23,17 @@ Please select the appropriate action:
- + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% endblock %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/club_member/manage.html --- a/app/soc/templates/soc/club_member/manage.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/club_member/manage.html Thu May 21 13:25:11 2009 +0200 @@ -23,7 +23,17 @@ Please select the appropriate action:
- + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% endblock %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/host/manage.html --- a/app/soc/templates/soc/host/manage.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/host/manage.html Thu May 21 13:25:11 2009 +0200 @@ -23,7 +23,17 @@ Please select the appropriate action:
- + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% endblock %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/mentor/manage.html --- a/app/soc/templates/soc/mentor/manage.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/mentor/manage.html Thu May 21 13:25:11 2009 +0200 @@ -23,7 +23,17 @@ Please select the appropriate action:
- + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% endblock %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/models/edit.html --- a/app/soc/templates/soc/models/edit.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/models/edit.html Thu May 21 13:25:11 2009 +0200 @@ -58,11 +58,17 @@ {% endif %} {% endblock %} - {% if edit_cancel_redirect %} - - {% else %} - - {% endif %} + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% if entity %} {% block delete_button %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/org_admin/manage.html --- a/app/soc/templates/soc/org_admin/manage.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/org_admin/manage.html Thu May 21 13:25:11 2009 +0200 @@ -23,7 +23,17 @@ Please select the appropriate action:
- + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% endblock %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/templates/soc/student/manage.html --- a/app/soc/templates/soc/student/manage.html Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/templates/soc/student/manage.html Thu May 21 13:25:11 2009 +0200 @@ -23,7 +23,17 @@ Please select the appropriate action:
- + {% if cancel_redirect %} + + {% endif %} + value="Cancel"/> + {% else %} + + {% endif %} {% endblock %} diff -r 4e487ffd4102 -r 068540d91bde app/soc/views/helper/params.py --- a/app/soc/views/helper/params.py Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/views/helper/params.py Thu May 21 13:25:11 2009 +0200 @@ -128,7 +128,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['cancel_redirect'] = '/%(url_name)s/list' % params new_params['public_redirect'] = None new_params['sidebar'] = None diff -r 4e487ffd4102 -r 068540d91bde app/soc/views/models/base.py --- a/app/soc/views/models/base.py Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/views/models/base.py Thu May 21 13:25:11 2009 +0200 @@ -914,7 +914,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['cancel_redirect'] = params.get('cancel_redirect') context['return_url'] = request.path if params.get('export_content_type') and entity: diff -r 4e487ffd4102 -r 068540d91bde app/soc/views/models/student_project.py --- a/app/soc/views/models/student_project.py Wed May 20 12:32:36 2009 +0200 +++ b/app/soc/views/models/student_project.py Thu May 21 13:25:11 2009 +0200 @@ -552,7 +552,7 @@ responses.useJavaScript(context, params['js_uses_all']) context['page_name'] = page_name # cancel should go to the public view - params['edit_cancel_redirect'] = redirects.getPublicRedirect(entity, params) + params['cancel_redirect'] = redirects.getPublicRedirect(entity, params) if request.POST: return self.stEditPost(request, context, params, entity, **kwargs)