Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Tighten up the issue and change review pages

564acd4b6de233740f3c19e297c4655e8952d40c · Keenan Nemetz · 15d ago · parent a464f892

Tighten up the issue and change review pages

- Move contributor-branch CI approval from the Runs tab to the change
  request header, and return the allow form to that request.
- Put issue and change actions in the page header, right aligned with the
  title, instead of duplicating them in the sidebar.
- Drop sidebar details that repeated the header: state, author, age and
  reference. Keep labels, assignees, review base/head, approvals and checks.
- Consolidate approval status into one section and remove the empty-state
  line now covered by the count.
- Fix diff row spacing: keep pre-wrap on the code column only, so template
  whitespace in the gutter cells no longer creates blank lines.

Update the contributor CI test, the HTMX fragment expectations and the
documentation that named the Runs tab as the approval location.

server/web/templates/requests.html +31−33

@@ -78,36 +78,18 @@
78 78 {{define "request_sidebar"}}
79 79 <aside class="thread-side" id="request-sidebar">
80 80 {{if .Error}}<p class="error">{{.Error}}</p>{{end}}
81 <section>
82 <h2>{{icon "circle-dot"}}State</h2>
83 <p><span class="state {{.Request.State}}">{{.Request.State}}</span></p>
84 {{if .CanClose}}
85 <form method="post" action="/r/{{.Name}}/requests/{{.Request.ID}}/state" hx-post="/r/{{.Name}}/requests/{{.Request.ID}}/state" hx-target="#request-sidebar" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']">
86 <input type="hidden" name="csrf" value="{{.CSRF}}">
87 <input type="hidden" name="state" value="{{if eq .Request.State "open"}}closed{{else}}open{{end}}">
88 <button class="secondary" type="submit">{{if eq .Request.State "open"}}{{icon "circle-x"}}Close change{{else}}{{icon "rotate-ccw"}}Reopen change{{end}}</button>
89 </form>
90 {{end}}
91 </section>
92
93 81 <section>
94 82 <h2>{{icon "git-branch"}}Review</h2>
95 83 <dl class="meta-list">
96 84 <dt>Base</dt><dd><code>{{.Request.Base}}</code></dd>
97 85 <dt>Head</dt><dd><a class="sha" href="/r/{{.Name}}/commit/{{.Request.Head}}">{{short .Request.Head}}</a></dd>
98 86 </dl>
99 <p class="muted">{{.Current}} of {{.Required}} required approval(s).</p>
100 {{if .CanApprove}}
101 <form method="post" action="/r/{{.Name}}/requests/{{.Request.ID}}/approve" hx-post="/r/{{.Name}}/requests/{{.Request.ID}}/approve" hx-target="#request-sidebar" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']">
102 <input type="hidden" name="csrf" value="{{.CSRF}}">
103 <button type="submit">{{icon "check"}}Approve this head</button>
104 </form>
105 <p class="muted">Approving names the current head; a new head starts over.</p>
106 {{end}}
107 87 </section>
108 88
109 89 <section>
110 90 <h2>{{icon "check"}}Approvals</h2>
91 <p class="muted">{{.Current}} of {{.Required}} required approval(s).</p>
92 <p class="muted">Approving names the current head; a new head starts over.</p>
111 93 {{if .Approvals}}
112 94 <ul class="approval-list">
113 95 {{range .Approvals}}
@@ -118,13 +100,14 @@
118 100 </li>
119 101 {{end}}
120 102 </ul>
121 {{else}}
122 <p class="muted">No approvals yet. An approval names one commit, so pushing a new head starts over.</p>
123 103 {{end}}
124 104 </section>
125 105
126 106 <section>
127 107 <h2>{{icon "circle-check"}}Checks</h2>
108 {{with .ContributorCI}}
109 <p class="muted">CI is waiting for a maintainer to allow <code>{{.Ref}}</code> at this commit.</p>
110 {{end}}
128 111 {{if .Checks}}
129 112 <ul class="check-list">
130 113 {{range .Checks}}
@@ -134,20 +117,10 @@
134 117 </li>
135 118 {{end}}
136 119 </ul>
137 {{else}}
120 {{else if not .ContributorCI}}
138 121 <p class="muted">No CI run for this commit yet.</p>
139 122 {{end}}
140 123 </section>
141
142 <section>
143 <h2>{{icon "info"}}Details</h2>
144 <dl class="meta-list">
145 <dt>Author</dt><dd>{{who .Request.Author}}</dd>
146 <dt>Opened</dt><dd>{{since .Request.Created.Unix}}</dd>
147 <dt>Reference</dt><dd class="sha">#{{short .Request.ID}}</dd>
148 <dt>Comments</dt><dd>{{.CommentCount}}</dd>
149 </dl>
150 </section>
151 124 </aside>
152 125 {{end}}
153 126
@@ -198,6 +171,31 @@
198 171 · by {{who .Request.Author}} {{since .Request.Created.Unix}}
199 172 </p>
200 173 </div>
174 {{if or .CanApprove .CanClose .ContributorCI}}
175 <div class="page-head-actions">
176 {{with .ContributorCI}}{{if .CanAllow}}
177 <form method="post" action="/r/{{$.Name}}/ci/allow">
178 <input type="hidden" name="csrf" value="{{$.CSRF}}">
179 <input type="hidden" name="request" value="{{$.Request.ID}}">
180 <input type="hidden" name="ref" value="refs/heads/{{.Ref}}">
181 <button type="submit">{{icon "play"}}Allow CI for this tip</button>
182 </form>
183 {{end}}{{end}}
184 {{if .CanApprove}}
185 <form method="post" action="/r/{{.Name}}/requests/{{.Request.ID}}/approve">
186 <input type="hidden" name="csrf" value="{{.CSRF}}">
187 <button type="submit">{{icon "check"}}Approve this head</button>
188 </form>
189 {{end}}
190 {{if .CanClose}}
191 <form method="post" action="/r/{{.Name}}/requests/{{.Request.ID}}/state">
192 <input type="hidden" name="csrf" value="{{.CSRF}}">
193 <input type="hidden" name="state" value="{{if eq .Request.State "open"}}closed{{else}}open{{end}}">
194 <button class="secondary" type="submit">{{if eq .Request.State "open"}}{{icon "circle-x"}}Close change{{else}}{{icon "rotate-ccw"}}Reopen change{{end}}</button>
195 </form>
196 {{end}}
197 </div>
198 {{end}}
201 199 </div>
202 200
203 201 <div class="thread">