Mercurial > public > sg101
view gpp/templates/search/search.html @ 317:2934a867c2ef
Updating home page text for #147. Several other minor tweaks; adding favicon.ico.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 02 Feb 2011 20:37:17 +0000 |
parents | 88b2b9cb8c1f |
children | 0c18dfb1da1c |
line wrap: on
line source
{% extends 'base.html' %} {% load highlight %} {% block title %}Search{% endblock %} {% block content %} <h2>Search <img src="{{ STATIC_URL }}icons/magnifier.png" alt="Search" /></h2> <form method="get" action="."> <table> <tr> <td><input type="text" name="q" id="id_q" size="48" class="text" /></td> <td><input type="submit" value="Search" /></td> </tr> </table> <fieldset> <legend>Search in:</legend> <table> <tr> <td><input type="checkbox" name="models" value="forums.post" checked="checked" />Forum Posts</td> <td><input type="checkbox" name="models" value="news.story" checked="checked" />News Stories</td> <td><input type="checkbox" name="models" value="bio.userprofile" checked="checked" />User Profiles</td> </tr> <tr> <td><input type="checkbox" name="models" value="weblinks.link" checked="checked" />Links</td> <td><input type="checkbox" name="models" value="downloads.download" checked="checked" />Downloads</td> <td><input type="checkbox" name="models" value="podcast.item" checked="checked" />Podcasts</td> </tr> </table> </fieldset> {% if query %} <h3>Results for "{{ query }}" page {{ page.number }} of {{ page.paginator.num_pages }}</h3> {% if page.paginator.count %} <p> <strong>{{ page.paginator.count }} hit{{ page.paginator.count|pluralize }}</strong> </p> {% endif %} {% if page.object_list %} <dl> {% for result in page.object_list %} <dt> {{ result.verbose_name }}: <a href="{{ result.object.get_absolute_url }}">{{ result.object.search_title }}</a> ({{ result.score }}) </dt> <dd> {% highlight result.object.search_summary with query css_class "highlight" max_length 200 %} </dd> {% endfor %} </dl> {% else %} <p>No results found for <em>{{ query }}</em>.</p> {% endif %} {% if page.has_previous or page.has_next %} <div> {% if page.has_previous %}<a href="?q={{ query }}&page={{ page.previous_page_number }}">{% endif %}« Previous{% if page.has_previous %}</a>{% endif %} | {% if page.has_next %}<a href="?q={{ query }}&page={{ page.next_page_number }}">{% endif %}Next »{% if page.has_next %}</a>{% endif %} </div> {% endif %} {% else %} {# Show some example queries to run, maybe query syntax, something else? #} {% endif %} </form> {% endblock %}