~bigbes/sr-ht-spec

ref: cb60d4f754f4ea21121414f7e3fc8b10118c8ac4 sr-ht-spec/web/templates/inbox.html -rw-r--r-- 2.4 KiB
cb60d4f7 — Eugene Blikh ci: run the suites against a real Postgres on the builder 9 days ago
                                                                                
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
{{define "content"}}
<div class="row">
  <div class="col-md-12">
    <h2>Review queue</h2>

    <h3 class="h5">
      Waiting on you
      <span class="badge badge-primary">{{len .Data.Open.Items}}</span>
    </h3>
    {{/* The listing markup is ecore's, so a proposal waiting on the owner and a
         repository on a sibling service look like the same kind of thing. The
         columns after the title are the item's Meta  the space, then the agent
          and the partial carries the empty-queue sentence itself.

         What is lost against the hand-written table this replaces is the header
         row: srht-repo-table draws no headings, because the meaning of the
         columns it renders is known only to the service supplying them. Here
         that costs the "Space" and "Agent" labels, which the values say plainly
         enough on their own (~owner/space, and an agent identity).

         The digest below is deliberately NOT this partial; inboxData's doc
         comment says what it needs that a flat listing cannot express. */}}
    {{template "srht-repo-table" .Data.Open}}

    <h3 class="h5">
      Recently auto-merged
      {{if .Data.NewCount}}<span class="badge badge-info">{{.Data.NewCount}} new</span>{{end}}
    </h3>
    <p class="text-muted">
      <small>Content the space's policy merged without stopping for review.</small>
    </p>
    {{if .Data.NewCount}}
    <form method="POST" action="/inbox/seen" class="mb-3">
      <button type="submit" class="btn btn-sm btn-outline-secondary">Mark as seen</button>
    </form>
    {{end}}
    {{if .Data.Digest}}
    <table class="table">
      <thead>
        <tr><th>Proposal</th><th>Space</th><th>Agent</th></tr>
      </thead>
      <tbody>
        {{range $i, $r := .Data.Digest}}
        {{if eq $i $.Data.NewCount}}
        <tr class="table-active">
          <td colspan="3" class="text-muted text-center">
            <small>— seen before your last visit —</small>
          </td>
        </tr>
        {{end}}
        <tr>
          <td>
            <a href="{{$r.Href}}">#{{$r.ID}}{{$r.Title}}</a>
            {{if $r.New}}<span class="badge badge-info">new</span>{{end}}
          </td>
          <td class="text-muted"><code>{{$r.Space}}</code></td>
          <td class="text-muted"><code>{{$r.Agent}}</code></td>
        </tr>
        {{end}}
      </tbody>
    </table>
    {{else}}
    <p class="text-muted">Nothing has auto-merged recently.</p>
    {{end}}
  </div>
</div>
{{end}}