summaryrefslogtreecommitdiff
path: root/static/website/templates/ajax-keyword-search.html
blob: a8e98aad64ceb980d457db1f1fb71b94e4607aaf (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
{% load helpers %}


{{ quesions }}


{% if questions %}
<br>
<table class="table table-striped table-bordered table-hover">
    <th> FOSS </th>
    <th> Question<span class="glyphicon glyphicon-link"></span></th>
    <th> Date</th>
    <th> Views</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 %}?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 %}{% prettify question.title %}">{{ 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.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>
{% else %}
    <h4>No results found . . .</h4>
{% endif %}

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