aboutsummaryrefslogtreecommitdiff
path: root/public/message.html
blob: 09e56acd197450250352a864a5cd202707a3fbd1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{{template "head"}}

<h1>koushin</h1>

<a href="/mailbox/{{.Mailbox.Name}}">Back</a>

<h2>{{.Message.Envelope.Subject}}</h2>

{{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}}
	<pre>{{.Body}}</pre>
{{else}}
	<p>Can't preview this message part.</p>
	<a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a>
{{end}}

{{template "foot"}}