~bigbes/sr-ht-spec

ref: 8255ff90741113fd85e6f15706127bb5c30ca3f5 sr-ht-spec/web/templates/proposal.html -rw-r--r-- 3.4 KiB
8255ff90 — Eugene Blikh ci: export the version instead of sed-ing a tracked APKBUILD 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
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
{{/*
  Line selection in the prose diff. Deferred and unconditional: the script is
  pure enhancement (folding is a checkbox, commenting is a <details> with a
  plain form), so nothing on this page waits for it and nothing breaks if it
  never arrives.
*/}}
{{define "head"}}
<script src="/static/diff.js" defer></script>
{{end}}

{{define "content"}}
{{$p := .Data.Proposal}}
<div class="row">
  <div class="col-md-12">
    <p class="text-muted">
      <a href="{{.Data.SpaceHref}}">{{$p.Space}}</a>
    </p>
    <h2>
      Proposal #{{$p.ID}}
      <span class="badge {{.Data.StateBadge}}">{{$p.State}}</span>
    </h2>
    <h3 class="h5">{{$p.Title}}</h3>
    {{if $p.Rationale}}<p>{{$p.Rationale}}</p>{{end}}
    <p class="text-muted">
      <small>
        proposed by <code>{{$p.Agent}}</code>
        (session <code>{{$p.AgentSession}}</code>)
        against <code title="{{$p.BaseRev}}">{{shortsha $p.BaseRev}}</code>
        {{if .Data.Merged}}
        &mdash; merged as <span class="badge badge-secondary">{{$p.Approval}}</span>
        at <code title="{{$p.MergedRev}}">{{shortsha $p.MergedRev}}</code>
        {{end}}
      </small>
    </p>

    {{if .Data.Unresolved}}
    <p class="text-muted">
      <small>
        <span class="badge badge-warning">{{.Data.Unresolved}} unresolved</span>
        Policy auto-merge is suppressed while a review thread is open; approving
        by hand still works.
      </small>
    </p>
    {{end}}

    {{if .Data.CanApprove}}
    <div class="proposal-actions">
      <form method="POST" action="/{{$p.Space}}/p/{{$p.ID}}/approve" class="d-inline">
        <button type="submit" class="btn btn-success">Approve &amp; merge</button>
      </form>
      <form method="POST" action="/{{$p.Space}}/p/{{$p.ID}}/reject" class="d-inline">
        <button type="submit" class="btn btn-outline-danger">Reject</button>
      </form>
    </div>
    {{else if .Data.Merged}}
    <p class="text-success">This proposal has been merged.</p>
    {{else if .Data.Rejected}}
    <p class="text-danger">This proposal was rejected.</p>
    {{end}}
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    {{if .Data.Docs}}
    {{range .Data.Docs}}
    <div class="proposal-doc">
      <h4 class="h6">
        <code>{{.Path}}</code>
        {{if .New}}<span class="badge badge-success">new</span>{{end}}
      </h4>
      {{if .Diff.Unchanged}}
      <p class="text-muted"><small>No textual change.</small></p>
      {{else}}
      {{.Diff.HTML}}
      {{end}}
    </div>
    {{end}}
    {{else}}
    <p class="text-muted">This proposal changes no documents.</p>
    {{end}}

    {{/*
      Comments whose block is gone. They are shown here, whole, rather than
      moved onto whatever block now sits nearest: a critique read against the
      wrong paragraph is worse than one that admits it lost its place, because
      the reader cannot tell it is wrong.
    */}}
    {{if .Data.Lost}}
    <div class="proposal-doc ph-lost">
      <h4 class="h6">
        Comments that lost their anchor
        <span class="badge badge-warning">{{len .Data.Lost}}</span>
      </h4>
      <p class="text-muted">
        <small>
          The blocks these were written about are no longer in the proposed
          revision. They are kept as written and attached to nothing.
        </small>
      </p>
      {{range .Data.Lost}}{{template "thread" .}}{{end}}
    </div>
    {{end}}
  </div>
</div>
{{end}}