aboutsummaryrefslogtreecommitdiff
path: root/themes
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
parent0a9c246794b7cec7e5ec510dd8af158e1d88cb82 (diff)
downloadalps-9a7acd27919900edae5a8cdda29e02fd96d2f1ce.tar.gz
alps-9a7acd27919900edae5a8cdda29e02fd96d2f1ce.zip
Add INBOX unread count on mailbox/message pages
Diffstat (limited to 'themes')
-rw-r--r--themes/alps/mailbox.html20
-rw-r--r--themes/alps/message.html11
2 files changed, 20 insertions, 11 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>
diff --git a/themes/alps/message.html b/themes/alps/message.html
index 521e835..1d74489 100644
--- a/themes/alps/message.html
+++ b/themes/alps/message.html
@@ -32,7 +32,6 @@
<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 }}>
@@ -41,9 +40,15 @@
{{else}}
{{.Name}}
{{end}}
- {{ if eq $current.Name .Name }}
- {{ if $current.Unseen }}({{ $current.Unseen }}){{ 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>