summaryrefslogtreecommitdiff
path: root/static/website/templates/questions.html
blob: 3c3d35584e3709d787c799c3c058cda339b58689 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{% extends 'website/templates/base.html' %}
{% load static %}
{% load count_tags %}

{% block content %}
    <h4> 
        <h5>
            Showing {{ questions.start_index }} - {{ questions.end_index }} of {{ questions.paginator.count }} questions.
        </h5>
    </h4>
    <table class="table table-bordered table-hover">
        <th> FOSS </th>
   	<th> Question <span class="glyphicon glyphicon-link"></span></th>
        <th> Date</th>
        <th> Views</th>
        <th> Votes </th>
        <th> Answers</th>
        <th> User</th>
        {% for question in questions %}
        <tr>
            <td>
                <span class="category" data-toggle="tooltip" data-placement="top" title="{{ question.category}}">
               
                <a class="pull-left" href="{% url 'website:filter' question.category|lower %}?qid={{ question.id }}">
                 {{ question.category|truncatechars:12 }}   
                </a> 
                
                </span>
            </td>
          
            
            <td>
                <span class="question" data-toggle="tooltip" data-placement="top" title="{{ question.title }}">
                    <a href="{% url 'website:get_question' question.id %}">{{ question.title|truncatechars:40 }}</a>
                </span>            
            </td>
            
            <td>    
                <span>
                    <i>
                        {{ question.date_created|date:"d-m-y" }}
                    </i>
                </span>
            </td>
            
            <td>
                {{ question.views}}
            </td>
            <td>
            
            	 {{ question.num_votes}}
            	
            </td>
            
            <td>
                {{ question.answer_set.count }}
            </td>
            <td>
           
                <span class="title" data-toggle="tooltip" data-placement="top" title="{{ question.user }}">
                    {{ question.user|truncatechars:10 }}
                </span>
            </td>
        </tr>
        {% endfor %}

    </table>

    <ul class="pagination pull-right">
        {% if questions.has_previous %}
            <li><a href="?page={{ questions.previous_page_number }}">&laquo; <small>Prev</small></a></li>
        {% else %}
            <li class="disabled"><a href="#">&laquo;</a></li>
        {% endif %}
        
        {% for num in questions.paginator.page_range %}
            {% ifequal num questions.number %}
                <li class="active"><a href="#">{{ num }}<span class="sr-only">(current)</span></a></li>
            {% else %}
                <li><a href="?page={{ num }}">{{ num }}</a></li>
            {% endifequal %}
        {% endfor %}
        
        {% if questions.has_next %}
            <li><a href="?page={{ questions.next_page_number }}"><small>Next</small>&raquo;</a></li>
        {% else %}
            <li class="disabled"><a href="#">&raquo;</a></li>
        {% endif %}
    <ul>

{% endblock %}

{% block javascript %}
<script>
    $('span').tooltip();
</script>
{% endblock %}