]> git.0d.be Git - panikdb.git/blob - panikdb/templates/search/search.html
use <button> instead of input type=submit
[panikdb.git] / panikdb / templates / search / search.html
1 {% extends 'base.html' %}
2
3 {% block content %}
4     <h2>Recherche</h2>
5
6     <form method="get" action=".">
7         <table>
8             {{ form.as_table }}
9             <tr>
10                 <td>&nbsp;</td>
11                 <td>
12                   <button>Rechercher</button>
13                 </td>
14             </tr>
15         </table>
16
17         {% if query %}
18     <!-- Begin faceting. -->
19
20 <p>
21     {% if facets.fields.categories %}
22     Catégories :
23       {# Provide only the top 5 categories #}
24         {% for category in facets.fields.categories|slice:":5" %}
25           {% if category.0 in selected_categories %}
26             <strong>{{ category.0 }}</strong> ({{ category.1 }})
27           {% else %}
28             <span><a href="{{ request.get_full_path }}&amp;selected_facets=categories_exact:{{ category.0|urlencode }}">{{ category.0 }}</a> ({{ category.1 }})</span>
29           {% endif %}
30         {% endfor %}
31     {% else %}
32         No categories facets.
33     {% endif %}
34 </p>
35
36 <p>
37     {% if facets.fields.tags %}
38     Tags :
39       {# Provide only the top 5 tags #}
40         {% for tag in facets.fields.tags|slice:":5" %}
41           {% if tag.0 in selected_tags %}
42             <strong>{{ tag.0 }}</strong> ({{ tag.1 }})
43           {% else %}
44             <span><a href="{{ request.get_full_path }}&amp;selected_facets=tags_exact:{{ tag.0|urlencode }}">{{ tag.0 }}</a> ({{ tag.1 }})</span>
45           {% endif %}
46         {% endfor %}
47     {% else %}
48         No tags facets.
49     {% endif %}
50 </p>
51
52
53     <!-- End faceting -->
54
55             <h3>Résultats</h3>
56
57
58             {% for result in page.object_list %}
59                 <p>
60                     <a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>
61                 </p>
62             {% empty %}
63                 <p>Aucun résultat trouvé.</p>
64             {% endfor %}
65
66             {% if page.has_previous or page.has_next %}
67                 <div>
68                     {% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Précédente{% if page.has_previous %}</a>{% endif %}
69                     |
70                     {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Suvante &raquo;{% if page.has_next %}</a>{% endif %}
71                 </div>
72             {% endif %}
73         {% else %}
74             {# Show some example queries to run, maybe query syntax, something else? #}
75         {% endif %}
76     </form>
77 {% endblock %}