aboutsummaryrefslogblamecommitdiff
path: root/plugins/base/public/message.html
blob: 11afa7314e384d8835733eed6660c6397a7b7bab (plain) (tree)
1
2
3
4
5
6
7
8
9
                        


                
   


                                                                                
    
 






                                             
 









                                                                                                



                                                     




















                                                                                     
                       


               




                                                            

            
                                                                            
                            


                                                                      
       
 
                        
{{template "head.html"}}

<h1>koushin</h1>

<p>
	<a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}">
		Back
	</a>
</p>

<h2>
	{{if .Message.Envelope.Subject}}
		{{.Message.Envelope.Subject}}
	{{else}}
		(No subject)
	{{end}}
</h2>

<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>

{{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 gt (len .Children) 0}}
		<ul>
			{{range .Children}}
				<li>{{template "message-part-tree" (tuple $ .)}}</li>
			{{end}}
		</ul>
		{{end}}
	{{end}}
{{end}}

<p>Parts:</p>

{{template "message-part-tree" (tuple $ .Message.PartTree)}}

<hr>

{{if .Body}}
	<p><a href="{{.Message.Uid}}/reply?part={{.PartPath}}">Reply</a></p>
	<pre>{{.Body}}</pre>
{{else}}
	<p>Can't preview this message part.</p>
	<a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a>
{{end}}

{{template "foot.html"}}