From c839624b845c98c3531ba5b582bbce5b24519cf2 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 24 May 2012 14:54:53 -0400 Subject: fixed regex for the email reply separator and a bug in sending email alerts --- askbot/const/__init__.py | 2 +- askbot/models/__init__.py | 4 ++-- askbot/skins/default/media/style/style.less | 5 ++++- askbot/skins/default/templates/question.html | 1 + askbot/skins/default/templates/question/content.html | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/askbot/const/__init__.py b/askbot/const/__init__.py index f3091800..ae1d7d2d 100644 --- a/askbot/const/__init__.py +++ b/askbot/const/__init__.py @@ -59,7 +59,7 @@ REPLY_WITH_COMMENT_TEMPLATE = _( 'Note: to reply with a comment, ' 'please use this link' ) -REPLY_SEPARATOR_REGEX = re.compile('==== .* -=-==', re.MULTILINE) +REPLY_SEPARATOR_REGEX = re.compile(r'==== .* -=-==', re.MULTILINE|re.DOTALL) ANSWER_SORT_METHODS = (#no translations needed here 'latest', 'oldest', 'votes' diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index a87ab96d..90336e6c 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -2726,7 +2726,7 @@ def send_instant_notifications_about_activity_in_post( #of executive function with the activity log recording #TODO check user reputation headers = mail.thread_headers(post, origin_post, update_activity.activity_type) - reply_with_comment_address = None#only used for questions in some cases + reply_to_with_comment = None#only used for questions in some cases if askbot_settings.REPLY_BY_EMAIL: reply_addr = "noreply" if user.reputation >= askbot_settings.MIN_REP_TO_POST_BY_EMAIL: @@ -2746,7 +2746,7 @@ def send_instant_notifications_about_activity_in_post( **reply_args ).address reply_to_with_comment = 'reply-%s@%s' % ( - reply_addr, + reply_with_comment_address, askbot_settings.REPLY_BY_EMAIL_HOSTNAME ) #default action is to post answer diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less index f015ae0c..1cc1be4b 100644 --- a/askbot/skins/default/media/style/style.less +++ b/askbot/skins/default/media/style/style.less @@ -1730,7 +1730,10 @@ ul#related-tags li { } #fmanswer_button{ - margin:8px 0px ; + margin:8px 0px; + } + #fmanswer_button.answer-own-question { + width: 150px; } .question-img-favorite:hover { background: url(../images/vote-favorite-on.png) diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index f22796db..bd48bd54 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -130,6 +130,7 @@ var add_answer_btn = document.getElementById('add-answer-btn'); if (askbot['data']['userIsAuthenticated']){ if (askbot['data']['userId'] == {{question.author_id}}){ + add_answer_btn.className += ' answer-own-question'; add_answer_btn.setAttribute( 'value', '{% trans %}Answer Your Own Question{% endtrans %}' diff --git a/askbot/skins/default/templates/question/content.html b/askbot/skins/default/templates/question/content.html index 738738dd..58b1bcca 100644 --- a/askbot/skins/default/templates/question/content.html +++ b/askbot/skins/default/templates/question/content.html @@ -37,5 +37,5 @@ {% include "question/new_answer_form.html" %} {# ==== END: question/new_answer_form.html ==== #} {% if request.user == question.author %}{# this is outside the form on purpose #} - + {%endif%} -- cgit v1.2.3-1-g7c22