diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-30 11:37:26 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-30 11:37:26 -0400 |
commit | 226e869cc2c85495bd29e7b8fb74a71e830e4003 (patch) | |
tree | ea41706504f6ac0a7be0add931513355c15714b0 | |
parent | a34d5ef02c4d0f6403aa4c6238b9ea0f36290f13 (diff) | |
download | askbot-226e869cc2c85495bd29e7b8fb74a71e830e4003.tar.gz askbot-226e869cc2c85495bd29e7b8fb74a71e830e4003.tar.bz2 askbot-226e869cc2c85495bd29e7b8fb74a71e830e4003.zip |
fixed mailto link and replaced quote_plus with quote fo encode content and subject for the mailto links
-rw-r--r-- | askbot/const/__init__.py | 2 | ||||
-rw-r--r-- | askbot/skins/default/templates/email/notify_author_about_approved_post.html | 2 | ||||
-rw-r--r-- | 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 <a href="mailto://%(addr)s">this link</a>' + 'please use <a href="mailto:%(addr)s">this link</a>' ) 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 -<a href="mailto://{{ replace_content_address }}?body={{ post_text }}{{ author_email_signature}}&subject={{ subject }}">click here</a>{% endtrans %}</p> +<a href="mailto:{{ replace_content_address }}?body={{ post_text }}{{ author_email_signature}}&subject={{ subject }}">click here</a>{% endtrans %}</p> <p>{% trans %}Below is a copy of your post:{% endtrans %}</p> {% if post.post_type == 'question' %} <p style="font-size:16px">{{ post.thread.title }}</p> 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): |