diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-10-23 16:07:59 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-10-23 16:08:40 -0400 |
commit | 490420726952bb3834e6a1cdda7a26c90ba9a7cb (patch) | |
tree | 75ab8141411e9275eae29c4c858d7ca799f18416 /themes/alps/message.html | |
parent | 09d19169dae66c3ddfa3644090475b5cfd553684 (diff) | |
download | alps-490420726952bb3834e6a1cdda7a26c90ba9a7cb.tar.gz alps-490420726952bb3834e6a1cdda7a26c90ba9a7cb.zip |
Replace parts tree with attachment list
Diffstat (limited to 'themes/alps/message.html')
-rw-r--r-- | themes/alps/message.html | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/themes/alps/message.html b/themes/alps/message.html index 74e2d0b..28287ab 100644 --- a/themes/alps/message.html +++ b/themes/alps/message.html @@ -2,32 +2,6 @@ {{template "nav.html" .}} {{template "util.html" .}} -{{define "message-part-tree"}} - {{/* nested templates can't access the parent's context */}} - {{$ = index . 0}} - {{with index . 1}} - <a - class="nav-link" - {{if .IsText}} - href="?part={{.PathString}}" - {{else}} - href="{{$.Message.URL}}raw?part={{.PathString}}" - {{end}} - > - {{if eq $.Part.PathString .PathString}}<strong>{{end}} - {{.String}} - {{if eq $.Part.PathString .PathString}}</strong>{{end}} - </a> - {{if gt (len .Children) 0}} - <ul class="nav flex-column"> - {{range .Children}} - <li class="nav-item">{{template "message-part-tree" (tuple $ .)}}</li> - {{end}} - </ul> - {{end}} - {{end}} -{{end}} - <div class="page-wrap"> {{ $current := .Mailbox }} {{ template "aside" . }} @@ -162,9 +136,32 @@ </tr> {{end}} </table> + {{ $attachments := .Message.Attachments }} + {{ if $attachments }} <section class="parts"> - {{template "message-part-tree" (tuple $ .Message.PartTree)}} + <h3>Attachments</h3> + <ul> + {{ range .Message.Attachments }} + <li> + <a + class="nav-link" + {{if .IsText}} + href="?part={{.PathString}}" + {{else}} + href="{{$.Message.URL}}/raw?part={{.PathString}}" + {{end}} + > + {{- if .Filename -}} + {{.Filename}} + {{- else -}} + (no filename) + {{- end -}} + </a> ({{.MIMEType}}, {{.SizeString}}) + </li> + {{ end }} + </ul> </section> + {{ end }} </div> {{define "addr-list"}} @@ -197,6 +194,7 @@ {{ end }} <a href="{{.Message.URL}}/raw?plain=1">Raw email</a> </div> + {{if .View}} {{.View}} {{else}} |