summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-10 00:18:52 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-10 00:18:52 -0400
commit9a3af6a290682a485e8ee05db40bd511eaab17a8 (patch)
tree639633a83673600cd8c9d1e3270f9c1ea9ed2ffa
parentd2366456a4c134d6b9078311e7033b85caf2c3d1 (diff)
downloadaskbot-9a3af6a290682a485e8ee05db40bd511eaab17a8.tar.gz
askbot-9a3af6a290682a485e8ee05db40bd511eaab17a8.tar.bz2
askbot-9a3af6a290682a485e8ee05db40bd511eaab17a8.zip
a minor refactoring
-rw-r--r--askbot/media/style/style.less7
-rw-r--r--askbot/templates/question/content.html8
-rw-r--r--askbot/views/readers.py6
3 files changed, 7 insertions, 14 deletions
diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less
index 4c631f6d..5ee2eab3 100644
--- a/askbot/media/style/style.less
+++ b/askbot/media/style/style.less
@@ -1900,17 +1900,10 @@ ul#related-tags li {
.wmd-container {
border:#cce6ec 3px solid;
- transition: 1s;
textarea {
border: none;
}
}
-.wmd-container.inactive {
- border-color: #ddd;
- .mceToolbar {
- display: none;
- }
-}
.users-page .wmd-container {
width: auto;
}
diff --git a/askbot/templates/question/content.html b/askbot/templates/question/content.html
index d07c3727..fe11d8e3 100644
--- a/askbot/templates/question/content.html
+++ b/askbot/templates/question/content.html
@@ -23,20 +23,20 @@
{% endif %}
{# buttons below cannot be cached yet #}
-{% if user_already_gave_answer %}
+{% if new_answer_allowed %}
+ {% include "question/new_answer_form.html" %}
+{% else %}
<div style="margin-top: 15px">
<a
class="button submit"
href="{% url "edit_answer" previous_answer.id %}"
>{% trans %}Edit Your Previous Answer{% endtrans %}</a>
- <span>{% trans %}(only one answer per question is allowed){% endtrans %}</span>
+ <span>{% trans %}(only one answer per user is allowed){% endtrans %}</span>
<div class="invisible">
{# hidden because we still need js from the tinymce widget #}
{% include "question/new_answer_form.html" %}
</div>
</div>
-{% else %}
- {% include "question/new_answer_form.html" %}
{% endif %}
{% if question.closed == False and request.user == question.author %}{# this is outside the form on purpose #}
<input
diff --git a/askbot/views/readers.py b/askbot/views/readers.py
index 962e1dbb..1f19c1e6 100644
--- a/askbot/views/readers.py
+++ b/askbot/views/readers.py
@@ -563,13 +563,13 @@ def question(request, id):#refactor - long subroutine. display question body, an
request.user.is_authenticated() and request.user.can_post_comment()
)
- user_already_gave_answer = False
+ new_answer_allowed = True
previous_answer = None
if request.user.is_authenticated():
if askbot_settings.LIMIT_ONE_ANSWER_PER_USER:
for answer in answers:
if answer.author == request.user:
- user_already_gave_answer = True
+ new_answer_allowed = False
previous_answer = answer
break
@@ -590,7 +590,7 @@ def question(request, id):#refactor - long subroutine. display question body, an
'user_votes': user_votes,
'user_post_id_list': user_post_id_list,
'user_can_post_comment': user_can_post_comment,#in general
- 'user_already_gave_answer': user_already_gave_answer,
+ 'new_answer_allowed': new_answer_allowed,
'oldest_answer_id': thread.get_oldest_answer_id(request.user),
'previous_answer': previous_answer,
'tab_id' : answer_sort_method,