[%-
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;
VIEW grouped_holding_tree;
BLOCK list;
'<div class="rdetail-holding-group">';
- 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;
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'
);
collapse_link = mkurl(
'', {
'sepath' => collapse_sepath,
- 'seoffset' => all_balls.slice(0, -2)
+ 'seoffset' => new_seoffsets.slice(0, -2)
}, collapse_clear_params, 'issues'
);
# XXX Hold placement link here? Maybe not if no units.
END;
END;
- IF seoffset_list.$ght_depth > 0;
- '<a href="';
- mkurl('', {seoffset => prev_seoffset_list}, 0, 'issues');
- '">'; l('Previous'); '</a>';
+
+ 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;
- '<a href="';
- mkurl('', {seoffset => next_seoffset_list}, 0, 'issues');
- '">'; l('Next'); '</a>';
+ '<a class="paging" href="';
+ mkurl('',{seoffset => next_seoffset_list, sepath => new_sepath},to_clear,'issues');
+ '">« '; l('Earlier holdings'); '</a>';
+ END;
+ IF seoffset_list.$ght_depth > 0;
+ '<a class="paging" href="';
+ mkurl('',{seoffset => prev_seoffset_list, sepath => new_sepath},to_clear,'issues');
+ '">'; l('Later holdings'); ' »</a> ';
END;
'</div>';
END;