alps/plugins/base/public/mailbox.html
Drew DeVault 1cf95af41e
Add <meta refresh> to mailbox view
This causes the mailbox to automatically reload the page every 60
seconds, without JavaScript.

This also updates the base template data to include the full URL, and
replaces the earlier "Path" field with a pre-split array of path
components, which is more immediately useful to most templates given the
limitations of string munging with text/template primitives.
2020-05-13 16:58:48 +02:00

58 lines
1.3 KiB
HTML

{{template "head.html" .}}
<h1>alps</h1>
<p>
<a href="/logout">Logout</a>
· <a href="/compose">Compose</a>
· <a href="/settings">Settings</a>
</p>
<h2>{{.Mailbox.Name}}</h2>
<form method="get" action="">
<input type="search" name="query" value="{{.Query}}">
<input type="submit" value="Search">
</form>
<p>Mailboxes:</p>
<ul>
{{range .Mailboxes}}
<li><a href="/mailbox/{{.Name | pathescape}}">{{.Name}}</a></li>
{{end}}
</ul>
{{if .Messages}}
<p>Messages:</p>
<ul>
{{range .Messages}}
<li>
<a href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}">
{{if .Envelope.Subject}}
{{.Envelope.Subject}}
{{else}}
(No subject)
{{end}}
</a>
{{if .Attachments}}📎{{end}}
{{if .HasFlag "\\Answered"}}↩{{end}}
{{if .HasFlag "$Forwarded"}}↪{{end}}
{{if .HasFlag "\\Flagged"}}⭐{{end}}
</li>
{{end}}
</ul>
<p>
{{if ge .PrevPage 0}}
<a href="?page={{.PrevPage}}&query={{.Query}}">Prev</a>
{{end}}
{{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}}
{{if ge .NextPage 0}}
<a href="?page={{.NextPage}}&query={{.Query}}">Next</a>
{{end}}
</p>
{{else}}
<p>No message.</p>
{{end}}
{{template "foot.html"}}