- my $links = "<a\nhref=\"$help\">help</a> / ".
- "<a\nhref=\"$atom\">Atom feed</a>";
- if ($obj->search) {
- my $q_val = $ctx->{-q_value_html};
- if (defined $q_val && $q_val ne '') {
- $q_val = qq(\nvalue="$q_val");
- } else {
- $q_val = '';
- }
+ if (my $t_max = $ctx->{-t_max}) {
+ $t_max = ts2str($t_max);
+ $top = qq(<a\nhref="$upfx?t=$t_max">$top</a>);
+ # we had some kind of query, link to /$INBOX/?t=YYYYMMDDhhmmss
+ } elsif ($ctx->{qp}->{t}) {
+ $top = qq(<a\nhref="./">$top</a>);
+ } elsif (length($upfx)) {
+ $top = qq(<a\nhref="$upfx">$top</a>);
+ }
+ my $code = $ibx->{coderepo} ? qq( / <a\nhref=#code>code</a>) : '';
+ # id=mirror must exist for legacy bookmarks
+ my $links = qq(<a\nhref="${upfx}_/text/help/">help</a> / ).
+ qq(<a\nhref="${upfx}_/text/color/">color</a> / ).
+ qq(<a\nid=mirror) .
+ qq(\nhref="${upfx}_/text/mirror/">mirror</a>$code / ).
+ qq(<a\nhref="$atom">Atom feed</a>);
+ if ($ibx->isrch) {
+ my $q_val = delete($ctx->{-q_value_html}) // '';
+ $q_val = qq(\nvalue="$q_val") if $q_val ne '';