From: Lebbeous Fogle-Weekley Date: Wed, 7 Mar 2012 21:53:40 +0000 (-0500) Subject: fix nested paging. all seems well at last. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Ftpac-holdings-tree;p=evergreen%2Fequinox.git fix nested paging. all seems well at last. Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/templates/opac/parts/record/issues-db.tt2 b/Open-ILS/src/templates/opac/parts/record/issues-db.tt2 index a110b561cc..6e9179ca9f 100644 --- a/Open-ILS/src/templates/opac/parts/record/issues-db.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/issues-db.tt2 @@ -1,6 +1,10 @@ [%- expand_path = CGI.param('sepath') || []; +expand_path = expand_path.list; # sic + seoffset_list = CGI.param('seoffset') || []; +seoffset_list = seoffset_list.list; # sic + IF expand_path.size == 0 AND seoffset_list.size == 0; seoffset_list = [0,0]; # compensate for $auto_expand_first; see ML END; @@ -12,8 +16,8 @@ ght_depth = 0; VIEW grouped_holding_tree; BLOCK list; '
'; - prev_seoffset_list = seoffset_list.slice(0, ght_depth + 1); - next_seoffset_list = seoffset_list.slice(0, ght_depth + 1); + prev_seoffset_list = seoffset_list.slice(0, ght_depth); + next_seoffset_list = seoffset_list.slice(0, ght_depth); prev_seoffset_list.$ght_depth = prev_seoffset_list.$ght_depth - selimit; IF prev_seoffset_list.$ght_depth < 0; @@ -34,13 +38,11 @@ VIEW grouped_holding_tree; IF node.value; ght_sepath.push(node.value); - all_balls = []; - FOREACH i IN [-1 .. ght_depth]; # aka [0 .. ght_depth+1] - all_balls.push(0); - END; + new_seoffsets = seoffset_list.slice(0, ght_depth); + new_seoffsets.push(0); expand_link = mkurl( - '', {'sepath' => ght_sepath, 'seoffset' => all_balls}, + '', {'sepath' => ght_sepath, 'seoffset' => new_seoffsets}, 0, 'issues' ); @@ -54,7 +56,7 @@ VIEW grouped_holding_tree; collapse_link = mkurl( '', { 'sepath' => collapse_sepath, - 'seoffset' => all_balls.slice(0, -2) + 'seoffset' => new_seoffsets.slice(0, -2) }, collapse_clear_params, 'issues' ); @@ -81,15 +83,25 @@ VIEW grouped_holding_tree; # XXX Hold placement link here? Maybe not if no units. END; END; - IF seoffset_list.$ght_depth > 0; - ''; l('Previous'); ''; + + to_clear = 0; + new_sepath_end = ght_depth - 1; + IF new_sepath_end < 0; + to_clear = ['sepath']; + new_sepath = []; + ELSE; + new_sepath = expand_path.slice(0, ght_depth - 1); END; + IF has_more; - ''; l('Next'); ''; + '« '; l('Earlier holdings'); ''; + END; + IF seoffset_list.$ght_depth > 0; + ''; l('Later holdings'); ' »  '; END; '
'; END; diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index 4223e3cc46..51968e873f 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -1408,3 +1408,4 @@ table.result_holdings_table thead tr th { } .rdetail-holding-group { margin-left: 1.5em; } .rdetail-holding-group span { margin-left: 1.5em; } +.rdetail-holding-group .paging { margin-left: 1.5em; }