alps/plugins/base/public/message.html

128 lines
2.9 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>
<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>
{{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.Uid}}/move">
<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.Uid}}/delete">
<input type="submit" value="Delete">
</form>
{{if .Flags}}
<form method="post" action="{{.Message.Uid}}/flag">
<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"}}
2019-12-18 16:07:10 +00:00
{{range $i, $addr := .}}
2019-12-17 12:02:38 +00:00
{{if $i}},{{end}}
{{.PersonalName}}
&lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt;
{{end}}
{{end}}
2019-12-17 10:28:47 +00:00
<ul>
<li>
<strong>Date</strong>: {{.Message.Envelope.Date | formatdate}}
</li>
<li>
2019-12-17 12:02:38 +00:00
<strong>From</strong>: {{template "addr-list" .Message.Envelope.From}}
2019-12-17 10:28:47 +00:00
</li>
<li>
2019-12-17 12:02:38 +00:00
<strong>To</strong>: {{template "addr-list" .Message.Envelope.To}}
2019-12-17 10:28:47 +00:00
</li>
{{if .Message.Envelope.Cc}}
<li>
2019-12-17 12:02:38 +00:00
<strong>Cc</strong>: {{template "addr-list" .Message.Envelope.Cc}}
2019-12-17 10:28:47 +00:00
</li>
{{end}}
{{if .Message.Envelope.Bcc}}
<li>
2019-12-17 12:02:38 +00:00
<strong>Bcc</strong>: {{template "addr-list" .Message.Envelope.Bcc}}
2019-12-17 10:28:47 +00:00
</li>
{{end}}
</ul>
2019-12-03 12:07:25 +00:00
{{define "message-part-tree"}}
{{/* nested templates can't access the parent's context */}}
{{$ = index . 0}}
{{with index . 1}}
<a
{{if .IsText}}
href="{{$.Message.Uid}}?part={{.PathString}}"
{{else}}
href="{{$.Message.Uid}}/raw?part={{.PathString}}"
{{end}}
>
{{if eq $.PartPath .PathString}}<strong>{{end}}
{{.String}}
{{if eq $.PartPath .PathString}}</strong>{{end}}
</a>
{{if .Children}}
2019-12-03 12:07:25 +00:00
<ul>
{{range .Children}}
<li>{{template "message-part-tree" (tuple $ .)}}</li>
{{end}}
</ul>
2019-12-03 10:11:49 +00:00
{{end}}
{{end}}
{{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
{{if .Body}}
2019-12-03 17:41:23 +00:00
<p><a href="{{.Message.Uid}}/reply?part={{.PartPath}}">Reply</a></p>
2019-12-18 12:53:45 +00:00
{{if .IsHTML}}
2019-12-18 15:11:45 +00:00
<!-- allow-same-origin is required to resize the frame with its content -->
2019-12-18 15:26:46 +00:00
<!-- allow-popups is required for target="_blank" links -->
<iframe id="email-frame" srcdoc="{{.Body}}" sandbox="allow-same-origin allow-popups"></iframe>
2019-12-18 12:53:45 +00:00
{{else}}
<pre>{{.Body}}</pre>
{{end}}
2019-12-03 12:07:25 +00:00
{{else}}
<p>Can't preview this message part.</p>
<a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a>
2019-12-03 10:11:49 +00:00
{{end}}
2019-12-02 18:55:52 +00:00
{{template "foot.html"}}