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 | |
parent | 09d19169dae66c3ddfa3644090475b5cfd553684 (diff) | |
download | alps-490420726952bb3834e6a1cdda7a26c90ba9a7cb.tar.gz alps-490420726952bb3834e6a1cdda7a26c90ba9a7cb.zip |
Replace parts tree with attachment list
Diffstat (limited to 'themes/alps')
-rw-r--r-- | themes/alps/assets/style.css | 11 | ||||
-rw-r--r-- | themes/alps/message.html | 52 |
2 files changed, 34 insertions, 29 deletions
diff --git a/themes/alps/assets/style.css b/themes/alps/assets/style.css index 91435e0..77aaf3c 100644 --- a/themes/alps/assets/style.css +++ b/themes/alps/assets/style.css @@ -261,14 +261,21 @@ main.message .message-header { } main.message .message-header .parts { + width: 30%; margin-left: 0.3rem; - padding: 0.3rem 1rem; + padding: 0.3rem 0.5rem; background: white; border-top: 1px solid #f2f2f2; } main.message .message-header .parts ul { - margin-left: 1rem; + margin: 0; + padding: 0; + list-style: none; +} + +main.message .message-header .parts li { + margin-left: 0; } main.contact dl { 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}} |