Author: antoni.aloy
Date: Thu Feb 26 09:43:14 2009
New Revision: 369
Modified:
trunk/ (props changed)
trunk/pages/admin/utils.py
trunk/pages/templates/admin/pages/page/change_form.html
trunk/pages/utils.py
Log:
closes #59. It still asks for comfirmation even the whole content is saved,
but now it changes the language.
Modified: trunk/pages/admin/utils.py
==============================================================================
--- trunk/pages/admin/utils.py (original)
+++ trunk/pages/admin/utils.py Thu Feb 26 09:43:14 2009
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-from copy import copy
from django.template import loader, Context, RequestContext,
TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from django.http import Http404
@@ -22,9 +21,7 @@
context = details(request, only_context=True)
except Http404:
context = {}
- r = copy(request)
- r.method = 'GET'
- temp.render(RequestContext(r, context))
+ temp.render(RequestContext(request, context))
plist = []
placeholders_recursif(temp.nodelist, plist)
return plist
Modified: trunk/pages/templates/admin/pages/page/change_form.html
==============================================================================
--- trunk/pages/templates/admin/pages/page/change_form.html (original)
+++ trunk/pages/templates/admin/pages/page/change_form.html Thu Feb 26
09:43:14 2009
@@ -19,7 +19,7 @@
{% endif %}{% endif %}
{% endblock %}
-<form action="?language={{ language }}{%if
request.GET.target %}&target={{ request.GET.target }}{%
endif %}&{%if request.GET.target %}position={{ request.GET.position
}}{% endif %}" method="post" id="page_form">
+<form action="?language={{ request.GET.language }}{%if
request.GET.target %}&target={{ request.GET.target }}{%
endif %}&{%if request.GET.target %}position={{ request.GET.position
}}{% endif %}" method="post" id="page_form">
{% for fieldset in adminform %}
{% include "admin/pages/page/includes/fieldset.html" %}
{% endfor %}
Modified: trunk/pages/utils.py
==============================================================================
--- trunk/pages/utils.py (original)
+++ trunk/pages/utils.py Thu Feb 26 09:43:14 2009
@@ -52,7 +52,11 @@
"""
Return the most obvious language according the request
"""
- language = request.LANGUAGE_CODE[:2]
+ # first try the GET parameter
+ if request.GET.has_key('language'):
+ language = request.GET['language']
+ else:
+ language = request.LANGUAGE_CODE[:2]
# if client language is not available
if language is None and current_page:
# in last resort, get the first language available in the page
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---