X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=8ccdcfaf007bc9daa7561a51beea9b351e72744b;hb=9a2931759c3dcbd879728b49151aa3f8a641b506;hp=7412ccf97cd00084b398bef98a071a1c9e1610f6;hpb=e3c3cde22f57bf16bc47c50d8f9ac02416975cd3;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 7412ccf9..8ccdcfaf 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -72,7 +72,7 @@ sub index_entry { $subj = PublicInbox::Hval->new_oneline($subj)->as_html; my $more = 'permalink'; my $root_anchor = $state->{root_anchor}; - my $path = $root_anchor ? '../' : ''; + my $path = $root_anchor ? '../../' : ''; my $href = $mid->as_href; my $irt = $header_obj->header('In-Reply-To'); my ($anchor_idx, $anchor, $t_anchor); @@ -84,7 +84,7 @@ sub index_entry { $t_anchor = ''; } if ($srch) { - $subj = "$subj"; + $subj = "$subj"; } if ($root_anchor && $root_anchor eq $id) { $subj = "$subj"; @@ -110,9 +110,9 @@ sub index_entry { $fh->write($rv .= "\n\n"); my ($fhref, $more_ref); - my $mhref = "${path}m/$href.html"; + my $mhref = "${path}m/$href/"; if ($level > 0) { - $fhref = "${path}f/$href.html"; + $fhref = "${path}f/$href/"; $more_ref = \$more; } # scan through all parts, looking for displayable text @@ -121,7 +121,7 @@ sub index_entry { }); $mime->body_set(''); - my $txt = "${path}m/$href.txt"; + my $txt = "${path}m/$href/raw"; $rv = "\n$more raw "; $rv .= html_footer($mime, 0, undef, $ctx); @@ -129,14 +129,14 @@ sub index_entry { unless (defined $anchor) { my $v = PublicInbox::Hval->new_msgid($irt); $v = $v->as_href; - $anchor = "${path}m/$v.html"; + $anchor = "${path}m/$v/"; $seen->{$anchor_idx} = $anchor; } $rv .= " parent"; } if ($srch) { - $rv .= " " . + $rv .= " " . "threadlink"; } @@ -173,9 +173,9 @@ sub emit_thread_html { my $final_anchor = $state->{anchor_idx}; my $next = ""; $next .= $final_anchor == 1 ? 'only message in' : 'end of'; - $next .= " thread, back to index\n"; - $mid = PublicInbox::Hval->new_msgid($mid)->as_href; - $next .= "download: mbox.gz\n\n"; + $next .= " thread, back to index\n"; + # $mid = PublicInbox::Hval->new_msgid($mid)->as_href; + $next .= "download: mbox.gz\n\n"; $fh->write("
" . PRE_WRAP . $next . $foot . ""); $fh->close; @@ -361,7 +361,7 @@ sub headers_to_html_header { } elsif ($h eq 'Subject') { $title[0] = $v->as_html; if ($srch) { - $rv .= "$h: "; + $rv .= "$h: "; $rv .= $v->as_html . "\n"; next; } @@ -371,8 +371,8 @@ sub headers_to_html_header { } $rv .= 'Message-ID: <' . $mid->as_html . '> '; - $mid_href = "../m/$mid_href" unless $full_pfx; - $rv .= "(raw)\n"; + my $raw_ref = $full_pfx ? 'raw' : "../../m/$mid_href/raw"; + $rv .= "(raw)\n"; my $irt = $header_obj->header('In-Reply-To'); if (defined $irt) { @@ -380,7 +380,7 @@ sub headers_to_html_header { my $html = $v->as_html; my $href = $v->as_href; $rv .= "In-Reply-To: <"; - $rv .= "$html>\n"; + $rv .= "$html>\n"; } my $refs = $header_obj->header('References'); @@ -437,12 +437,12 @@ sub html_footer { my $href = "mailto:$to?In-Reply-To=$irt&Cc=${cc}&Subject=$subj"; my $srch = $ctx->{srch} if $ctx; - my $idx = $standalone ? " index" : ''; + my $idx = $standalone ? " index" : ''; if ($idx && $srch) { $irt = $mime->header('In-Reply-To') || ''; $mid = mid_compress(mid_clean($mid)); my $t_anchor = length $irt ? T_ANCHOR : ''; - $idx = " ". + $idx = " ". "threadlink$idx"; my $res = $srch->get_followups($mid); if (my $c = $res->{total}) { @@ -461,7 +461,7 @@ sub html_footer { if ($irt) { $irt = PublicInbox::Hval->new_msgid($irt); $irt = $irt->as_href; - $irt = "parent "; + $irt = "parent "; } else { $irt = ' ' x length('parent '); } @@ -476,7 +476,7 @@ sub linkify_ref { my $v = PublicInbox::Hval->new_msgid($_[0]); my $html = $v->as_html; my $href = $v->as_href; - "<$html>"; + "<$html>"; } sub anchor_for { @@ -511,7 +511,7 @@ sub simple_dump { my $m = PublicInbox::Hval->new_msgid($mid); $f = PublicInbox::Hval->new($f); $d = PublicInbox::Hval->new($d); - $m = $m->as_href . '.html'; + $m = $m->as_href . '/'; $f = $f->as_html; $d = $d->as_html . ' UTC'; if (length($s) == 0) { @@ -592,7 +592,7 @@ sub missing_thread { my $title = 'Thread does not exist'; $cb->([404, ['Content-Type' => 'text/html']])->write(<$title
$title
-Return to index
+Return to index EOF }