]> git.0d.be Git - panikweb.git/blob - panikweb_templates/templates/listen/archives.html
sounds: add a facet for tags
[panikweb.git] / panikweb_templates / templates / listen / archives.html
1 {% extends "listen.html" %}
2 {% load paniktags %}
3 {% block title %}Listen - Archives{% endblock %}
4 {% block nav %}
5
6 <p class="intro">
7 Ut numquam adipiscing sea, pro ne definiebas mediocritatem. Sed ut justo
8 semper, eam ea admodum albucius suscipiantur, eu eam omnesque suavitate. Nec te
9 iriure iudicabit. Ut nec deleniti tractatos. Ea postea suavitate voluptaria
10 pri, ei viris quaestio concludaturque qui, cu copiosae senserit quo. Cu dictas
11 officiis has, hinc libris aliquam pro te.
12 </p>
13
14                 {% if facets.fields.categories %}
15                 <nav>
16                     <ul class="custom padded">
17                                 <li><span class="mainLabel">Genre :</span></li>
18                                 {% for category in facets.fields.categories %} <li>
19                                           {% if category.0 in selected_categories %}
20                                                 <a class="check icon-check count-{{ category.1 }}" href="{{ request.get_full_path|remove_category_facet:category.0 }}">
21                                                         {{ category.0 }} | {{ category.1 }}
22                                                 </a>
23                                           {% else %}
24                                                 <a class="check icon-check-empty count-{{ category.1 }}" href="{{ request.get_full_path|append_category_facet:category.0 }}">{{ category.0 }} | {{ category.1 }}</a></span>
25                                           {% endif %}
26                                 </li>
27                                 {% endfor %}
28                     </ul>
29                 </nav>
30                 {% endif %}
31
32                 {% if facets.fields.tags %}
33                 <nav>
34                     <ul class="tag-facets custom padded">
35                         <li><span class="mainLabel">Mots clés :</span></li>
36                         {% for tag in facets.fields.tags|slice:":20" %} {# Provide only the top 20 tags #}
37                         <li>
38                           {% if tag.0 in selected_tags %}
39                                 <a class="check icon-check count-{{ tag.1 }}" href="{{ request.get_full_path|remove_tag_facet:tag.0 }}">
40                                         {{ tag.0 }} <span class="smooth">| {{ tag.1 }}</span>
41                                 </a>
42                           {% else %}
43                                 <a class="check icon-check-empty count-{{ tag.1 }}" href="{{ request.get_full_path|append_tag_facet:tag.0 }}">{{ tag.0 }} <span class="smooth">| {{ tag.1 }}</span></a> 
44                           {% endif %}
45                         </li>
46                         {% endfor %}
47                     </ul>
48                 </nav>
49                 {% endif %}
50
51 {% endblock %}
52
53 {% block main %}
54     <form method="get" action="." class="padded center" id="search-form">
55       <div class="big">
56             {% for category in selected_categories %}
57             <input type="hidden" name="selected_facets" value="categories_exact:{{category}}"/>
58             {% endfor %}
59             {% for tag in selected_tags %}
60             <input type="hidden" name="selected_facets" value="tags_exact:{{tag}}"/>
61             {% endfor %}
62             {{ form.as_table }}<button class="icon-search"></button>
63       </div>
64     </form>
65
66 <div class="wrapper">
67
68 {% if not page.object_list %}
69         <div class="big error padded center">Sorry, no result with your query!</div>
70 {% else %}
71
72 {% if page.has_previous %}
73         <div class="previous-page cf">
74                 <a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}">&laquo; Résultats précédénts</a>
75         </div>
76 {% endif %}
77
78         <ul class="padded custom columns list">
79                 {% for result in page.object_list %}
80                 <li>{% soundfile_resume soundfile=result.object date=result.date %}</li>
81                 {% endfor %}
82         </ul>
83
84 {% if page.has_next %}
85         <div class="next-page cf">
86                 <a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
87         </div>
88 {% endif %}
89
90 {% endif %}
91
92 </div>
93
94 {% endblock %}