aboutsummaryrefslogtreecommitdiff
path: root/themes/alps/mailbox.html
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-10-22 12:29:55 -0400
committerDrew DeVault <sir@cmpwn.com>2020-10-22 12:29:55 -0400
commit9e2c420461cef709811ac84f958fae20b93b800b (patch)
treed5add39f231a9edb86988173cc938f6a1b21532f /themes/alps/mailbox.html
parent8de661b3bb47eec32cfbfab52c404e9fd610e8e2 (diff)
downloadalps-9e2c420461cef709811ac84f958fae20b93b800b.tar.gz
alps-9e2c420461cef709811ac84f958fae20b93b800b.zip
Categorize and normalize folder listing
Diffstat (limited to 'themes/alps/mailbox.html')
-rw-r--r--themes/alps/mailbox.html51
1 files changed, 33 insertions, 18 deletions
diff --git a/themes/alps/mailbox.html b/themes/alps/mailbox.html
index 4582726..e09f2b7 100644
--- a/themes/alps/mailbox.html
+++ b/themes/alps/mailbox.html
@@ -1,28 +1,43 @@
{{template "head.html" .}}
{{template "nav.html" .}}
+{{ define "mbox-link" }}
+{{ if not (.HasAttr "\\Noselect") }}
+<a href="{{.URL}}" {{ if .Active }}class="active"{{ end }}>
+ {{- if eq .Name "INBOX" -}}
+ Inbox
+ {{- else -}}
+ {{ .Name }}
+ {{- end -}}
+ {{- if .HasAttr "\\HasChildren" }}/{{ end }}
+
+ {{ if and (ne .Unseen -1) (ne .Unseen 0) }}({{ .Unseen }}){{ end }}
+</a>
+{{ else }}
+<span class="noselect">
+ {{.Name}}{{- if .HasAttr "\\HasChildren" }}/{{ end }}
+</span>
+{{ end }}
+{{ end }}
+
<div class="page-wrap">
<aside>
<!-- the logo image, dimensions 200x32 may be present or not -->
<a href="/compose" class="new">Compose&nbsp;Mail</a>
- {{range .Mailboxes}}
- <a href="{{.URL}}" {{ if eq $.Mailbox.Name .Name }}class="active"{{ end }}>
- {{ if eq .Name "INBOX" }}
- Inbox
- {{ else }}
- {{ .Name }}
- {{ end }}
-
- {{ $unseen := 0 }}
- {{ if eq .Name "INBOX" }}
- {{ $unseen = $.Inbox.Unseen }}
- {{ end }}
- {{ if eq .Name $.Mailbox.Name }}
- {{ $unseen = $.Mailbox.Unseen }}
- {{ end }}
- {{ if $unseen }}({{ $unseen }}){{ end }}
- </a>
- {{end}}
+ {{ with .CategorizedMailboxes }}
+ {{ with .Common.Inbox }}{{ template "mbox-link" . }}{{ end}}
+ {{ with .Common.Drafts }}{{ template "mbox-link" . }}{{ end}}
+ {{ with .Common.Sent }}{{ template "mbox-link" . }}{{ end}}
+ {{ with .Common.Junk }}{{ template "mbox-link" . }}{{ end}}
+ {{ with .Common.Trash }}{{ template "mbox-link" . }}{{ end}}
+ {{ with .Common.Archive }}{{ template "mbox-link" . }}{{ end}}
+ {{ if .Additional }}
+ <hr />
+ {{ range .Additional }}
+ {{ template "mbox-link" . }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
</aside>
<div class="container">