#
# Current page, clear 'some_param' from the existing params:
# mkurl('', {foo => 'bar', boo => 'baz'}, ['some_param']);
- MACRO mkurl(page, params, clear_params) BLOCK;
+ #
+ # Current page to a named anchor 'copies'
+ # mkurl('', {}, [], 'copies');
+ MACRO mkurl(page, params, clear_params, named_anchor) BLOCK;
# clone the query string to avoid clobberation
cgi = CGI.new(CGI.query_string);
IF val == ''; cgi.delete(p); END;
END;
+ final = named_anchor ? '#' _ named_anchor : '';
+
IF page;
IF cgi.query_string;
- page _ '?' _ cgi.query_string;
+ page _ '?' _ cgi.query_string _ final;
ELSE;
- page;
+ page _ final;
END;
ELSE;
# staying on the current page
- cgi.url("-path" => 1, "-query" => 1);
+ cgi.url("-path" => 1, "-query" => 1) _ final;
END;
END;
ctx.get_aou(item.org_unit).name;
'</span>';
FOREACH summary IN item.holding_summaries;
- '<li><a href="' _ mkurl('', {sid => summary.id, stype => summary.summary_type}, ['selimit', 'sepath', 'seoffset']) _ '">';
+ IF summary.holdings;
+ link = mkurl(
+ '', {},
+ ['sid','stype','selimit','sepath','seoffset'], 'issues'
+ );
+ link_title = l('Collapse');
+ ELSE;
+ link = mkurl(
+ '', {sid => summary.id, stype => summary.summary_type},
+ ['selimit','sepath','seoffset'], 'issues'
+ );
+ link_title = l('Expand');
+ END;
+ '<li><a href="' _ link _ '" title="' _ link_title _ '">';
summary.generated_coverage.join(", ");
'</a></li>';
IF summary.holdings;
soffset_next = soffset + slimit;
%]
[% IF soffset > 0 %]
- <a href="[% mkurl('', {soffset => soffset_prev}, ['sid','stype']) %]>[% l('Previous') %]</a>
+ <a href="[% mkurl('', {soffset => soffset_prev}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]>[% l('Previous') %]</a>
[% END %]
[% IF ctx.holding_summary_tree.more %]
- <a href="[% mkurl('', {soffset => soffset_next}, ['sid','stype']) %]">[% l('Next') %]</a>
+ <a href="[% mkurl('', {soffset => soffset_next}, ['sid','stype','sepath','selimit','seoffset'], 'issues') %]">[% l('Next') %]</a>
[% END %]
</div>
[% IF ctx.mfhd_summaries.size; %]