aboutsummaryrefslogtreecommitdiff
path: root/themes/sourcehut/mailbox.html
blob: cefe1d845b315262c910200132da80a915a508e0 (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
{{template "head.html"}}
{{template "nav.html"}}

<!-- TODO: Share tabs if reasonable -->
<div class="container-fluid">
  <div class="row">
    <div class="col-md-12 header-tabbed">
      <h2>{{.Mailbox.Name}}</h2>
      <ul class="nav nav-tabs">
        <li class="nav-item">
          <a
            class="nav-link active"
            href="/mailbox/{{.Mailbox.Name | pathescape }}"
          >Mailbox</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="/compose">Compose</a>
        </li>
      </ul>
    </div>
  </div>
</div>
<div class="container-fluid mailbox-container">
  <div class="row">
    <div class="col-md-2 mailboxes-column">
      <ul class="nav flex-column">
        {{$current := .Mailbox }}
        {{range .Mailboxes}}
          <li class="nav-item">
            <a
              {{ if eq $current.Name .Name }}
              class="nav-link active"
              {{ else }}
              class="nav-link"
              {{ end }}
              href="/mailbox/{{.Name | pathescape}}"
            >{{.Name}}</a>
          </li>
        {{end}}
      </ul>
    </div>
    <div class="col-md-10 messages-column">
      {{if .Messages}}
      <ul class="nav flex-column">
        {{range .Messages}}
          <li class="nav-item">
            <a
              class="nav-link"
              href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}"
            >
            <span class="text-muted date">
              {{ .Envelope.Date.Format "Mon Jan 02 15:04" }}
            </span>
            <span class="text-normal from">
              {{ range .Envelope.From }}
                {{ .PersonalName }}
              {{ end }}
            </span>
            {{if .Envelope.Subject}}
              {{.Envelope.Subject}}
            {{else}}
              (No subject)
            {{end}}
          </a></li>
        {{end}}
      </ul>

      <p>
        {{if ge .PrevPage 0}}
          <a href="?page={{.PrevPage}}">Prev</a>
        {{end}}
        {{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}}
        {{if ge .NextPage 0}}
          <a href="?page={{.NextPage}}">Next</a>
        {{end}}
      </p>
      {{else}}
        <p>Mailbox is empty.</p>
      {{end}}
    </div>
  </div>
</div>

{{template "foot.html"}}