From 5cd8854a55b8f4e8145f06c46ec8e7332dfb5af9 Mon Sep 17 00:00:00 2001 From: hernani Date: Sat, 24 Jul 2010 17:31:56 +0000 Subject: [PATCH 1/1] Fixes OSQA 398, patch by Tim Whittington. Thanks. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@552 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- .../templates/notifications/answeraccepted.html | 9 ++++----- .../skins/default/templates/notifications/base.html | 3 ++- .../default/templates/notifications/digest.html | 4 ++-- .../default/templates/notifications/feedback.html | 10 +++++----- .../default/templates/notifications/newanswer.html | 9 +++++---- .../default/templates/notifications/newcomment.html | 11 +++++------ .../default/templates/notifications/newmember.html | 8 +++++--- .../templates/notifications/newquestion.html | 13 +++++++------ 8 files changed, 35 insertions(+), 32 deletions(-) diff --git a/forum/skins/default/templates/notifications/answeraccepted.html b/forum/skins/default/templates/notifications/answeraccepted.html index 76927e3..7658087 100644 --- a/forum/skins/default/templates/notifications/answeraccepted.html +++ b/forum/skins/default/templates/notifications/answeraccepted.html @@ -1,19 +1,18 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX - app_name = settings.APP_SHORT_NAME - answer_author = answer.author.username + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) + answer_author = html.mark_safe(answer.author.username) question = answer.question question_title = html.mark_safe(question.title) - accepted_by = answer.nstate.accepted.by.username + accepted_by = html.mark_safe(answer.nstate.accepted.by.username) accepted_by_link = html.objlink(answer.nstate.accepted.by, style=settings.EMAIL_ANCHOR_STYLE) answer_author_link = html.objlink(answer.author, style=settings.EMAIL_ANCHOR_STYLE) question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE) {% enddeclare %} {% email %} - {% subject %}{% blocktrans %}{{ prefix }} An answer to {{ question_title }} has been accepted{% endblocktrans %}{% endsubject %} + {% subject %}{% blocktrans %}{{ prefix }} An answer to: {{ question_title }} has been accepted{% endblocktrans %}{% endsubject %} {% htmlcontent notifications/base.html %}

diff --git a/forum/skins/default/templates/notifications/base.html b/forum/skins/default/templates/notifications/base.html index cd7e69c..ca1f5f6 100644 --- a/forum/skins/default/templates/notifications/base.html +++ b/forum/skins/default/templates/notifications/base.html @@ -9,6 +9,7 @@ {% enddeclare %} +

@@ -31,4 +32,4 @@
- \ No newline at end of file + diff --git a/forum/skins/default/templates/notifications/digest.html b/forum/skins/default/templates/notifications/digest.html index 95ce064..67df5c0 100644 --- a/forum/skins/default/templates/notifications/digest.html +++ b/forum/skins/default/templates/notifications/digest.html @@ -1,7 +1,7 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) app_name = settings.APP_SHORT_NAME app_url = settings.APP_URL @@ -95,4 +95,4 @@ {% textcontent notifications/base_text.html %} {% endtextcontent %} -{% endemail %} \ No newline at end of file +{% endemail %} diff --git a/forum/skins/default/templates/notifications/feedback.html b/forum/skins/default/templates/notifications/feedback.html index 45e4f82..52aa6ad 100644 --- a/forum/skins/default/templates/notifications/feedback.html +++ b/forum/skins/default/templates/notifications/feedback.html @@ -1,8 +1,8 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX - app_name = settings.APP_SHORT_NAME + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) + app_name = html.mark_safe(settings.APP_SHORT_NAME) exclude_greeting = True exclude_finetune = True @@ -26,11 +26,11 @@ {% endhtmlcontent %} {% textcontent notifications/base_text.html %} -{% trans "Sender" %}: {% if name %}{{ name }}{% else %}{% trans "anonymous" %}{% endif %} -{% trans "email" %}: {{ email }} +{% trans "Sender" %}: {% if name %}{{ name|safe }}{% else %}{% trans "anonymous" %}{% endif %} +{% trans "email" %}: {{ email|safe }} ip: {{ ip }} -{% trans "Message body:" %} {{ message }} +{% trans "Message body:" %} {{ message|safe }} {% endtextcontent %} {% endemail %} diff --git a/forum/skins/default/templates/notifications/newanswer.html b/forum/skins/default/templates/notifications/newanswer.html index 2350185..e9bbaaa 100644 --- a/forum/skins/default/templates/notifications/newanswer.html +++ b/forum/skins/default/templates/notifications/newanswer.html @@ -1,9 +1,10 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) app_name = settings.APP_SHORT_NAME - answer_author = answer.author.username + safe_app_name = html.mark_safe(settings.APP_SHORT_NAME) + answer_author = html.mark_safe(answer.author.username) question = answer.question question_title = html.mark_safe(question.title) safe_body = html.html2text(answer.html) @@ -12,7 +13,7 @@ {% enddeclare %} {% email %} - {% subject %}{% blocktrans %}{{ prefix }} New answer to {{ question_title }}{% endblocktrans %}{% endsubject %} + {% subject %}{% blocktrans %}{{ prefix }} New answer to: {{ question_title }}{% endblocktrans %}{% endsubject %} {% htmlcontent notifications/base.html %}

