From a94d9d750e3c75ba642fdfd6da67722f36cf8b92 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 11 Aug 2011 17:17:40 -0400 Subject: [PATCH] TTpac: removed last bits of propagator; minor cleanup Signed-off-by: Bill Erickson --- .../web/templates/default/opac/parts/header.tt2 | 21 +++++----------- .../templates/default/opac/parts/result/table.tt2 | 29 +++++++++------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/Open-ILS/web/templates/default/opac/parts/header.tt2 b/Open-ILS/web/templates/default/opac/parts/header.tt2 index 1298754118..66e47ac7c0 100644 --- a/Open-ILS/web/templates/default/opac/parts/header.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/header.tt2 @@ -7,22 +7,11 @@ # Don't wrap in l() here; do that where this format string is actually used. SET HUMAN_NAME_FORMAT = '[_1] [_2] [_3] [_4] [_5]'; - # x and y are artifacts of using tags instead of - # true submit buttons, and their values are never used. page is used, but - # currently none of the use cases for rendering the query_string back - # into page output call for propagating the value of the page variable. - - query_string = CGI.query_string | - replace(';x=\d+','') | replace(';y=\d+','') | replace(';page=\d*', '') | - replace(';', '&') | replace('&', '&'); - - propagator = '?' _ query_string; - is_advanced = CGI.param("_adv").size; is_special = CGI.param("_special").size; # ----------------------------------------------------------------------------- - # mkurl() + # mkurl( destination_page, params_to_set, params_to_clear ) # # Current page, updated params: # mkurl('', {foo => 'bar', boo => 'baz'}); @@ -33,7 +22,7 @@ # New page, clear all existing params before applying new ones: # mkurl('/fuz/buster', {foo => 'bar', boo => 'baz'}, 1); # - # Current page, clear the 'some_param' from the existing params: + # Current page, clear 'some_param' from the existing params: # mkurl('', {foo => 'bar', boo => 'baz'}, ['some_param']); MACRO mkurl(page, params, clear_params) BLOCK; @@ -47,14 +36,15 @@ cgi.delete_all(); END; - # always remove these pesky artifacts + # x and y are artifacts of using tags + # instead of true submit buttons, and their values are never used. cgi.delete('x', 'y'); # apply user params FOR k IN params.keys; encoded = []; list = params.$k.0 ? params.$k : [params.$k]; - # CGI croaks on already-decoded strings. force-encode to be safe + # CGI croaks on already-decoded strings. force-encode to be safe. FOR p IN list; encoded.push(ctx.encode_utf8(p)); END; foo = cgi.param("-name", k, "-values", encoded); END; @@ -72,6 +62,7 @@ page; END; ELSE; + # staying on the current page cgi.url("-path" => 1, "-query" => 1); END; END; 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 b79a536234..568697118a 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 @@ -25,7 +25,7 @@ [% class = 'search_page_nav_link'; href = '#'; IF page > 0; - href = propagator _ '&page=' _ (page - 1); + href = mkurl('', {page => page - 1}); ELSE; class = class _ ' invisible'; END; %] page + 1}); ELSE; class = class _ ' invisible'; END; %] [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] - [% l('Image of item') %][% l('Image of item') %]
[% END %] @@ -88,16 +88,17 @@ valign="top">
[% attrs.author %] + href="[%- + authorquery = attrs.author | replace('[,\.:;]', ''); + mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}) + -%]">[% attrs.author | html_entity %]    [% attrs.pubdate %]
@@ -177,7 +178,7 @@
[% l('Place hold') %][% l('Place Hold') %] @@ -189,21 +190,15 @@
- +
- +
-
-- 2.11.0