summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-05-11 00:13:09 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-05-11 00:13:09 -0400
commite70caf9b1dd07202af3e52bb4a39c1330aee61ed (patch)
treed066603fdf72d18cece20efe3bc0e5f3e236e047
parent9df0c39e9db55e194acd615327b631df5a48af6e (diff)
downloadaskbot-e70caf9b1dd07202af3e52bb4a39c1330aee61ed.tar.gz
askbot-e70caf9b1dd07202af3e52bb4a39c1330aee61ed.tar.bz2
askbot-e70caf9b1dd07202af3e52bb4a39c1330aee61ed.zip
removed html elements with id askform
-rw-r--r--askbot/__init__.py2
-rw-r--r--askbot/skins/default/templates/answer_edit.html32
-rw-r--r--askbot/skins/default/templates/blocks/ask_form.html70
-rw-r--r--askbot/skins/default/templates/question.html536
-rw-r--r--askbot/skins/default/templates/question_retag.html36
-rw-r--r--askbot/skins/default/templates/user_profile/user_edit.html2
-rw-r--r--askbot/views/writers.py2
7 files changed, 336 insertions, 344 deletions
diff --git a/askbot/__init__.py b/askbot/__init__.py
index 2b789de5..7b1765e5 100644
--- a/askbot/__init__.py
+++ b/askbot/__init__.py
@@ -9,7 +9,7 @@ import smtplib
import sys
import logging
-VERSION = (0, 6, 82)
+VERSION = (0, 6, 83)
#necessary for interoperability of django and coffin
try:
diff --git a/askbot/skins/default/templates/answer_edit.html b/askbot/skins/default/templates/answer_edit.html
index 0d8b40da..e8cbc7ae 100644
--- a/askbot/skins/default/templates/answer_edit.html
+++ b/askbot/skins/default/templates/answer_edit.html
@@ -10,23 +10,21 @@
{% trans %}Edit answer{% endtrans %} [<a href="{{ answer.question.get_absolute_url() }}#{{ answer.id }}">{% trans %}back{% endtrans %}</a>]
</h1>
<div id="main-body" class="ask-body">
- <div id="askform">
- <form id="fmedit" action="{% url edit_answer answer.id %}" method="post" >{% csrf_token %}
- <label for="id_revision" ><strong>{% trans %}revision{% endtrans %}:</strong></label> <br/>
- {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul() }}{% endif %}
- <div style="vertical-align:middle">
- {{ revision_form.revision }} <input type="submit" style="display:none" id="select_revision" name="select_revision" value="{% trans %}select revision{% endtrans %}">
- </div>
- {{ macros.edit_post(form) }}
- <div class="after-editor">
- <input type="submit" value="{% trans %}Save edit{% endtrans %}" class="submit" />&nbsp;
- <input type="button" value="{% trans %}Cancel{% endtrans %}" class="submit" onclick="history.back(-1);" />
- </div>
- {% if settings.WIKI_ON and answer.wiki == False %}
- {{ macros.checkbox_in_div(form.wiki) }}
- {% endif %}
- </form>
- </div>
+ <form id="fmedit" action="{% url edit_answer answer.id %}" method="post" >{% csrf_token %}
+ <label for="id_revision" ><strong>{% trans %}revision{% endtrans %}:</strong></label> <br/>
+ {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul() }}{% endif %}
+ <div style="vertical-align:middle">
+ {{ revision_form.revision }} <input type="submit" style="display:none" id="select_revision" name="select_revision" value="{% trans %}select revision{% endtrans %}">
+ </div>
+ {{ macros.edit_post(form) }}
+ <div class="after-editor">
+ <input type="submit" value="{% trans %}Save edit{% endtrans %}" class="submit" />&nbsp;
+ <input type="button" value="{% trans %}Cancel{% endtrans %}" class="submit" onclick="history.back(-1);" />
+ </div>
+ {% if settings.WIKI_ON and answer.wiki == False %}
+ {{ macros.checkbox_in_div(form.wiki) }}
+ {% endif %}
+ </form>
</div>
{% endblock %}
diff --git a/askbot/skins/default/templates/blocks/ask_form.html b/askbot/skins/default/templates/blocks/ask_form.html
index 9b61c7ce..24196bb6 100644
--- a/askbot/skins/default/templates/blocks/ask_form.html
+++ b/askbot/skins/default/templates/blocks/ask_form.html
@@ -1,41 +1,39 @@
{% import "macros.html" as macros %}
-<div id="askform">
- <form id="fmask" action="" method="post" >{% csrf_token %}
- <div class="form-item">
- <div id="askFormBar">
- {% if not request.user.is_authenticated() %}
- <p>{% trans %}login to post question info{% endtrans %}</p>
- {% else %}
- {% if settings.EMAIL_VALIDATION %}
- {% if not request.user.email_isvalid %}
- {% trans email=request.user.email %}must have valid {{email}} to post,
- see {{email_validation_faq_url}}
- {% endtrans %}
- {% endif %}
+<form id="fmask" action="" method="post" >{% csrf_token %}
+ <div class="form-item">
+ <div id="askFormBar">
+ {% if not request.user.is_authenticated() %}
+ <p>{% trans %}login to post question info{% endtrans %}</p>
+ {% else %}
+ {% if settings.EMAIL_VALIDATION %}
+ {% if not request.user.email_isvalid %}
+ {% trans email=request.user.email %}must have valid {{email}} to post,
+ see {{email_validation_faq_url}}
+ {% endtrans %}
{% endif %}
{% endif %}
- <input id="id_title" class="questionTitleInput" name="title" autocomplete="off"
- value="{% if form.initial.title %}{{form.initial.title}}{% endif %}"/>
- <span class="form-error">{{ form.title.errors }}</span>
- </div>
- <div class="title-desc">
- {{ form.title.help_text }}
- </div>
- </div>
- <div id='question-list'></div>
- {{macros.edit_post(form, post_type='question', edit_title=False)}}
- {% if not request.user.is_authenticated() %}
- <input type="submit" name="post_anon" value="{% trans %}Login/signup to post your question{% endtrans %}" class="submit" />
- {% else %}
- <input type="submit" name="post" value="{% trans %}Ask your question{% endtrans %}" class="submit" />
- {% endif %}
- <div class="question-options">
- {% if settings.WIKI_ON %}
- {{ macros.checkbox_in_div(form.wiki) }}
- {% endif %}
- {% if settings.ALLOW_ASK_ANONYMOUSLY %}
- {{ macros.checkbox_in_div(form.ask_anonymously) }}
{% endif %}
+ <input id="id_title" class="questionTitleInput" name="title" autocomplete="off"
+ value="{% if form.initial.title %}{{form.initial.title}}{% endif %}"/>
+ <span class="form-error">{{ form.title.errors }}</span>
</div>
- </form>
-</div>
+ <div class="title-desc">
+ {{ form.title.help_text }}
+ </div>
+ </div>
+ <div id='question-list'></div>
+ {{macros.edit_post(form, post_type='question', edit_title=False)}}
+ {% if not request.user.is_authenticated() %}
+ <input type="submit" name="post_anon" value="{% trans %}Login/signup to post your question{% endtrans %}" class="submit" />
+ {% else %}
+ <input type="submit" name="post" value="{% trans %}Ask your question{% endtrans %}" class="submit" />
+ {% endif %}
+ <div class="question-options">
+ {% if settings.WIKI_ON %}
+ {{ macros.checkbox_in_div(form.wiki) }}
+ {% endif %}
+ {% if settings.ALLOW_ASK_ANONYMOUSLY %}
+ {{ macros.checkbox_in_div(form.ask_anonymously) }}
+ {% endif %}
+ </div>
+</form>
diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html
index ffab9bd1..250a6962 100644
--- a/askbot/skins/default/templates/question.html
+++ b/askbot/skins/default/templates/question.html
@@ -12,298 +12,297 @@
{% endblock %}
{% block content %}
<h1><a href="{{ question.get_absolute_url() }}">{{ question.get_question_title() }}</a></h1>
-<div id="askform">
- <table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>
- <tr>
- <td style="width:30px;vertical-align:top">
- <div class="vote-buttons">
- {% if question_vote %}
- <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
- {% if question_vote.is_upvote() %}
- src="{{"/images/vote-arrow-up-on.png"|media}}"
- {% else %}
- src="{{"/images/vote-arrow-up.png"|media}}"
- {% endif %}
- alt="{% trans %}i like this post (click again to cancel){% endtrans %}"
- title="{% trans %}i like this post (click again to cancel){% endtrans %}" />
- <div id="question-vote-number-{{ question.id }}" class="vote-number"
- title="{% trans %}current number of votes{% endtrans %}">
- {{ question.score }}
- </div>
- <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
- {% if question_vote.is_downvote() %}
- src="{{"/images/vote-arrow-down-on.png"|media}}"
- {% else %}
- src="{{"/images/vote-arrow-down.png"|media}}"
- {% endif %}
- alt="{% trans %}i dont like this post (click again to cancel){% endtrans %}"
- title="{% trans %}i dont like this post (click again to cancel){% endtrans %}" />
+<table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>
+ <tr>
+ <td style="width:30px;vertical-align:top">
+ <div class="vote-buttons">
+ {% if question_vote %}
+ <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
+ {% if question_vote.is_upvote() %}
+ src="{{"/images/vote-arrow-up-on.png"|media}}"
{% else %}
- <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
- alt="{% trans %}i like this post (click again to cancel){% endtrans %}"
src="{{"/images/vote-arrow-up.png"|media}}"
- title="{% trans %}i like this post (click again to cancel){% endtrans %}" />
- <div id="question-vote-number-{{ question.id }}" class="vote-number"
- title="{% trans %}current number of votes{% endtrans %}">
- {{ question.score }}
- </div>
- <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
- src="{{"/images/vote-arrow-down.png"|media}}"
- alt="{% trans %}i dont like this post (click again to cancel){% endtrans %}"
- title="{% trans %}i dont like this post (click again to cancel){% endtrans %}" />
{% endif %}
- {% if favorited %}
- <img class="question-img-favorite" src="{{"/images/vote-favorite-on.png"|media}}"
- alt="{% trans %}mark this question as favorite (click again to cancel){% endtrans %}"
- title="{% trans %}mark this question as favorite (click again to cancel){% endtrans %}" />
- <div id="favorite-number" class="favorite-number my-favorite-number">
- {{ question.favourite_count }}
- </div>
+ alt="{% trans %}i like this post (click again to cancel){% endtrans %}"
+ title="{% trans %}i like this post (click again to cancel){% endtrans %}" />
+ <div id="question-vote-number-{{ question.id }}" class="vote-number"
+ title="{% trans %}current number of votes{% endtrans %}">
+ {{ question.score }}
+ </div>
+ <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
+ {% if question_vote.is_downvote() %}
+ src="{{"/images/vote-arrow-down-on.png"|media}}"
{% else %}
- <img class="question-img-favorite" src="{{"/images/vote-favorite-off.png"|media}}"
- alt="{% trans %}remove favorite mark from this question (click again to restore mark){% endtrans %}"
- title="{% trans %}remove favorite mark from this question (click again to restore mark){% endtrans %}" />
- <div id="favorite-number" class="favorite-number">
- {% if question.favourite_count != 0 %}{{ question.favourite_count }}{% endif %}
- </div>
- {% endif %}
- {% if settings.ENABLE_SOCIAL_SHARING %}
- <a class="twitter-share" alt="{% trans %}Share this question on twitter{% endtrans %}"></a>
- <a class="fb-share" alt="{% trans %}Share this question on facebook{% endtrans %}"></a>
+ src="{{"/images/vote-arrow-down.png"|media}}"
{% endif %}
+ alt="{% trans %}i dont like this post (click again to cancel){% endtrans %}"
+ title="{% trans %}i dont like this post (click again to cancel){% endtrans %}" />
+ {% else %}
+ <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
+ alt="{% trans %}i like this post (click again to cancel){% endtrans %}"
+ src="{{"/images/vote-arrow-up.png"|media}}"
+ title="{% trans %}i like this post (click again to cancel){% endtrans %}" />
+ <div id="question-vote-number-{{ question.id }}" class="vote-number"
+ title="{% trans %}current number of votes{% endtrans %}">
+ {{ question.score }}
</div>
- </td>
- <td>
- <div class="question-body">
- {{question.html}}
+ <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
+ src="{{"/images/vote-arrow-down.png"|media}}"
+ alt="{% trans %}i dont like this post (click again to cancel){% endtrans %}"
+ title="{% trans %}i dont like this post (click again to cancel){% endtrans %}" />
+ {% endif %}
+ {% if favorited %}
+ <img class="question-img-favorite" src="{{"/images/vote-favorite-on.png"|media}}"
+ alt="{% trans %}mark this question as favorite (click again to cancel){% endtrans %}"
+ title="{% trans %}mark this question as favorite (click again to cancel){% endtrans %}" />
+ <div id="favorite-number" class="favorite-number my-favorite-number">
+ {{ question.favourite_count }}
</div>
- <ul id="question-tags" class="post-tags tags">
- {% for tag in question.get_tag_names() %}
- {{ macros.tag_widget(
- tag,
- css_class = 'post-tag',
- html_tag = 'li'
- )
- }}
- {% endfor %}
- </ul>
- <div id="question-controls" class="post-controls">
- {% set pipe=joiner('<span class="sep">|</span>') %}
- {% if request.user|can_edit_post(question) %}{{ pipe() }}
- <a href="{% url edit_question question.id %}">{% trans %}edit{% endtrans %}</a>
- {% endif %}
- {% if request.user|can_retag_question(question) %}{{ pipe() }}
- <a id="retag" href="{% url retag_question question.id %}">{% trans %}retag{% endtrans %}</a>
- <script type="text/javascript">
- var retagUrl = "{% url retag_question question.id %}";
- </script>
- {% endif %}
- {% if question.closed %}
- {% if request.user|can_reopen_question(question) %}{{ pipe() }}
- <a href="{% url reopen question.id %}">{% trans %}reopen{% endtrans %}</a>
- {% endif %}
- {% else %}
- {% if request.user|can_close_question(question) %}{{ pipe() }}
- <a href="{% url close question.id %}">{% trans %}close{% endtrans %}</a>
- {% endif %}
+ {% else %}
+ <img class="question-img-favorite" src="{{"/images/vote-favorite-off.png"|media}}"
+ alt="{% trans %}remove favorite mark from this question (click again to restore mark){% endtrans %}"
+ title="{% trans %}remove favorite mark from this question (click again to restore mark){% endtrans %}" />
+ <div id="favorite-number" class="favorite-number">
+ {% if question.favourite_count != 0 %}{{ question.favourite_count }}{% endif %}
+ </div>
+ {% endif %}
+ {% if settings.ENABLE_SOCIAL_SHARING %}
+ <a class="twitter-share" alt="{% trans %}Share this question on twitter{% endtrans %}"></a>
+ <a class="fb-share" alt="{% trans %}Share this question on facebook{% endtrans %}"></a>
+ {% endif %}
+ </div>
+ </td>
+ <td>
+ <div class="question-body">
+ {{question.html}}
+ </div>
+ <ul id="question-tags" class="post-tags tags">
+ {% for tag in question.get_tag_names() %}
+ {{ macros.tag_widget(
+ tag,
+ css_class = 'post-tag',
+ html_tag = 'li'
+ )
+ }}
+ {% endfor %}
+ </ul>
+ <div id="question-controls" class="post-controls">
+ {% set pipe=joiner('<span class="sep">|</span>') %}
+ {% if request.user|can_edit_post(question) %}{{ pipe() }}
+ <a href="{% url edit_question question.id %}">{% trans %}edit{% endtrans %}</a>
+ {% endif %}
+ {% if request.user|can_retag_question(question) %}{{ pipe() }}
+ <a id="retag" href="{% url retag_question question.id %}">{% trans %}retag{% endtrans %}</a>
+ <script type="text/javascript">
+ var retagUrl = "{% url retag_question question.id %}";
+ </script>
+ {% endif %}
+ {% if question.closed %}
+ {% if request.user|can_reopen_question(question) %}{{ pipe() }}
+ <a href="{% url reopen question.id %}">{% trans %}reopen{% endtrans %}</a>
{% endif %}
- {% if request.user|can_flag_offensive(question) %}{{ pipe() }}
- <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag"
- title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}">
- <a>{% trans %}flag offensive{% endtrans %}</a>
- {% if request.user|can_see_offensive_flags(question) %}
- <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span>
- {% endif %}
- </span>
+ {% else %}
+ {% if request.user|can_close_question(question) %}{{ pipe() }}
+ <a href="{% url close question.id %}">{% trans %}close{% endtrans %}</a>
{% endif %}
- {% if request.user|can_delete_post(question) %}{{ pipe() }}
- <a id="question-delete-link-{{question.id}}">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
+ {% endif %}
+ {% if request.user|can_flag_offensive(question) %}{{ pipe() }}
+ <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag"
+ title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}">
+ <a>{% trans %}flag offensive{% endtrans %}</a>
+ {% if request.user|can_see_offensive_flags(question) %}
+ <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span>
{% endif %}
- </div>
- <div class="post-update-info-container">
- {{
- macros.post_contributor_info(
- question,
- "original_author",
- question.wiki,
- settings.MIN_REP_TO_EDIT_WIKI
- )
- }}
- {{
- macros.post_contributor_info(
- question,
- "last_updater",
- question.wiki,
- settings.MIN_REP_TO_EDIT_WIKI,
- )
- }}
- </div>
- {{
- macros.post_comments_widget(
- post = question,
- show_post = show_post,
- show_comment = show_comment,
- comment_order_number = comment_order_number,
- user = request.user,
- max_comments = settings.MAX_COMMENTS_TO_SHOW
- )
- }}
- <!--/div-->
- </td>
- </tr>
- </table>
- {% if question.closed %}
- <div class="question-status" style="margin-bottom:15px">
- <h3>{% trans close_reason=question.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %}
- <a href="{{ question.closed_by.get_profile_url() }}">{{ question.closed_by.username }}</a>
- {% trans closed_at=question.closed_at %}close date {{closed_at}}{% endtrans %}</h3>
- </div>
- {% endif %}
- {% if answers %}
- <div class="tabBar">
- <h2 id="sort-top">
- {% trans counter=answers|length %}
- {{counter}} Answer:
- {% pluralize %}
- {{counter}} Answers:
- {% endtrans %}
- </h2>
- <div class="tabsA">
- <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top"
- title="{% trans %}oldest answers will be shown first{% endtrans %}"
- ><span>{% trans %}oldest answers{% endtrans %}</span></a>
- <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top"
- title="{% trans %}newest answers will be shown first{% endtrans %}"
- ><span>{% trans %}newest answers{% endtrans %}</span></a>
- <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top"
- title="{% trans %}most voted answers will be shown first{% endtrans %}"
- ><span>{% trans %}popular answers{% endtrans %}</span></a>
+ </span>
+ {% endif %}
+ {% if request.user|can_delete_post(question) %}{{ pipe() }}
+ <a id="question-delete-link-{{question.id}}">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
+ {% endif %}
</div>
+ <div class="post-update-info-container">
+ {{
+ macros.post_contributor_info(
+ question,
+ "original_author",
+ question.wiki,
+ settings.MIN_REP_TO_EDIT_WIKI
+ )
+ }}
+ {{
+ macros.post_contributor_info(
+ question,
+ "last_updater",
+ question.wiki,
+ settings.MIN_REP_TO_EDIT_WIKI,
+ )
+ }}
+ </div>
+ {{
+ macros.post_comments_widget(
+ post = question,
+ show_post = show_post,
+ show_comment = show_comment,
+ comment_order_number = comment_order_number,
+ user = request.user,
+ max_comments = settings.MAX_COMMENTS_TO_SHOW
+ )
+ }}
+ <!--/div-->
+ </td>
+ </tr>
+</table>
+{% if question.closed %}
+<div class="question-status" style="margin-bottom:15px">
+<h3>{% trans close_reason=question.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %}
+<a href="{{ question.closed_by.get_profile_url() }}">{{ question.closed_by.username }}</a>
+{% trans closed_at=question.closed_at %}close date {{closed_at}}{% endtrans %}</h3>
+</div>
+{% endif %}
+{% if answers %}
+ <div class="tabBar">
+ <h2 id="sort-top">
+ {% trans counter=answers|length %}
+ {{counter}} Answer:
+ {% pluralize %}
+ {{counter}} Answers:
+ {% endtrans %}
+ </h2>
+ <div class="tabsA">
+ <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top"
+ title="{% trans %}oldest answers will be shown first{% endtrans %}"
+ ><span>{% trans %}oldest answers{% endtrans %}</span></a>
+ <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top"
+ title="{% trans %}newest answers will be shown first{% endtrans %}"
+ ><span>{% trans %}newest answers{% endtrans %}</span></a>
+ <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top"
+ title="{% trans %}most voted answers will be shown first{% endtrans %}"
+ ><span>{% trans %}popular answers{% endtrans %}</span></a>
</div>
- {{ macros.paginator(paginator_context) }}
+ </div>
+ {{ macros.paginator(paginator_context) }}
- {% for answer in answers %}
- <a name="{{ answer.id }}"></a>
- <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif %}">
- <table style="width:100%;" class="answer-table">
- <tr>
- <td style="width:30px;vertical-align:top">
- <div class="vote-buttons">
- <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote"
- {% if user_answer_votes[answer.id] == 1 %}
- src="{{"/images/vote-arrow-up-on.png"|media}}"
- {% else %}
- src="{{"/images/vote-arrow-up.png"|media}}"
- {% endif %}
- alt="{% trans %}i like this answer (click again to cancel){% endtrans %}"
- title="{% trans %}i like this answer (click again to cancel){% endtrans %}"/>
- <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans %}current number of votes{% endtrans %}">
- {{ answer.score }}
- </div>
- <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote"
- {% if user_answer_votes[answer.id] == -1 %}
- src="{{"/images/vote-arrow-down-on.png"|media}}"
- {% else %}
- src="{{"/images/vote-arrow-down.png"|media}}"
- {% endif %}
- alt="{% trans %}i dont like this answer (click again to cancel){% endtrans %}"
- title="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" />
- {% if request.user == question.author %}
+ {% for answer in answers %}
+ <a name="{{ answer.id }}"></a>
+ <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted %}accepted-answer{% endif %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif %}">
+ <table style="width:100%;" class="answer-table">
+ <tr>
+ <td style="width:30px;vertical-align:top">
+ <div class="vote-buttons">
+ <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote"
+ {% if user_answer_votes[answer.id] == 1 %}
+ src="{{"/images/vote-arrow-up-on.png"|media}}"
+ {% else %}
+ src="{{"/images/vote-arrow-up.png"|media}}"
+ {% endif %}
+ alt="{% trans %}i like this answer (click again to cancel){% endtrans %}"
+ title="{% trans %}i like this answer (click again to cancel){% endtrans %}"/>
+ <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans %}current number of votes{% endtrans %}">
+ {{ answer.score }}
+ </div>
+ <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote"
+ {% if user_answer_votes[answer.id] == -1 %}
+ src="{{"/images/vote-arrow-down-on.png"|media}}"
+ {% else %}
+ src="{{"/images/vote-arrow-down.png"|media}}"
+ {% endif %}
+ alt="{% trans %}i dont like this answer (click again to cancel){% endtrans %}"
+ title="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" />
+ {% if request.user == question.author %}
+ <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
+ {% if answer.accepted %}
+ src="{{"/images/vote-accepted-on.png"|media}}"
+ {% else %}
+ src="{{"/images/vote-accepted.png"|media}}"
+ {% endif %}
+ alt="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}"
+ title="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" />
+ {% else %}
+ {% if answer.accepted %}
<img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
{% if answer.accepted %}
src="{{"/images/vote-accepted-on.png"|media}}"
{% else %}
- src="{{"/images/vote-accepted.png"|media}}"
- {% endif %}
- alt="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}"
- title="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" />
- {% else %}
- {% if answer.accepted %}
- <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
- {% if answer.accepted %}
- src="{{"/images/vote-accepted-on.png"|media}}"
- {% else %}
- src="{{"/images/vote-accepted.png"|media}}"
- {% endif %}
- alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}"
- title="{% trans questsion_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}"
+ src="{{"/images/vote-accepted.png"|media}}"
{% endif %}
+ alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}"
+ title="{% trans questsion_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}"
{% endif %}
+ {% endif %}
+ </div>
+ </td>
+ <td>
+ <div class="item-right">
+ <div class="answer-body">
+ {{ answer.html }}
</div>
- </td>
- <td>
- <div class="item-right">
- <div class="answer-body">
- {{ answer.html }}
- </div>
- <div class="answer-controls post-controls">
- {% set pipe=joiner('<span class="sep">|</span>') %}
- <span class="linksopt">{{ pipe() }}
- <a
- href="{{ answer.get_absolute_url() }}"
- title="{% trans %}answer permanent link{% endtrans %}">
- {% trans %}permanent link{% endtrans %}
- </a>
- </span>
- {% if request.user|can_edit_post(answer) %}{{ pipe() }}
- <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a></span>
+ <div class="answer-controls post-controls">
+ {% set pipe=joiner('<span class="sep">|</span>') %}
+ <span class="linksopt">{{ pipe() }}
+ <a
+ href="{{ answer.get_absolute_url() }}"
+ title="{% trans %}answer permanent link{% endtrans %}">
+ {% trans %}permanent link{% endtrans %}
+ </a>
+ </span>
+ {% if request.user|can_edit_post(answer) %}{{ pipe() }}
+ <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a></span>
+ {% endif %}
+ {% if request.user|can_flag_offensive(answer) %}{{ pipe() }}
+ <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag"
+ title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}">
+ <a>{% trans %}flag offensive{% endtrans %}</a>
+ {% if request.user|can_see_offensive_flags(answer) %}
+ <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span>
{% endif %}
- {% if request.user|can_flag_offensive(answer) %}{{ pipe() }}
- <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag"
- title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}">
- <a>{% trans %}flag offensive{% endtrans %}</a>
- {% if request.user|can_see_offensive_flags(answer) %}
- <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span>
- {% endif %}
+ </span>
+ {% endif %}
+ {% if request.user|can_delete_post(answer) %}{{ pipe() }}
+ {% spaceless %}
+ <span class="action-link">
+ <a id="answer-delete-link-{{answer.id}}">
+ {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
</span>
- {% endif %}
- {% if request.user|can_delete_post(answer) %}{{ pipe() }}
- {% spaceless %}
- <span class="action-link">
- <a id="answer-delete-link-{{answer.id}}">
- {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
- </span>
- {% endspaceless %}
- {% endif %}
- </div>
- <div class="post-update-info-container">
- {{
- macros.post_contributor_info(
- answer,
- "original_author",
- answer.wiki,
- settings.MIN_REP_TO_EDIT_WIKI
- )
- }}
- {{
- macros.post_contributor_info(
- answer,
- "last_updater",
- answer.wiki,
- settings.MIN_REP_TO_EDIT_WIKI
- )
- }}
- </div>
- {{
- macros.post_comments_widget(
- post = answer,
- show_post = show_post,
- show_comment = show_comment,
- comment_order_number = comment_order_number,
- user = request.user,
- max_comments = settings.MAX_COMMENTS_TO_SHOW
+ {% endspaceless %}
+ {% endif %}
+ </div>
+ <div class="post-update-info-container">
+ {{
+ macros.post_contributor_info(
+ answer,
+ "original_author",
+ answer.wiki,
+ settings.MIN_REP_TO_EDIT_WIKI
)
- }}
+ }}
+ {{
+ macros.post_contributor_info(
+ answer,
+ "last_updater",
+ answer.wiki,
+ settings.MIN_REP_TO_EDIT_WIKI
+ )
+ }}
</div>
- </td>
- </tr>
- </table>
- </div>
- {% endfor %}
- <div class="paginator-container-left">
- {{ macros.paginator(paginator_context) }}
- </div><br/>
- {% endif %}
+ {{
+ macros.post_comments_widget(
+ post = answer,
+ show_post = show_post,
+ show_comment = show_comment,
+ comment_order_number = comment_order_number,
+ user = request.user,
+ max_comments = settings.MAX_COMMENTS_TO_SHOW
+ )
+ }}
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ {% endfor %}
+ <div class="paginator-container-left">
+ {{ macros.paginator(paginator_context) }}
+ </div><br/>
+{% endif %}
<form id="fmanswer" action="{% url answer question.id %}" method="post">{% csrf_token %}
{% if request.user.is_authenticated() %}
<p style="padding-left:3px">
@@ -370,7 +369,6 @@
{% endif %}
{% endif %}
</form>
-</div>
{% endblock %}
{% block sidebar %}
diff --git a/askbot/skins/default/templates/question_retag.html b/askbot/skins/default/templates/question_retag.html
index 79cbbbff..883dc3aa 100644
--- a/askbot/skins/default/templates/question_retag.html
+++ b/askbot/skins/default/templates/question_retag.html
@@ -3,26 +3,24 @@
{% block title %}{% spaceless %}{% trans %}Change tags{% endtrans %}{% endspaceless %}{% endblock %}
{% block content %}
<h1>{% trans %}Change tags{% endtrans %} [<a href="{{ question.get_absolute_url() }}">{% trans %}back{% endtrans %}</a>]</h1>
-<div id="askform">
- <form id="fmretag" action="{% url retag_question question.id %}" method="post" >{% csrf_token %}
- <h2>
- {{ question.get_question_title() }}
- </h2>
- <div id="description" class="edit-content-html">
- {{ question.html }}
+<form id="fmretag" action="{% url retag_question question.id %}" method="post" >{% csrf_token %}
+ <h2>
+ {{ question.get_question_title() }}
+ </h2>
+ <div id="description" class="edit-content-html">
+ {{ question.html }}
+ </div>
+ <div class="form-item">
+ <strong>{{ form.tags.label_tag() }}:</strong> <span class="form-error"></span><br/>
+ {{ form.tags }} {{ form.tags.errors }}
+ <div class="title-desc">
+ {{ form.tags.help_text }}
</div>
- <div class="form-item">
- <strong>{{ form.tags.label_tag() }}:</strong> <span class="form-error"></span><br/>
- {{ form.tags }} {{ form.tags.errors }}
- <div class="title-desc">
- {{ form.tags.help_text }}
- </div>
- </div>
- <div class="error" ></div>
- <input type="submit" value="{% trans %}Retag{% endtrans %}" class="submit" />&nbsp;
- <input type="button" value="{% trans %}Cancel{% endtrans %}" class="submit" onclick="history.back(-1);" />
- </form>
-</div>
+ </div>
+ <div class="error" ></div>
+ <input type="submit" value="{% trans %}Retag{% endtrans %}" class="submit" />&nbsp;
+ <input type="button" value="{% trans %}Cancel{% endtrans %}" class="submit" onclick="history.back(-1);" />
+</form>
{% endblock %}
{% block sidebar %}
diff --git a/askbot/skins/default/templates/user_profile/user_edit.html b/askbot/skins/default/templates/user_profile/user_edit.html
index fe4ea35f..1e2fa2d6 100644
--- a/askbot/skins/default/templates/user_profile/user_edit.html
+++ b/askbot/skins/default/templates/user_profile/user_edit.html
@@ -16,7 +16,7 @@
{% endif %}
<h1><a href="{% url faq %}#gravatar">{% trans %}change picture{% endtrans %}</a><h1>
</div>
- <div id="askform" style="float:right;width:750px;text-align:left;">
+ <div style="float:right;width:750px;text-align:left;">
<h2>{% trans %}Registered user{% endtrans %}</h2>
<table class="user-details">
<tr>
diff --git a/askbot/views/writers.py b/askbot/views/writers.py
index d103c776..d1f115dc 100644
--- a/askbot/views/writers.py
+++ b/askbot/views/writers.py
@@ -262,7 +262,7 @@ def ask(request):#view used to ask a new question
return render_into_skin('ask.html', data, request)
@login_required
-@csrf.csrf_protect
+#@csrf.csrf_protect remove for ajax
def retag_question(request, id):
"""retag question view
"""