From 226e869cc2c85495bd29e7b8fb74a71e830e4003 Mon Sep 17 00:00:00 2001
From: Evgeny Fadeev
Date: Wed, 30 May 2012 11:37:26 -0400
Subject: fixed mailto link and replaced quote_plus with quote fo encode
content and subject for the mailto links
---
askbot/const/__init__.py | 2 +-
.../default/templates/email/notify_author_about_approved_post.html | 2 +-
askbot/templatetags/extra_filters_jinja.py | 7 +++++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/askbot/const/__init__.py b/askbot/const/__init__.py
index e711de92..0a36879e 100644
--- a/askbot/const/__init__.py
+++ b/askbot/const/__init__.py
@@ -58,7 +58,7 @@ SIMPLE_REPLY_SEPARATOR_TEMPLATE = '==== %s -=-=='
REPLY_SEPARATOR_TEMPLATE = '==== %(user_action)s %(instruction)s -=-=='
REPLY_WITH_COMMENT_TEMPLATE = _(
'Note: to reply with a comment, '
- 'please use this link'
+ 'please use this link'
)
REPLY_SEPARATOR_REGEX = re.compile(r'==== .* -=-==', re.MULTILINE|re.DOTALL)
diff --git a/askbot/skins/default/templates/email/notify_author_about_approved_post.html b/askbot/skins/default/templates/email/notify_author_about_approved_post.html
index 269d8506..085141d9 100644
--- a/askbot/skins/default/templates/email/notify_author_about_approved_post.html
+++ b/askbot/skins/default/templates/email/notify_author_about_approved_post.html
@@ -12,7 +12,7 @@
subject = mailto_link_subject|safe_urlquote,
author_email_signature = author_email_signature|safe_urlquote
%}If you would like to edit by email, please
-click here{% endtrans %}
+click here{% endtrans %}
{% trans %}Below is a copy of your post:{% endtrans %}
{% if post.post_type == 'question' %}
{{ post.thread.title }}
diff --git a/askbot/templatetags/extra_filters_jinja.py b/askbot/templatetags/extra_filters_jinja.py
index fa9d0ced..3643e3c9 100644
--- a/askbot/templatetags/extra_filters_jinja.py
+++ b/askbot/templatetags/extra_filters_jinja.py
@@ -47,8 +47,11 @@ def add_tz_offset(datetime_object):
return str(datetime_object) + ' ' + TIMEZONE_STR
@register.filter
-def safe_urlquote(text):
- return urllib.quote_plus(text.encode('utf8'))
+def safe_urlquote(text, quote_plus = False):
+ if quote_plus:
+ return urllib.quote_plus(text.encode('utf8'))
+ else:
+ return urllib.quote(text.encode('utf8'))
@register.filter
def strip_path(url):
--
cgit v1.2.3-1-g7c22