]> git.0d.be Git - panikweb.git/blob - panikweb_templates/templates/search/search.html
18eb84938a0e4dae20a4b201859b9c7507b561fa
[panikweb.git] / panikweb_templates / templates / search / search.html
1 {% extends 'panikdb/base.html' %}
2 {% load paniktags %}
3 {% load highlight %}
4 {% block bodyID %}Search{% endblock %}
5 {% block title %}Recherche{% endblock %}
6 {% block nav %} 
7 <div class="padded search">
8     <form method="get" action="." class="big center" id="search-form">
9             {{ form.as_table }}<button class="icon-search"></button>
10     </form>
11         {% if query %}
12                 <nav>
13                     {% if facets.fields.categories %}
14                     <ul class="custom padded">
15                       {# Provide only the top 5 categories #}
16                                 {% for category in facets.fields.categories|slice:":5" %}
17                                 <li>
18                                           {% if category.0 in selected_categories %}
19                                                 <a class="check icon-check count-{{ category.1 }}" href="{{ request.get_full_path|remove_category_facet:category.0 }}">
20                                                         {{ category.0 }} | {{ category.1 }}
21                                                 </a>
22                                           {% else %}
23                                                 <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>
24                                           {% endif %}
25                                 </li>
26                                 {% endfor %}
27                     </ul>
28                     {% endif %}
29                 </nav>
30                 <nav>
31                     {% if facets.fields.tags %}
32                     <ul class="tag-facets custom padded">
33                       {# Provide only the top 5 tags #}
34                         {% for tag in facets.fields.tags|slice:":20" %}
35                         <li>
36                           {% if tag.0 in selected_tags %}
37                                 <a class="check icon-check count-{{ tag.1 }}" href="{{ request.get_full_path|remove_tag_facet:tag.0 }}">
38                                         {{ tag.0 }} | {{ tag.1 }}
39                                 </a> 
40                           {% else %}
41                                 <a class="check icon-check-empty count-{{ tag.1 }}" href="{{ request.get_full_path|append_tag_facet:tag.0 }}">{{ tag.0 }} | {{ tag.1 }}</a> 
42                           {% endif %}
43                         </li>
44                         {% endfor %}
45                     </ul>
46                     {% endif %}
47
48                 </nav>
49         {% endif %}
50 </div>
51 {% endblock %}
52
53
54 {% block main %}
55         {% if query %}
56 <div class="wrapper">
57         <div class="padded">
58                 {% if not page.object_list %}
59                         <div class="big error padded center">Sorry, no result with your query!</div>
60                 {% endif %}
61                 {% if page.has_previous %}
62                         <div class="previous-page cf">
63                                 <a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}">&laquo; Résultats précédénts</a>
64                         </div>
65                 {% endif %}
66
67                 <ul id="search-results" class="list columns padded cf">
68
69
70                 {% for result in page.object_list %}
71                                 {% if result.object.title %}
72                         <li class="ellipsis">
73                                         {% search_result_template result %}
74                         </li>
75                                 {% endif %}
76                 {% endfor %}
77
78
79                 </ul>
80                 {% if page.has_next %}
81                         <div class="next-page cf">
82                                 <a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
83                         </div>
84                 {% endif %}
85         </div>
86 </div>
87         {% endif %}
88 {% endblock %}