From 648b821b9ff49cfddffcc456e374e339a41c96cf Mon Sep 17 00:00:00 2001 From: jordan Date: Wed, 29 Dec 2010 23:28:38 +0000 Subject: [PATCH] Adding some more accurate Unicode support, modified to » some special characters, changed the way the media is being served. Work on issue OSQA-489 in Jira. The patch given by Justin Grant couldn't be applied, because some changes on the listed filed have already been done, but it was very useful. Thanks. :) git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@656 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/skins/default/templates/account_settings.html | 8 ++++---- forum/skins/default/templates/answer_edit_tips.html | 2 +- forum/skins/default/templates/question_edit_tips.html | 2 +- forum/skins/default/templates/question_retag.html | 7 +------ forum/views/meta.py | 9 ++++++++- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/forum/skins/default/templates/account_settings.html b/forum/skins/default/templates/account_settings.html index 91267d2..d1349ec 100644 --- a/forum/skins/default/templates/account_settings.html +++ b/forum/skins/default/templates/account_settings.html @@ -26,17 +26,17 @@ {% endif %}
-
» {% trans "Change password" %}
+
» {% trans "Change password" %}
{% trans "Give your account a new password." %}
{% comment %} -
» {% trans "Change email " %}
+
» {% trans "Change email " %}
{% trans "Add or update the email address associated with your account." %}
-
» {% trans "Change OpenID" %}
+
» {% trans "Change OpenID" %}
{% trans "Change openid associated to your account" %}
-
» {% trans "Delete account" %}
+
» {% trans "Delete account" %}
{% trans "Erase your username and all your data from website" %}
{% endcomment %}
diff --git a/forum/skins/default/templates/answer_edit_tips.html b/forum/skins/default/templates/answer_edit_tips.html index 43240c8..39e1f3c 100644 --- a/forum/skins/default/templates/answer_edit_tips.html +++ b/forum/skins/default/templates/answer_edit_tips.html @@ -17,7 +17,7 @@ diff --git a/forum/skins/default/templates/question_edit_tips.html b/forum/skins/default/templates/question_edit_tips.html index 855e9c3..d54deef 100644 --- a/forum/skins/default/templates/question_edit_tips.html +++ b/forum/skins/default/templates/question_edit_tips.html @@ -19,7 +19,7 @@ diff --git a/forum/skins/default/templates/question_retag.html b/forum/skins/default/templates/question_retag.html index fdcffd0..6ec1313 100644 --- a/forum/skins/default/templates/question_retag.html +++ b/forum/skins/default/templates/question_retag.html @@ -90,17 +90,12 @@
  • {% trans "tags help us keep Questions organized" %}
  • - {% comment %} -
  • - 修改完整问题需要用户的积分达到一定条件(比如:积分 >= 3000分,自己发布的问题除外),而用户积分达到比较低的时候,就可以修改问题的标签(比如:积分 >= 500, 这里指所有问题的标签)。 -
  • - {% endcomment %}
  • {% trans "tag editors receive special awards from the community" %}
  • diff --git a/forum/views/meta.py b/forum/views/meta.py index 2177301..536cf26 100644 --- a/forum/views/meta.py +++ b/forum/views/meta.py @@ -33,8 +33,15 @@ def static(request, title, content): context_instance=RequestContext(request)) def media(request, skin, path): - return serve(request, "%s/media/%s" % (skin, path), + response = serve(request, "%s/media/%s" % (skin, path), document_root=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'skins').replace('\\', '/')) + content_type = response['Content-Type'] + if ('charset=' not in content_type): + if (content_type.startswith('text') or content_type=='application/x-javascript'): + content_type += '; charset=utf-8' + response['Content-Type'] = content_type + return response + def markdown_help(request): return render_to_response('markdown_help.html', context_instance=RequestContext(request)) -- 2.39.5