From 9526d790213c4e2b39c179c4fcc1682259b13975 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 17 Feb 2011 09:18:53 -0500 Subject: [PATCH] make the zero-hits case work for search results --- Open-ILS/web/css/skin/default/opac/style.css | 1 + .../templates/default/opac/parts/result/header.tt2 | 60 -------------------- .../default/opac/parts/result/lowhits.tt2 | 11 ++-- .../templates/default/opac/parts/result/table.tt2 | 66 +++++++++++++++++++++- Open-ILS/web/templates/default/opac/results.tt2 | 8 +-- 5 files changed, 72 insertions(+), 74 deletions(-) delete mode 100644 Open-ILS/web/templates/default/opac/parts/result/header.tt2 diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index 5fcfe9d029..3a8a94aee7 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -720,6 +720,7 @@ div.select-wrapper:hover { #zero_hits_term { text-transform: uppercase; + font-weight: bold; } #zero_search_hits #spell_check_link { diff --git a/Open-ILS/web/templates/default/opac/parts/result/header.tt2 b/Open-ILS/web/templates/default/opac/parts/result/header.tt2 deleted file mode 100644 index 67f6193bf0..0000000000 --- a/Open-ILS/web/templates/default/opac/parts/result/header.tt2 +++ /dev/null @@ -1,60 +0,0 @@ -[% q = query | url; - np_link = '?query=' _ q; - IF loc; - np_link = np_link _ "&loc=" _ loc; - END; - IF depth or depth == 0; - np_link = np_link _ "&depth=" _ depth; - END; - ctx.result_start = 1 + ctx.page_size * page; - ctx.result_stop = 1 + ctx.page_size * (page + 1); - IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END; -%] -
-[% BLOCK results_count_header %] -
- - - - - - -
Search Results - [% l("Results") %] - [% ctx.result_start %] -  - - [% ctx.result_stop %] -  [% l("of") %] - [% ctx.hit_count %] - - (page - [% page + 1 %] -  [% l("of") %] - [% page_count %]) - - - - [% IF page > 0 %] - - Previous - - [% END %] - - - - [% IF (page + 1) < page_count %] - - Next - - [% END %] - -
-
-[% END %] -[% ctx.results_count_header = PROCESS results_count_header; - ctx.results_count_header %] diff --git a/Open-ILS/web/templates/default/opac/parts/result/lowhits.tt2 b/Open-ILS/web/templates/default/opac/parts/result/lowhits.tt2 index a35876afc3..1afe8b0f17 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/lowhits.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/lowhits.tt2 @@ -1,9 +1,8 @@ - -
-
+
+

Sorry, no entries were found for - ""
+ [% query | html %]
Did you mean ?

@@ -28,7 +27,8 @@ Change to Advanced Keyword Search.

- Adjacency Multiple words are not searched together as a phrase. They will + Adjacency
+ Multiple words are not searched together as a phrase. They will be found in various parts of the record. To search for a phrase, enclose your search terms in quotation marks.
(example: "garcia marquez") @@ -90,4 +90,3 @@

- diff --git a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 index b602af25c4..0e77bbb1cc 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 @@ -1,6 +1,67 @@ [% PROCESS "default/opac/parts/marc_misc.tt2"; - SET result_count = ctx.result_start; %] - + + q = query | url; + np_link = '?query=' _ q; + IF loc; + np_link = np_link _ "&loc=" _ loc; + END; + IF depth or depth == 0; + np_link = np_link _ "&depth=" _ depth; + END; + ctx.result_start = 1 + ctx.page_size * page; + ctx.result_stop = 1 + ctx.page_size * (page + 1); + IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END; + + result_count = ctx.result_start; +%] +
+[% BLOCK results_count_header %] +
+ + + + + + +
Search Results + [% l("Results") %] + [% ctx.result_start %] +  - + [% ctx.result_stop %] +  [% l("of") %] + [% ctx.hit_count %] + + (page + [% page + 1 %] +  [% l("of") %] + [% page_count %]) + + + + [% IF page > 0 %] + + Previous + + [% END %] + + + + [% IF (page + 1) < page_count %] + + Next + + [% END %] + +
+
+[% END %] +[% ctx.results_count_header = PROCESS results_count_header; + ctx.results_count_header %]
@@ -208,4 +269,3 @@ [% ctx.results_count_header %] - diff --git a/Open-ILS/web/templates/default/opac/results.tt2 b/Open-ILS/web/templates/default/opac/results.tt2 index e698e87ba3..3c992923ae 100644 --- a/Open-ILS/web/templates/default/opac/results.tt2 +++ b/Open-ILS/web/templates/default/opac/results.tt2 @@ -55,11 +55,9 @@
- [% INCLUDE "default/opac/parts/result/header.tt2" %] -
- [% INCLUDE "default/opac/parts/result/table.tt2" %] - [% INCLUDE "default/opac/parts/result/lowhits.tt2" %] -
+ [% path = "default/opac/parts/result/" _ + (ctx.records.size ? "table.tt2" : "lowhits.tt2"); + INCLUDE $path %]
-- 2.11.0