From 02bc8f68c92e7a3a559d9716c7689840e6c2a306 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 13 May 2020 13:01:20 -0400 Subject: message view: add part switcher This also makes the appearance of HTML emails more consistent with plaintext ones. --- themes/alps/message.html | 101 +++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 35 deletions(-) (limited to 'themes/alps/message.html') diff --git a/themes/alps/message.html b/themes/alps/message.html index da4cb9e..7fbbd41 100644 --- a/themes/alps/message.html +++ b/themes/alps/message.html @@ -1,6 +1,32 @@ {{template "head.html" .}} {{template "nav.html" .}} +{{define "message-part-tree"}} + {{/* nested templates can't access the parent's context */}} + {{$ = index . 0}} + {{with index . 1}} + + {{if eq $.Part.PathString .PathString}}{{end}} + {{.String}} + {{if eq $.Part.PathString .PathString}}{{end}} + + {{if gt (len .Children) 0}} + + {{end}} + {{end}} +{{end}} +
{{$current := .Mailbox}}
- - - - - - - - - - - - - - - - {{if .Message.Envelope.Cc}} - - - - {{end}} - {{if .Message.Envelope.Bcc}} - - - - - {{ end }} -
-

- {{if .Message.Envelope.Subject}} - {{.Message.Envelope.Subject}} - {{else}} - (No subject) - {{end}} -

-
From:{{template "addr-list" .Message.Envelope.From}}
Date:{{.Message.Envelope.Date | formatdate}}
To:{{template "addr-list" .Message.Envelope.To}}
Cc:{{template "addr-list" .Message.Envelope.Cc}}
Bcc:{{template "addr-list" .Message.Envelope.Bcc}}
+
+ + + + + + + + + + + + + + + + {{if .Message.Envelope.Cc}} + + + + {{end}} + {{if .Message.Envelope.Bcc}} + + + + + {{ end }} +
+

+ {{if .Message.Envelope.Subject}} + {{.Message.Envelope.Subject}} + {{else}} + (No subject) + {{end}} +

+
From:{{template "addr-list" .Message.Envelope.From}}
Date:{{.Message.Envelope.Date | formatdate}}
To:{{template "addr-list" .Message.Envelope.To}}
Cc:{{template "addr-list" .Message.Envelope.Cc}}
Bcc:{{template "addr-list" .Message.Envelope.Bcc}}
+
+ {{template "message-part-tree" (tuple $ .Message.PartTree)}} +
+
{{define "addr-list"}} {{range $i, $addr := .}} -- cgit v1.2.3