aboutsummaryrefslogtreecommitdiff
path: root/themes/alps/mailbox.html
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-05-21 19:19:17 +0200
committerSimon Ser <contact@emersion.fr>2020-05-21 19:19:17 +0200
commit9a7acd27919900edae5a8cdda29e02fd96d2f1ce (patch)
tree2f74fdf2d219e457c1b89217974f8d3b1432dae7 /themes/alps/mailbox.html
parent0a9c246794b7cec7e5ec510dd8af158e1d88cb82 (diff)
downloadalps-9a7acd27919900edae5a8cdda29e02fd96d2f1ce.tar.gz
alps-9a7acd27919900edae5a8cdda29e02fd96d2f1ce.zip
Add INBOX unread count on mailbox/message pages
Diffstat (limited to 'themes/alps/mailbox.html')
-rw-r--r--themes/alps/mailbox.html20
1 files changed, 12 insertions, 8 deletions
diff --git a/themes/alps/mailbox.html b/themes/alps/mailbox.html
index 8d9aa54..93a45ce 100644
--- a/themes/alps/mailbox.html
+++ b/themes/alps/mailbox.html
@@ -5,18 +5,22 @@
<aside>
<!-- the logo image, dimensions 200x32 may be present or not -->
<a href="/compose" class="new">Compose&nbsp;Mail</a>
- {{$current := .Mailbox}}
{{range .Mailboxes}}
- <a href="{{.URL}}"
- {{ if eq $current.Name .Name }}class="active"{{ end }}>
+ <a href="{{.URL}}" {{ if eq $.Mailbox.Name .Name }}class="active"{{ end }}>
{{ if eq .Name "INBOX" }}
Inbox
- {{else}}
- {{.Name}}
- {{end}}
- {{ if eq $current.Name .Name }}
- {{ if $current.Unseen }}({{ $current.Unseen }}){{ end }}
+ {{ 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}}
</aside>