aboutsummaryrefslogtreecommitdiff
path: root/themes/alps/message.html
blob: 38ae9487d338d0960de2ecc9c7584ec7a1c6695b (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{{template "head.html"}}
{{template "nav.html" .}}

<div class="page-wrap">
  {{$current := .Mailbox}}
  <aside>
    <!-- the logo image, dimensions 200x32 may be present or not -->
    <a href="/compose" class="compose-mail">Compose&nbsp;Mail</a>
    <!-- TODO: get mailbox list from render data -->
    <a href="/mailbox/INBOX" {{ if eq $current.Name "INBOX" }}class="active"{{ end }}>Inbox {{ if $current.Unseen }}({{ $current.Unseen }}){{ end }}</a>
    <a href="/mailbox/Drafts" {{ if eq $current.Name "Drafts" }}class="active"{{ end }}>Drafts</a>
    <a href="/mailbox/Sent" {{ if eq $current.Name "Sent" }}class="active"{{ end }}>Sent</a>
    <a href="/mailbox/Archive" {{ if eq $current.Name "Archive" }}class="active"{{ end }}>Archive {{ if $current.Unseen }}({{ $current.Unseen }}){{ end }}</a>
    <a href="/mailbox/Junk" {{ if eq $current.Name "Junk" }}class="active"{{ end }}>Junk {{ if $current.Unseen }}({{ $current.Unseen }}){{ end }}</a>
    <a href="/mailbox/Trash" {{ if eq $current.Name "Trash" }}class="active"{{ end }}>Trash</a>
  </aside>

  <div class="container">
    <main class="message">


<table>
  <tr>
    <tr>
  <th colspan="2">
    <div class="actions-wrap">
      <div class="actions-message">
        <a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}" class="button-link">« Back</a>
        &nbsp;&nbsp;

        {{ if and (ne .Mailbox.Name "Archive") (ne .Mailbox.Name "Drafts") (ne .Mailbox.Name "Sent") }}
        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/move">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          <input type="hidden" name="to" value="Archive">
          <button>Archive</button>
        </form>
        {{ end }}

        {{ if and (ne .Mailbox.Name "INBOX") (ne .Mailbox.Name "Sent") (ne .Mailbox.Name "Drafts") }}
        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/move">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          <input type="hidden" name="to" value="INBOX">
          <button>
          {{ if (eq .Mailbox.Name "Junk") }}
          Not Spam
          {{ else }}
          Move to Inbox
          {{ end }}
          </button>
        </form>
        {{ end }}

        {{ if or (eq .Mailbox.Name "INBOX") (eq .Mailbox.Name "Trash") }}
        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/move">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          &nbsp;&nbsp;
          <input type="hidden" name="to" value="Junk">
          <button>Report Spam</button>
        </form>
        {{ end }}

        {{ if or (eq .Mailbox.Name "Trash") (eq .Mailbox.Name "Junk") }}
        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/delete">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          <button>Delete Permanently</button>
        </form>
        {{ else }}
        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/move">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          &nbsp;&nbsp;
          <input type="hidden" name="to" value="Trash">
          <button>Delete</button>
        </form>
        {{ end }}

        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/flag">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          <input type="hidden" name="flags" value="\Seen">
          <input type="hidden" name="action" value="remove">
          <button>Mark&nbsp;Unread</button>
        </form>

        <form method="post" action="/message/{{.Mailbox.Name | pathescape}}/move">
          <input type="hidden" name="uids" value="{{.Message.Uid}}">
          <select name="to">
            {{range .Mailboxes}}
              <option value="{{.Name}}" {{if eq .Name $.Mailbox.Name}}selected>Move to...{{else}}>{{.Name}}{{ end }}</option>
            {{end}}
          </select>
          <input type="submit" value="Move">
        </form>
        &nbsp;&nbsp;

        <a href="{{.Message.Uid}}/reply?part={{.Part.PathString}}">Reply</a>
        &nbsp;&nbsp;
        <a href="{{.Message.Uid}}/forward?part={{.Part.PathString}}">Forward</a>
      </div>
    </div>
  </th>
</tr>

  </tr>
  <tr>
    <th colspan="2">
      <h1>
       {{if .Message.Envelope.Subject}}
          {{.Message.Envelope.Subject}}
        {{else}}
          (No subject)
        {{end}}
      </h1>
      </th>
    </tr>

  <tr>
    <th>From:</th>
    <td>{{template "addr-list" .Message.Envelope.From}}</td>
  </tr>
  <tr>
    <th>Date:</th>
    <td>{{.Message.Envelope.Date | formatdate}}</td>
  </tr>
  <tr>
    <th>To:</th><td>{{template "addr-list" .Message.Envelope.To}}</td>
  </tr>
  {{if .Message.Envelope.Cc}}
    <tr>
      <th>Cc:</th><td>{{template "addr-list" .Message.Envelope.Cc}}</td>
    </tr>
  {{end}}
  {{if .Message.Envelope.Bcc}}
    <tr>
      <th>Bcc:</th>
      <td>{{template "addr-list" .Message.Envelope.Bcc}}</td>
    </tr>
  {{ end }}
</table>

{{define "addr-list"}}
  {{range $i, $addr := .}}
    {{if $i}},{{end}}
    <strong>{{.PersonalName}}</strong>
    &lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt;
  {{end}}
{{end}}

{{if .View}}
  {{.View}}
{{else}}
  <p>Can't preview this message part.</p>
  <a href="{{.Message.Uid}}/raw?part={{.Part.PathString}}">Download</a>
{{end}}

{{template "foot.html"}}