diff --git a/AdvSearchPage.py b/AdvSearchPage.py index 55347a9..5fc44f5 100644 --- a/AdvSearchPage.py +++ b/AdvSearchPage.py @@ -26,6 +26,7 @@ import cherrypy import routes from sqlalchemy import or_, and_, select +from genshi.filters import HTMLFormFiller from libgutenberg.Models import ( Alias, Attribute, Author, Book, BookAuthor, Category, File, Lang, Locc, Subject) @@ -201,6 +202,7 @@ class AdvSearchPage(Page): else: os.entries = entries(resultpks, offset) os.search_terms = selections - rendered = self.formatter.render('advresults', os) + instance_filter = HTMLFormFiller(data=params) + rendered = self.formatter.render('advresults', os, instance_filter) session.close() return rendered diff --git a/BaseFormatter.py b/BaseFormatter.py index d16c31f..7f3f738 100644 --- a/BaseFormatter.py +++ b/BaseFormatter.py @@ -71,7 +71,7 @@ class BaseFormatter(object): cherrypy.response.headers['Content-Type'] = self.CONTENT_TYPE - def render(self, page, os): + def render(self, page, os, instance_filter=None): """ Render and send to browser. """ self.send_headers() @@ -82,6 +82,9 @@ class BaseFormatter(object): stream = template.stream for filter_ in template.filters: stream = filter_(iter(stream), ctxt) + if instance_filter: + stream = instance_filter(stream) + # there's no easy way in genshi to pass collapse_lines to this filter stream = WHITESPACE_FILTER(stream, collapse_lines=COLLAPSE_LINES) diff --git a/templates/advresults.html b/templates/advresults.html index e73eabf..1c9fae1 100644 --- a/templates/advresults.html +++ b/templates/advresults.html @@ -70,7 +70,6 @@

More than 1000 books matched your search. Please refine your query to see results.

-
@@ -135,7 +134,7 @@ - + diff --git a/templates/advsearch.html b/templates/advsearch.html index 98bb1db..f2a7a81 100644 --- a/templates/advsearch.html +++ b/templates/advsearch.html @@ -1,457 +1,457 @@
-
- + +

- +

- +

- +

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

- + + + + + + + + + +

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +