From e663900f71cb95241bda29e92c1bf71785c288bf Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Mon, 16 Jul 2012 13:44:10 -0400 Subject: adjusted style for the list of related questions --- askbot/skins/default/media/style/style.less | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less index fd2d5b5a..7f5c4eb1 100644 --- a/askbot/skins/default/media/style/style.less +++ b/askbot/skins/default/media/style/style.less @@ -675,7 +675,7 @@ body.anon { font-size:16px; border-bottom:#cccccc 1px solid; font-size:13px; - + strong{ float:right; padding-right:10px; @@ -683,16 +683,23 @@ body.anon { } .questions-related { word-wrap: break-word; - + p { line-height: 20px; - padding: 4px 0px 4px 0px; + padding: 4px 0px 9px 0px; font-size: 16px; font-weight:normal; border-bottom:#cccccc 1px solid; } - a{ + p:first-child { + margin-top: -4px; + } + p:last-child { + border: none; + } + a { font-size:13px; + line-height: 1.3; } } /* tips and markdown help are widgets for ask template */ -- cgit v1.2.3-1-g7c22 From a2faac0a22ed74255bfa44b36c8d8a3b07e96813 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Mon, 16 Jul 2012 21:58:13 -0400 Subject: filtered out blocked users from receiving instant notifications --- askbot/models/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index c4c11cb4..12dd97fd 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -2846,6 +2846,10 @@ def send_instant_notifications_about_activity_in_post( ) #send email for all recipients for user in recipients: + + if user.is_blocked(): + continue + reply_address, alt_reply_address = get_reply_to_addresses(user, post) subject_line, body_text = format_instant_notification_email( -- cgit v1.2.3-1-g7c22 From 1c788b98ee532e12717f24e17f9fe62dde6d6a38 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Mon, 16 Jul 2012 22:50:35 -0400 Subject: restored ability to comment and vote on closed questions and removed width from "answer own question" button --- askbot/skins/default/media/style/style.less | 7 +-- .../skins/default/templates/question/content.html | 11 +++-- .../default/templates/question/javascript.html | 56 +++++++++++----------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less index 7f5c4eb1..4e272eca 100644 --- a/askbot/skins/default/media/style/style.less +++ b/askbot/skins/default/media/style/style.less @@ -1740,9 +1740,6 @@ ul#related-tags li { #fmanswer_button{ margin:8px 0px; } - #fmanswer_button.answer-own-question { - width: 150px; - } .question-img-favorite:hover { background: url(../images/vote-favorite-on.png) } @@ -1879,9 +1876,9 @@ ul#related-tags li { margin: -3px 0px 0px -2px; } .content { - margin-bottom: 7px; + margin-bottom: 7px; } - + .comment-votes { float: left; width: 37px; diff --git a/askbot/skins/default/templates/question/content.html b/askbot/skins/default/templates/question/content.html index 906b1953..f01c68e0 100644 --- a/askbot/skins/default/templates/question/content.html +++ b/askbot/skins/default/templates/question/content.html @@ -31,6 +31,11 @@ {# ==== START: question/new_answer_form.html ==== #} {% 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%} +{% if question.closed == False and request.user == question.author %}{# this is outside the form on purpose #} + +{% endif %} diff --git a/askbot/skins/default/templates/question/javascript.html b/askbot/skins/default/templates/question/javascript.html index 3a29579d..73e209bb 100644 --- a/askbot/skins/default/templates/question/javascript.html +++ b/askbot/skins/default/templates/question/javascript.html @@ -1,32 +1,30 @@ -{% if not thread.closed %} - - - - -{% endif %} + + + + -- cgit v1.2.3-1-g7c22 From 0fd2708973b71444f1e3440b3debd7e04574c7e9 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 17 Jul 2012 02:00:43 -0400 Subject: made high reputation users be able to reopen questions --- askbot/models/__init__.py | 18 ++++++++++++++++-- askbot/tests/permission_assertion_tests.py | 6 +++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index 12dd97fd..ed0d876a 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -837,7 +837,9 @@ def user_assert_can_close_question(self, question = None): def user_assert_can_reopen_question(self, question = None): assert(question.post_type == 'question') + #for some reason rep to reopen own questions != rep to close own q's owner_min_rep_setting = askbot_settings.MIN_REP_TO_REOPEN_OWN_QUESTIONS + min_rep_setting = askbot_settings.MIN_REP_TO_CLOSE_OTHERS_QUESTIONS general_error_message = _( 'Sorry, only administrators, moderators ' @@ -850,15 +852,27 @@ def user_assert_can_reopen_question(self, question = None): 'a minimum reputation of %(min_rep)s is required' ) % {'min_rep': owner_min_rep_setting} + blocked_error_message = _( + 'Sorry, you cannot reopen questions ' + 'because your account is blocked' + ) + + suspended_error_message = _( + 'Sorry, you cannot reopen questions ' + 'because your account is suspended' + ) + _assert_user_can( user = self, post = question, - admin_or_moderator_required = True, owner_can = True, suspended_owner_cannot = True, owner_min_rep_setting = owner_min_rep_setting, + min_rep_setting = min_rep_setting, owner_low_rep_error_message = owner_low_rep_error_message, - general_error_message = general_error_message + general_error_message = general_error_message, + blocked_error_message = blocked_error_message, + suspended_error_message = suspended_error_message ) diff --git a/askbot/tests/permission_assertion_tests.py b/askbot/tests/permission_assertion_tests.py index 2f746ef9..8061bdb8 100644 --- a/askbot/tests/permission_assertion_tests.py +++ b/askbot/tests/permission_assertion_tests.py @@ -447,9 +447,9 @@ class ReopenQuestionPermissionAssertionTests(utils.AskbotTestCase): ) - def test_high_rep_nonowner_cannot_reopen(self): + def test_high_rep_nonowner_can_reopen(self): self.other_user.reputation = 1000000 - self.assert_cannot_reopen(user = self.other_user) + self.assert_can_reopen(user = self.other_user) def test_low_rep_admin_can_reopen(self): self.other_user.set_admin_status() @@ -482,7 +482,7 @@ class ReopenQuestionPermissionAssertionTests(utils.AskbotTestCase): self.assert_cannot_reopen(user = self.other_user) class EditQuestionPermissionAssertionTests(utils.AskbotTestCase): - + def setUp(self): self.create_user() self.create_user(username = 'other_user') -- cgit v1.2.3-1-g7c22