diff options
Diffstat (limited to 'themes/alps/mailbox.html')
-rw-r--r-- | themes/alps/mailbox.html | 51 |
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 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"> |