comparison gpp/templates/search/search.html @ 219:26ee684c2033

Initial commit of Haystack search integration. See #51.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Jun 2010 20:46:52 +0000
parents
children 71fd8454688b
comparison
equal deleted inserted replaced
218:6dbb8faef085 219:26ee684c2033
1 {% extends 'base.html' %}
2 {% load highlight %}
3 {% block title %}Search{% endblock %}
4 {% block content %}
5 <h2>Search <img src="{{ MEDIA_URL }}icons/magnifier.png" alt="Search" /></h2>
6 <form method="get" action=".">
7 <table>
8 {{ form.as_table }}
9 <tr>
10 <td>&nbsp;</td>
11 <td>
12 <input type="submit" value="Search">
13 </td>
14 </tr>
15 </table>
16 {% if query %}
17 <h3>Results</h3>
18 {% if page.object_list %}
19 <dl>
20 {% for result in page.object_list %}
21 <dt>
22 {{ result.verbose_name }}: {{ result.title|safe }} &bull; {{ result.score }}
23 </dt>
24 <dd>
25 {% highlight result.summary with query css_class "highlight" max_length 200 %}
26 </dd>
27 {% endfor %}
28 </dl>
29 {% endif %}
30
31 {% if page.has_previous or page.has_next %}
32 <div>
33 {% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
34 |
35 {% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
36 </div>
37 {% endif %}
38 {% else %}
39 {# Show some example queries to run, maybe query syntax, something else? #}
40 {% endif %}
41 </form>
42 {% endblock %}