Mercurial > public > sg101
diff gpp/templates/search/search.html @ 323:0c18dfb1da1c
Fixing #149; adding the ygroup application: an archive of the old Yahoo Group messages.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 20 Feb 2011 00:31:54 +0000 |
parents | 88b2b9cb8c1f |
children | b1f939b1fb01 |
line wrap: on
line diff
--- a/gpp/templates/search/search.html Sat Feb 12 21:37:17 2011 +0000 +++ b/gpp/templates/search/search.html Sun Feb 20 00:31:54 2011 +0000 @@ -1,9 +1,30 @@ {% extends 'base.html' %} {% load highlight %} {% block title %}Search{% endblock %} +{% block custom_js %} +<script type="text/javascript"> +//<![CDATA[ +$(document).ready(function() { + chkboxes = $('#search-form input[type="checkbox"]'); + $('#chk_all').click(function() { + chkboxes.each(function(index) { + $(this).attr('checked', true); + }); + return false; + }); + $('#chk_none').click(function() { + chkboxes.each(function(index) { + $(this).attr('checked', false); + }); + return false; + }); +}); +//]]> +</script> +{% endblock %} {% block content %} <h2>Search <img src="{{ STATIC_URL }}icons/magnifier.png" alt="Search" /></h2> -<form method="get" action="."> +<form id="search-form" method="get" action="."> <table> <tr> <td><input type="text" name="q" id="id_q" size="48" class="text" /></td> @@ -14,17 +35,29 @@ <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> + <td><input id="chk-forums" type="checkbox" name="models" value="forums.post" checked="checked" /> + <label for="chk-forums" class="pointer">Forum Posts</label></td> + <td><input id="chk-news" type="checkbox" name="models" value="news.story" checked="checked" /> + <label for="chk-news" class="pointer">News Stories</label></td> + <td><input id="chk-profiles" type="checkbox" name="models" value="bio.userprofile" checked="checked" /> + <label for="chk-profiles" class="pointer">User Profiles</label></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> + <td><input id="chk-links" type="checkbox" name="models" value="weblinks.link" checked="checked" /> + <label for="chk-links" class="pointer">Links</label></td> + <td><input id="chk-dls" type="checkbox" name="models" value="downloads.download" checked="checked" /> + <label for="chk-dls" class="pointer">Downloads</label></td> + <td><input id="chk-podcasts" type="checkbox" name="models" value="podcast.item" checked="checked" /> + <label for="chk-podcasts" class="pointer">Podcasts</label></td> + </tr> + <tr> + <td colspan="2"><input id="chk-ygroup" type="checkbox" name="models" value="ygroup.post" checked="checked" /> + <label for="chk-ygroup" class="pointer">Yahoo Group Archives</label></td> </tr> </table> +<p><a href="#" id="chk_all">Check all</a> | <a href="#" id="chk_none">Check none</a></p> </fieldset> +</form> {% if query %} <h3>Results for "{{ query }}" page {{ page.number }} of {{ page.paginator.num_pages }}</h3> @@ -60,5 +93,4 @@ {% else %} {# Show some example queries to run, maybe query syntax, something else? #} {% endif %} -</form> {% endblock %}