alps/plugins/base/public/message.html

132 lines
3.3 KiB
HTML
Raw Normal View History

{{template "head.html"}}
2019-12-02 18:55:52 +00:00
<h1>koushin</h1>
2019-12-03 13:33:20 +00:00
<p>
2020-01-24 19:58:27 +00:00
<a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}">
Back
</a>
2019-12-03 13:33:20 +00:00
</p>
2019-12-02 18:55:52 +00:00
<h2>
2020-01-24 19:58:27 +00:00
{{if .Message.Envelope.Subject}}
{{.Message.Envelope.Subject}}
{{else}}
(No subject)
{{end}}
</h2>
2019-12-02 18:55:52 +00:00
<form method="post" action="/message/{{.Mailbox.Name | pathescape}}/move">
<input type="hidden" name="uids" value="{{.Message.Uid}}">
2020-01-24 19:58:27 +00:00
<label for="move-to">Move to:</label>
<select name="to" id="move-to">
{{range .Mailboxes}}
<option {{if eq .Name $.Mailbox.Name}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
<input type="submit" value="Move">
</form>
<form method="post" action="/message/{{.Mailbox.Name | pathescape}}/delete">
<input type="hidden" name="uids" value="{{.Message.Uid}}">
2020-01-24 19:58:27 +00:00
<input type="submit" value="Delete">
</form>
{{if .Flags}}
<form method="post" action="/message/{{.Mailbox.Name | pathescape}}/flag">
<input type="hidden" name="uids" value="{{.Message.Uid}}">
2020-01-24 19:58:27 +00:00
<p>Flags:</p>
{{range $name, $has := .Flags}}
{{if ismutableflag $name}}
<input type="checkbox" name="flags" id="flag-{{$name}}"
value="{{$name}}" {{if $has}}checked{{end}}>
<label for="flag-{{$name}}">{{$name | formatflag}}</label>
<br>
{{else}}
{{if $has}}
<input type="hidden" name="flags" value="{{$name}}">
{{end}}
{{end}}
{{end}}
<input type="submit" value="Set flags">
</form>
{{end}}
2019-12-17 12:02:38 +00:00
{{define "addr-list"}}
2020-01-24 19:58:27 +00:00
{{range $i, $addr := .}}
{{if $i}},{{end}}
{{.PersonalName}}
&lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt;
{{end}}
2019-12-17 12:02:38 +00:00
{{end}}
2019-12-17 10:28:47 +00:00
<ul>
2020-01-24 19:58:27 +00:00
<li>
<strong>Date</strong>: {{.Message.Envelope.Date | formatdate}}
</li>
<li>
<strong>From</strong>: {{template "addr-list" .Message.Envelope.From}}
</li>
<li>
<strong>To</strong>: {{template "addr-list" .Message.Envelope.To}}
</li>
{{if .Message.Envelope.Cc}}
<li>
<strong>Cc</strong>: {{template "addr-list" .Message.Envelope.Cc}}
</li>
{{end}}
{{if .Message.Envelope.Bcc}}
<li>
<strong>Bcc</strong>: {{template "addr-list" .Message.Envelope.Bcc}}
</li>
{{end}}
2019-12-17 10:28:47 +00:00
</ul>
2019-12-03 12:07:25 +00:00
{{define "message-part-tree"}}
2020-01-24 19:58:27 +00:00
{{/* nested templates can't access the parent's context */}}
{{$ = index . 0}}
{{with index . 1}}
<a
{{if .IsText}}
href="{{$.Message.URL}}?part={{.PathString}}"
2020-01-24 19:58:27 +00:00
{{else}}
href="{{$.Message.URL}}/raw?part={{.PathString}}"
2020-01-24 19:58:27 +00:00
{{end}}
>
{{if eq $.Part.PathString .PathString}}<strong>{{end}}
2020-01-24 19:58:27 +00:00
{{.String}}
{{if eq $.Part.PathString .PathString}}</strong>{{end}}
2020-01-24 19:58:27 +00:00
</a>
{{if .Children}}
<ul>
{{range .Children}}
<li>{{template "message-part-tree" (tuple $ .)}}</li>
{{end}}
</ul>
{{end}}
{{end}}
2019-12-03 10:11:49 +00:00
{{end}}
2019-12-03 12:07:25 +00:00
<p>Parts:</p>
{{template "message-part-tree" (tuple $ .Message.PartTree)}}
<hr>
2019-12-03 10:11:49 +00:00
2020-02-12 13:42:51 +00:00
{{if .View}}
2020-01-24 19:58:27 +00:00
<p>
{{if .Message.HasFlag "\\Draft"}}
<a href="{{.Message.URL}}/edit?part={{.Part.PathString}}">Edit draft</a>
2020-01-24 19:58:27 +00:00
{{else}}
<a href="{{.Message.URL}}/reply?part={{.Part.PathString}}">Reply</a> &middot;
<a href="{{.Message.URL}}/forward?part={{.Part.PathString}}">Forward</a>
2020-01-24 19:58:27 +00:00
{{end}}
</p>
2020-02-12 13:42:51 +00:00
{{.View}}
2019-12-03 12:07:25 +00:00
{{else}}
2020-01-24 19:58:27 +00:00
<p>Can't preview this message part.</p>
<a href="{{.Message.URL}}/raw?part={{.Part.PathString}}">Download</a>
2019-12-03 10:11:49 +00:00
{{end}}
2019-12-02 18:55:52 +00:00
{{template "foot.html"}}