summaryrefslogtreecommitdiffstats
path: root/askbot/templates/question/content.html
blob: c8fef9a60c3f99893802b51e2886c1bb15daa2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{% import "macros.html" as macros %}

{% include "question/question_card.html" %}

{% if answers %}
    <div class="clean"></div>

    {% include "question/answer_tab_bar.html" %}

    <div class="clean"></div>
    {{ macros.paginator(paginator_context, anchor='#sort-top') }}
    <div class="clean"></div>

    {% for answer in answers %}
        {% if loop.index == 2 and 'QUESTION_PAGE_ANSWER_BANNER'|show_block_to(request.user) %}
            <div class="banner">{{ settings.QUESTION_PAGE_ANSWER_BANNER|safe }}</div>
        {% endif %}
        {% include "question/answer_card.html" %}
    {% endfor %}

    {{ macros.paginator(paginator_context, anchor='#sort-top') }}
    <div class="clean"></div>
{% endif %}

{# buttons below cannot be cached yet #}
{% 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 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>
{% endif %}
{% if question.closed == False and request.user == question.author %}{# this is outside the form on purpose #}
<input 
  type="button"
  class="submit after-editor answer-own-question"
  id="fmanswer_button"
  value="{% trans %}Answer Your Own Question{% endtrans %}"
/>
{% endif %}