comparison gpp/templates/search/search.html @ 438:524fd1b3919a

Fixing #214; don't need a custom model search view. All the info is in the template. Wrote a template tag to extract the info from the request context and urlencode them.
author Brian Neal <bgneal@gmail.com>
date Wed, 18 May 2011 03:04:25 +0000
parents aabee29cadac
children
comparison
equal deleted inserted replaced
437:a8ac4dd3bf03 438:524fd1b3919a
1 {% extends 'base.html' %} 1 {% extends 'base.html' %}
2 {% load highlight %} 2 {% load highlight %}
3 {% load core_tags %}
3 {% block title %}Search{% endblock %} 4 {% block title %}Search{% endblock %}
4 {% block custom_js %} 5 {% block custom_js %}
5 <script type="text/javascript"> 6 <script type="text/javascript">
6 //<![CDATA[ 7 //<![CDATA[
7 $(document).ready(function() { 8 $(document).ready(function() {
59 <p>No results found for <em>{{ query }}</em>.</p> 60 <p>No results found for <em>{{ query }}</em>.</p>
60 {% endif %} 61 {% endif %}
61 62
62 {% if page.has_previous or page.has_next %} 63 {% if page.has_previous or page.has_next %}
63 <div> 64 <div>
64 {% if page.has_previous %}<a href="?{{ search_params }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %} 65 {% if page.has_previous %}<a href="?{% encode_params request.GET 'q' 'models' %}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
65 | 66 |
66 {% if page.has_next %}<a href="?{{ search_params }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %} 67 {% if page.has_next %}<a href="?{% encode_params request.GET 'q' 'models' %}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
67 </div> 68 </div>
68 {% endif %} 69 {% endif %}
69 {% else %} 70 {% else %}
70 {# Show some example queries to run, maybe query syntax, something else? #} 71 {# Show some example queries to run, maybe query syntax, something else? #}
71 {% endif %} 72 {% endif %}