@@ -31,7 +32,7 @@ {% textcontent notifications/base_text.html %} {% blocktrans %} -{{ answer_author }} has just posted a new answer on {{ app_name }} to the question +{{ answer_author }} has just posted a new answer on {{ safe_app_name }} to the question "{{ question_title }}": {% endblocktrans %} {{ safe_body }} diff --git a/forum/skins/default/templates/notifications/newcomment.html b/forum/skins/default/templates/notifications/newcomment.html index fbb9513..9963a46 100644 --- a/forum/skins/default/templates/notifications/newcomment.html +++ b/forum/skins/default/templates/notifications/newcomment.html @@ -1,13 +1,12 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX - app_name = settings.APP_SHORT_NAME + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) post = comment.parent question = post.question and post.question or post post_author = post.author.username - comment_author = comment.author - question_url = question.get_absolute_url() + safe_post_author = html.mark_safe(post.author.username) + comment_author = html.mark_safe(comment.author) question_title = html.mark_safe(question.title) safe_body = html.html2text(comment.comment) author_link = html.objlink(comment.author, style=settings.EMAIL_ANCHOR_STYLE) @@ -15,7 +14,7 @@ {% enddeclare %} {% email %} - {% subject %}{% blocktrans %}{{ prefix }} New comment on {{ question_title }}{% endblocktrans %}{% endsubject %} + {% subject %}{% blocktrans %}{{ prefix }} New comment on: {{ question_title }}{% endblocktrans %}{% endsubject %} {% htmlcontent notifications/base.html %}

@@ -36,7 +35,7 @@ {% textcontent notifications/base_text.html %} {% blocktrans %}{{ comment_author }} has just posted a comment on {% endblocktrans %} {% ifnotequal post question %} -{% blocktrans %}the answer posted by {{ post_author }} to {% endblocktrans %} +{% blocktrans %}the answer posted by {{ safe_post_author }} to {% endblocktrans %} {% endifnotequal %} {% blocktrans %}the question "{{ question_title }}"{% endblocktrans %} {{ safe_body }} diff --git a/forum/skins/default/templates/notifications/newmember.html b/forum/skins/default/templates/notifications/newmember.html index 1c385b3..8efbe72 100644 --- a/forum/skins/default/templates/notifications/newmember.html +++ b/forum/skins/default/templates/notifications/newmember.html @@ -1,16 +1,18 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) app_name = settings.APP_SHORT_NAME + safe_app_name = html.mark_safe(settings.APP_SHORT_NAME) app_url = settings.APP_URL newmember_name = newmember.username + safe_newmember_name = html.mark_safe(newmember.username) newmember_url = newmember.get_profile_url() newmember_link = html.objlink(newmember, style=settings.EMAIL_ANCHOR_STYLE) {% enddeclare %} {% email %} - {% subject %}{% blocktrans %}{{ prefix }}{{ newmember_name }} is a new member on {{ app_name }}{% endblocktrans %}{% endsubject %} + {% subject %}{% blocktrans %}{{ prefix }} {{ safe_newmember_name }} is a new member on {{ safe_app_name }}{% endblocktrans %}{% endsubject %} {% htmlcontent notifications/base.html %}

@@ -23,7 +25,7 @@ {% textcontent notifications/base_text.html %} {% blocktrans %} -{{ newmember_name }} has just joined {{ app_name }}. You can visit {{ newmember_name }}'s profile using the following url: +{{ safe_newmember_name }} has just joined {{ safe_app_name }}. You can visit {{ safe_newmember_name }}'s profile using the following url: {{ app_url }}{{ newmember_url }} {% endblocktrans %} {% endtextcontent %} diff --git a/forum/skins/default/templates/notifications/newquestion.html b/forum/skins/default/templates/notifications/newquestion.html index 746b6b4..7068bbb 100644 --- a/forum/skins/default/templates/notifications/newquestion.html +++ b/forum/skins/default/templates/notifications/newquestion.html @@ -1,12 +1,13 @@ {% load i18n extra_tags email_tags %} {% declare %} - prefix = settings.EMAIL_SUBJECT_PREFIX + prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) app_name = settings.APP_SHORT_NAME - question_author = question.author.username + safe_app_name = html.mark_safe(settings.APP_SHORT_NAME) + question_author = html.mark_safe(question.author.username) question_url = settings.APP_URL + question.get_absolute_url() - question_title = question.title - question_tags = question.tagnames + question_title = html.mark_safe(question.title) + question_tags = html.mark_safe(question.tagnames) safe_body = html.html2text(question.html) author_link = html.objlink(question.author, style=settings.EMAIL_ANCHOR_STYLE) question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE) @@ -14,7 +15,7 @@ {% enddeclare %} {% email %} - {% subject %}{% blocktrans %}{{ prefix }} New question on {{ app_name }}{% endblocktrans %}{% endsubject %} + {% subject %}{% blocktrans %}{{ prefix }} New question: {{ question_title }} on {{ safe_app_name }}{% endblocktrans %}{% endsubject %} {% htmlcontent notifications/base.html %}

@@ -34,7 +35,7 @@ {% textcontent notifications/base_text.html %} {% blocktrans %} -{{ question_author }} has just posted a new question on {{ app_name }}, entitled +{{ question_author }} has just posted a new question on {{ safe_app_name }}, entitled "{{ question_title }}" and tagged {{ question_tags }}: {% endblocktrans %} {{ safe_body }} -- 2.45.2