diff options
author | yvesf <yvesf-git@xapek.org> | 2010-11-20 12:04:39 +0100 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2010-11-20 12:04:39 +0100 |
commit | d66c0d42b678408921f5c3cb43c18df5b1f87338 (patch) | |
tree | 4e237edbe090f019eb76ab99bc446109469f2b2f /templates/search.html | |
parent | edae6bad0f61ae37593aef7efd5386525562c833 (diff) | |
download | booksearch-d66c0d42b678408921f5c3cb43c18df5b1f87338.tar.gz booksearch-d66c0d42b678408921f5c3cb43c18df5b1f87338.zip |
web interface
Diffstat (limited to 'templates/search.html')
-rw-r--r-- | templates/search.html | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/templates/search.html b/templates/search.html index 0c5f3d6..5f68355 100644 --- a/templates/search.html +++ b/templates/search.html @@ -1,18 +1,13 @@ -<html> - <head> - <title>{{ objects.__len__() + skip}} matches</title> -<script> -function start() { -var inputField = document.getElementById("search"); -window.location = "/search/" + inputField.value; -} -</script> - </head> - <body> -<div> -<input id="search" type="text"/> -<button onclick="start()">Go</button> -</div> +{% extends "_base.html" %} +{% block title %} + {% if term != "" %} + {{ term }} + {% else %} + Start a new Search + {% endif %} +{% endblock %} +{% block searchValue %}{{ term }}{% endblock %} +{% block content %} {% if objects.__len__() == 0 %} No Matches {% else %} @@ -36,14 +31,15 @@ window.location = "/search/" + inputField.value; {% endfor %} {% endif %} - <div> - {% if skip > 0 %} - <a href="{{ url_for("do_search", term=term, skip=skip-5) }}">Previous 5</a> - {% else %} - Previous 5 + <div id="navigation"> + {% if term != "" %} + {% if skip > 0 %} + <a href="{{ url_for("do_search", term=term, skip=skip-5) }}">Previous 5</a> + {% else %} + Previous 5 + {% endif %} + - + <a href="{{ url_for("do_search", term=term, skip=skip+5) }}">Next 5</a> {% endif %} - - - <a href="{{ url_for("do_search", term=term, skip=skip+5) }}">Next 5</a> </div> - </body> -</html> +{% endblock %} |