diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-11-19 13:14:12 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-11-19 13:14:12 -0500 |
commit | 51d762ac5fd21c6cac898b2e5eed2eabdb0fe841 (patch) | |
tree | 9a62e4920c44dd7f3c5afcd49f9ced7573d7f4de /themes | |
parent | 8cc742f45df7544c20f43e781d2c7e4aa6a3f4f5 (diff) | |
download | alps-51d762ac5fd21c6cac898b2e5eed2eabdb0fe841.tar.gz alps-51d762ac5fd21c6cac898b2e5eed2eabdb0fe841.zip |
Implement mailbox subscriptions
Diffstat (limited to 'themes')
-rw-r--r-- | themes/alps/assets/style.css | 12 | ||||
-rw-r--r-- | themes/alps/settings.html | 17 | ||||
-rw-r--r-- | themes/alps/util.html | 37 |
3 files changed, 37 insertions, 29 deletions
diff --git a/themes/alps/assets/style.css b/themes/alps/assets/style.css index e64c8a3..d652f66 100644 --- a/themes/alps/assets/style.css +++ b/themes/alps/assets/style.css @@ -88,7 +88,8 @@ input[type="file"], input[type="number"], input[type="date"], input[type="time"], -textarea { +textarea, +select { margin: 0; border: none; border: 1px solid #e0e0e0; @@ -157,7 +158,7 @@ aside ul { aside li { width: 100%; display: flex; - padding: 0.4rem 0 0.4rem 0.5rem; + padding: 0.4rem 0.5rem; } aside li a { @@ -654,7 +655,8 @@ main table tfoot { .action-group label, .action-group input, -.action-group textarea { +.action-group textarea, +.action-group select { display: block; width: 100%; } @@ -665,6 +667,10 @@ main table tfoot { float: left; } +.action-group select { + height: 10rem; +} + .actions-message, .actions-contacts { display: flex; diff --git a/themes/alps/settings.html b/themes/alps/settings.html index 9fc58ca..61e76e6 100644 --- a/themes/alps/settings.html +++ b/themes/alps/settings.html @@ -33,6 +33,23 @@ </div> <div class="action-group"> + <label for="subscriptions">Subscribed folders</label> + <select name="subscriptions" id="subscriptions" multiple> + {{ $subs := .Subscriptions }} + {{ range .Mailboxes }} + {{ if and (ne .Name "INBOX") (not (.HasAttr "\\Noselect")) }} + <option + value="{{.Name}}" + {{ if $subs.Has .Name }} + selected + {{ end }} + >{{.Name}}</option> + {{ end }} + {{ end }} + </select> + </div> + + <div class="action-group"> <label for="messages_per_page">Messages per page</label> <input type="number" diff --git a/themes/alps/util.html b/themes/alps/util.html index 535714f..9cdfd86 100644 --- a/themes/alps/util.html +++ b/themes/alps/util.html @@ -1,43 +1,28 @@ {{ define "mbox-link" }} -{{ if not (.HasAttr "\\Noselect") }} -<li {{ if .Active }}class="active"{{ end }}> - <a href="{{.URL}}"> - {{- if eq .Name "INBOX" -}} +{{ if not (.Info.HasAttr "\\Noselect") }} +<li {{ if .Info.Active }}class="active"{{ end }}> + <a href="{{.Info.URL}}"> + {{- if eq .Info.Name "INBOX" -}} Inbox {{- else -}} - {{ .Name }} + {{ .Info.Name }} {{- end -}} - {{- if .HasAttr "\\HasChildren" }}/{{ end }} + {{- if .Info.HasAttr "\\HasChildren" }}/{{ end }} </a> - <!-- TODO - <button - type="submit" - name="subscribe" - value="{{.Name}}" - form="subscribe-form" - {{ if eq .Name "INBOX" }} - title="Unsubscribe" - {{ else }} - title="Subscribe" - {{ end }} - > - {{ if eq .Name "INBOX" }} - ◉ - {{ else }} - ○ + {{ if .Status }} + {{ if .Status.Unseen }} + <span class="unseen">({{.Status.Unseen}})</span> + {{ end }} {{ end }} - </button> - --> </li> {{ else }} <li class="noselect"> - {{.Name}}{{- if .HasAttr "\\HasChildren" }}/{{ end }} + {{.Info.Name}}{{- if .Info.HasAttr "\\HasChildren" }}/{{ end }} </li> {{ end }} {{ end }} {{ define "aside" }} -<form id="subscribe-form" method="POST"></form> <aside> <ul> <!-- the logo image, dimensions 200x32 may be present or not --> |