-# Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
+# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
package PublicInbox::View;
use strict;
$from = PublicInbox::Hval->new_oneline($from)->as_html;
$subj = PublicInbox::Hval->new_oneline($subj)->as_html;
my $more = 'permalink';
- my $root_anchor = $state->{root_anchor};
+ my $root_anchor = $state->{root_anchor} || '';
my $path = $root_anchor ? '../../' : '';
my $href = $mid->as_href;
my $irt = in_reply_to($header_obj);
my $t = $ctx->{flat} ? 'T' : 't';
$subj = "<a\nhref=\"${path}$href/$t/#u\">$subj</a>";
}
- if ($root_anchor && $root_anchor eq $id) {
+ if ($root_anchor eq $id) {
$subj = "<u\nid=\"u\">$subj</u>";
}
my ($fhref, $more_ref);
my $mhref = "${path}$href/";
- # show full messages at level == 0 in threaded view
- if ($level > 0 || ($ctx->{flat} && $root_anchor ne $id)) {
+ # show full message if it's our root message
+ if ($root_anchor ne $id) {
$fhref = "${path}$href/f/";
$more_ref = \$more;
}
foreach my $g (@$ghost) {
$$cb->write("<table\nsummary=ghost><tr><td>" .
(INDENT x $g->[1]) . "</td><td>" .
- PRE_WRAP . ghost_parent('', $g->[0]) .
+ PRE_WRAP . ghost_parent('../', $g->[0]) .
'</pre></td></table>');
}
}