summaryrefslogtreecommitdiff
path: root/static/website/templates/user-answers.html
blob: 34a1c6817e979976f63d9e25736f01809fee03e4 (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
{% extends 'website/templates/base.html' %}
{% load count_tags %}
{% block content %}
    <h4>My Answers</h4>
    {% for answer in answers%}
        <div class="my-answer">
            <span class="body">
                <a href="{% url 'website:get_question' answer.question.id %}#answer{{ answer.id }}">{{ answer.body|safe }}</a>
            </span>
            <br>
            <span class="date">
                <small>
                Replied on:
                {{ answer.date_created }}
                </small>
            </span>
        </div>
    {% endfor %}
    
    {% if total > 10 %}
        <ul class="pagination pull-right">
            {% for i in total|get_range:"0,10" %}
                <li>
                    <a href="{% url 'website:user_answers' user.id %}?marker={{ i }}">
                        {% if i == marker %}
                            <strong>{{ i|div:"10"|inc }}</strong>
                        {% else %}
                            {{ i|div:"10"|inc }}
                        {% endif %}
                    </a>
                </li>
            {% endfor %}
        </ul>
    {% endif %}

{% endblock %}