aboutsummaryrefslogtreecommitdiff
path: root/themes/alps
diff options
context:
space:
mode:
Diffstat (limited to 'themes/alps')
-rw-r--r--themes/alps/assets/style.css3
-rw-r--r--themes/alps/mailbox.html51
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&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">