diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-10-22 12:29:55 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-10-22 12:29:55 -0400 |
commit | 9e2c420461cef709811ac84f958fae20b93b800b (patch) | |
tree | d5add39f231a9edb86988173cc938f6a1b21532f /themes/alps | |
parent | 8de661b3bb47eec32cfbfab52c404e9fd610e8e2 (diff) | |
download | alps-9e2c420461cef709811ac84f958fae20b93b800b.tar.gz alps-9e2c420461cef709811ac84f958fae20b93b800b.zip |
Categorize and normalize folder listing
Diffstat (limited to 'themes/alps')
-rw-r--r-- | themes/alps/assets/style.css | 3 | ||||
-rw-r--r-- | themes/alps/mailbox.html | 51 |
2 files changed, 35 insertions, 19 deletions
diff --git a/themes/alps/assets/style.css b/themes/alps/assets/style.css index 6d107de..2ba4af7 100644 --- a/themes/alps/assets/style.css +++ b/themes/alps/assets/style.css @@ -127,7 +127,8 @@ footer { text-align: right; } aside { flex: 0 0 180px; } -aside a { width: 100%; display: block; padding: 0.4rem 0 0.4rem 0.5rem; } +aside a, +aside .noselect { width: 100%; display: block; padding: 0.4rem 0 0.4rem 0.5rem; } aside a.active { font-weight: bold; color: black; text-decoration: none; } aside img { display: block; } main { 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 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"> |