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.
|
f09ef39e
Keenan Nemetz
15d ago
|
1 | {{define "requests"}} |
| 2 | {{template "header" .}} | |
|
8fb7aabf
Keenan Nemetz
3d ago
|
3 | {{template "repohead" (nav .Page "changes")}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
4 | |
| 5 | <div class="page-head"> | |
|
a464f892
Keenan Nemetz
15d ago
|
6 | <div class="page-head-main"> |
|
b06184d1
Keenan Nemetz
11d ago
|
7 | <h1>Changes</h1> |
|
20d459f5
Keenan Nemetz
11d ago
|
8 | <p class="page-sub">Proposed updates to the project, reviewed and approved before they are merged.</p> |
|
f09ef39e
Keenan Nemetz
15d ago
|
9 | </div> |
|
ed03b3d1
Keenan Nemetz
3h ago
|
10 | {{if .CanOpen}}<div class="page-head-actions"><a class="button" href="/{{.Name}}/changes/new">{{icon "plus"}}New change</a></div>{{end}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
11 | </div> |
| 12 | ||
| 13 | {{template "change_list" .}} | |
| 14 | {{template "footer" .}} | |
| 15 | {{end}} | |
| 16 | ||
|
6813339b
Keenan Nemetz
4d ago
|
17 | {{define "change_status"}}<span class="row-status {{.Key}}" title="{{.Note}}">{{icon .Icon}}{{.Label}}</span>{{end}} |
|
7cc36ba0
Keenan Nemetz
4d ago
|
18 | |
|
f09ef39e
Keenan Nemetz
15d ago
|
19 | {{define "change_list"}} |
| 20 | <div id="change-list"> | |
|
6c98a271
Keenan Nemetz
9d ago
|
21 | {{/* One row: state chips on the left, search on the right. The chips live |
| 22 | inside the form so a search keeps the state, and the whole row is replaced | |
| 23 | with the server's rendering after a search or a chip click. */}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
24 | <form method="get" action="/{{.Name}}/changes" class="filters" role="search" hx-get="/{{.Name}}/changes" hx-target="#change-list" hx-swap="outerHTML" hx-push-url="true"> |
|
6c98a271
Keenan Nemetz
9d ago
|
25 | <div class="chips" hx-boost="true" hx-target="#change-list" hx-swap="outerHTML" hx-push-url="true"> |
|
ed03b3d1
Keenan Nemetz
3h ago
|
26 | <a class="chip{{if eq .State "open"}} active{{end}}" href="/{{.Name}}/changes?state=open{{if .Query}}&q={{urlquery .Query}}{{end}}">Open <span class="chip-count">{{.Open}}</span></a> |
| 27 | <a class="chip{{if eq .State "merged"}} active{{end}}" href="/{{.Name}}/changes?state=merged{{if .Query}}&q={{urlquery .Query}}{{end}}">Merged <span class="chip-count">{{.Merged}}</span></a> | |
| 28 | <a class="chip{{if eq .State "closed"}} active{{end}}" href="/{{.Name}}/changes?state=closed{{if .Query}}&q={{urlquery .Query}}{{end}}">Closed <span class="chip-count">{{.Closed}}</span></a> | |
| 29 | <a class="chip{{if eq .State "all"}} active{{end}}" href="/{{.Name}}/changes?state=all{{if .Query}}&q={{urlquery .Query}}{{end}}">All <span class="chip-count">{{.Total}}</span></a> | |
|
6c98a271
Keenan Nemetz
9d ago
|
30 | </div> |
|
f09ef39e
Keenan Nemetz
15d ago
|
31 | <input type="hidden" name="state" value="{{.State}}"> |
|
6c98a271
Keenan Nemetz
9d ago
|
32 | <div class="filters-search"> |
| 33 | <input name="q" type="search" placeholder="Search title, description and author" aria-label="Search title, description and author" value="{{.Query}}"> | |
| 34 | <button type="submit">{{icon "search"}}Search</button> | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
35 | {{if .Filtered}}<a class="button secondary" href="/{{.Name}}/changes" hx-get="/{{.Name}}/changes" hx-target="#change-list" hx-swap="outerHTML" hx-push-url="true">{{icon "x"}}Clear</a>{{end}} |
|
6c98a271
Keenan Nemetz
9d ago
|
36 | </div> |
|
f09ef39e
Keenan Nemetz
15d ago
|
37 | </form> |
| 38 | ||
| 39 | {{if .Rows}} | |
| 40 | <div class="panel"> | |
| 41 | <table class="change-list"> | |
| 42 | <thead> | |
|
5899ae25
Keenan Nemetz
4d ago
|
43 | <tr><th>Status</th><th>Change</th><th>Base</th><th>Head</th><th>Updated</th></tr> |
|
f09ef39e
Keenan Nemetz
15d ago
|
44 | </thead> |
| 45 | <tbody> | |
| 46 | {{range .Rows}} | |
| 47 | <tr> | |
|
5899ae25
Keenan Nemetz
4d ago
|
48 | <td class="fit">{{template "change_status" .Status}}</td> |
|
f09ef39e
Keenan Nemetz
15d ago
|
49 | <td> |
|
ed03b3d1
Keenan Nemetz
3h ago
|
50 | <a class="row-title" href="/{{$.Name}}/changes/{{.ID}}">{{.Title}}</a> |
|
7cc36ba0
Keenan Nemetz
4d ago
|
51 | <div class="row-meta"> |
| 52 | <span class="sha">{{num .Number}}</span> | |
| 53 | <span>opened by {{template "userlink" (user .Author)}} {{since .Created.Unix}}</span> | |
| 54 | {{if .CommentCount}}<span>{{.CommentCount}} comment{{if ne .CommentCount 1}}s{{end}}</span>{{end}} | |
| 55 | </div> | |
|
f09ef39e
Keenan Nemetz
15d ago
|
56 | </td> |
|
b7afc6a9
Keenan Nemetz
4d ago
|
57 | <td><code>{{.Base}}</code></td> |
|
b6af0843
Keenan Nemetz
4d ago
|
58 | <td>{{if .HeadRef}}<code title="the branch this request follows">{{.HeadRef}}</code>{{else}}<span class="muted">pinned to</span> <span class="sha" title="this change does not follow a branch; it names one commit">{{short .Head}}</span>{{end}}</td> |
|
7cc36ba0
Keenan Nemetz
4d ago
|
59 | <td class="muted nowrap">{{since .Updated.Unix}}</td> |
|
f09ef39e
Keenan Nemetz
15d ago
|
60 | </tr> |
| 61 | {{end}} | |
| 62 | </tbody> | |
| 63 | </table> | |
| 64 | </div> | |
|
c717d4eb
Keenan Nemetz
13d ago
|
65 | {{template "pager" .Pager}} |
|
0e35a6a0
Keenan Nemetz
11d ago
|
66 | {{else if and (eq .State "open") .Total}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
67 | <div class="empty-state"> |
|
c7b9094f
Keenan Nemetz
1d ago
|
68 | <p>No open changes.</p> |
|
f09ef39e
Keenan Nemetz
15d ago
|
69 | </div> |
| 70 | {{else if .Filtered}} | |
| 71 | <div class="empty-state"> | |
|
b06184d1
Keenan Nemetz
11d ago
|
72 | <p>No changes match this filter.</p> |
|
f09ef39e
Keenan Nemetz
15d ago
|
73 | </div> |
| 74 | {{else}} | |
| 75 | <div class="empty-state"> | |
|
b06184d1
Keenan Nemetz
11d ago
|
76 | <p>No changes yet.</p> |
|
f09ef39e
Keenan Nemetz
15d ago
|
77 | <p class="muted">From a clone of this repository:</p> |
| 78 | <pre>vole change new --title "..." --base {{.Base}}</pre> | |
|
b06184d1
Keenan Nemetz
11d ago
|
79 | <p class="muted">A change is also just a directory on the <code>vole</code> branch: |
|
b492b557
Keenan Nemetz
3d ago
|
80 | <code>changes/<ulid>/change.md</code> naming the base branch and the head |
|
f09ef39e
Keenan Nemetz
15d ago
|
81 | commit, plus <code>approvals/<account-id>.md</code> from each approver.</p> |
| 82 | </div> | |
| 83 | {{end}} | |
| 84 | </div> | |
| 85 | {{end}} | |
| 86 | ||
|
d3dcf54d
Keenan Nemetz
11d ago
|
87 | {{/* A `?` beside a section heading whose explanation would otherwise be a |
| 88 | paragraph in the panel. The text is both the tooltip and the accessible | |
| 89 | name, so a pointer, a keyboard and a screen reader get the same words. */}} | |
| 90 | {{define "help"}}<span class="help" tabindex="0" role="note" aria-label="{{.}}" data-tip="{{.}}">?</span>{{end}} | |
| 91 | ||
|
19fc6ed0
Keenan Nemetz
11d ago
|
92 | {{define "request_changes"}} |
|
707dfd10
Keenan Nemetz
10d ago
|
93 | <section id="request-changes"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> |
|
ed03b3d1
Keenan Nemetz
3h ago
|
94 | <h2 class="with-more"><span>{{icon "file"}}Changes</span>{{if .FileCount}} <a class="more" href="/{{.Name}}/changes/{{.Request.ID}}/files">View changes</a>{{end}}</h2> |
|
2841d922
Keenan Nemetz
13d ago
|
95 | {{if .FileCount}} |
|
7fef1eea
Keenan Nemetz
22h ago
|
96 | <p class="muted">{{.FileCount}} file(s) changed{{if .Added}} · <span class="adds">+{{.Added}}</span>{{end}}{{if .Removed}} · <span class="dels">−{{.Removed}}</span>{{end}}</p> |
|
2841d922
Keenan Nemetz
13d ago
|
97 | {{else if .AlreadyMerged}} |
|
f6f4b1db
Keenan Nemetz
15d ago
|
98 | <p class="muted">Already merged into {{.Request.Base}}.</p> |
| 99 | {{else}} | |
| 100 | <p class="muted">No changes, or the head is not reachable from this repository yet.</p> | |
| 101 | {{end}} | |
| 102 | </section> | |
| 103 | {{end}} | |
| 104 | ||
|
707dfd10
Keenan Nemetz
10d ago
|
105 | {{/* The aside is the page's live coordinator. The poll never replaces this element: |
| 106 | it returns out-of-band updates for the data-only regions, so a search, a | |
| 107 | target picker, or an open composer is not thrown away. */}} | |
|
d3dcf54d
Keenan Nemetz
11d ago
|
108 | {{define "request_aside"}} |
| 109 | <div id="request-aside" | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
110 | hx-get="/{{.Name}}/changes/{{.Request.ID}}/live" |
|
707dfd10
Keenan Nemetz
10d ago
|
111 | hx-trigger="every 20s [document.visibilityState === 'visible']" |
|
d3dcf54d
Keenan Nemetz
11d ago
|
112 | hx-sync="this:replace" |
|
707dfd10
Keenan Nemetz
10d ago
|
113 | hx-swap="none"> |
|
d3dcf54d
Keenan Nemetz
11d ago
|
114 | {{template "request_sidebar" .}} |
| 115 | </div> | |
| 116 | {{end}} | |
| 117 | ||
|
f09ef39e
Keenan Nemetz
15d ago
|
118 | {{define "request_sidebar"}} |
|
f6f4b1db
Keenan Nemetz
15d ago
|
119 | <div id="request-sidebar"> |
|
707dfd10
Keenan Nemetz
10d ago
|
120 | <section id="request-review"> |
| 121 | {{template "request_review_status" .}} | |
| 122 | {{template "request_target" .}} | |
|
f09ef39e
Keenan Nemetz
15d ago
|
123 | </section> |
| 124 | ||
|
ad4d9348
Keenan Nemetz
11d ago
|
125 | {{template "request_changes" .}} |
| 126 | ||
|
267feec2
Keenan Nemetz
10d ago
|
127 | {{template "request_issues" .}} |
|
cad93cfe
Keenan Nemetz
10d ago
|
128 | |
|
707dfd10
Keenan Nemetz
10d ago
|
129 | {{template "request_approvals" .}} |
| 130 | ||
| 131 | {{template "request_checks" .}} | |
| 132 | ||
| 133 | {{template "request_combined" .}} | |
| 134 | </div> | |
| 135 | {{end}} | |
| 136 | ||
| 137 | {{define "request_alert"}} | |
| 138 | <div id="request-alert"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> | |
| 139 | {{if .Error}}<p class="error">{{.Error}}</p>{{end}} | |
| 140 | {{if .Notice}}<p class="muted">{{.Notice}}</p>{{end}} | |
| 141 | </div> | |
| 142 | {{end}} | |
| 143 | ||
| 144 | {{define "request_live"}} | |
| 145 | {{template "request_review_status" .}} | |
| 146 | {{template "request_changes" .}} | |
| 147 | {{template "request_approvals" .}} | |
| 148 | {{template "request_checks" .}} | |
| 149 | {{template "request_combined" .}} | |
| 150 | {{template "request_merge_note" .}} | |
| 151 | {{end}} | |
| 152 | ||
| 153 | {{define "request_live_write"}} | |
| 154 | {{template "request_alert" .}} | |
| 155 | {{template "request_actions" .}} | |
| 156 | {{template "request_live" .}} | |
| 157 | {{end}} | |
| 158 | ||
| 159 | {{define "request_review_status"}} | |
| 160 | <div id="request-review-status"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
161 | <h2 class="with-more"><span>{{icon "git-branch"}}Review{{template "help" "The request follows its head branch, so a push moves the head with it. Changing the base or head starts approvals over. A conflict here blocks landing."}}</span> <a class="more sha" href="/{{.Name}}/commit/{{.Request.Head}}" title="commit under review">{{short .Request.Head}}</a></h2> |
|
707dfd10
Keenan Nemetz
10d ago
|
162 | {{if .MergeChecked}}{{if .Conflicts}} |
| 163 | <p class="conflict">This branch no longer merges into {{.Request.Base}} cleanly: | |
| 164 | {{range .Conflicts}}<code>{{.}}</code> {{end}}— rebase or merge {{.Request.Base}} before landing it.</p> | |
| 165 | {{else}} | |
| 166 | <p class="muted">Merges into {{.Request.Base}} cleanly.</p> | |
| 167 | {{end}}{{end}} | |
| 168 | </div> | |
| 169 | {{end}} | |
| 170 | ||
| 171 | {{define "request_target"}} | |
| 172 | {{if .CanRetarget}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
173 | <form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/target" class="request-target"> |
|
707dfd10
Keenan Nemetz
10d ago
|
174 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 175 | <div class="target-fields"> | |
| 176 | <label class="target-field"> | |
| 177 | <span class="target-label">Base branch</span> | |
| 178 | <select name="base"> | |
| 179 | {{range .BaseOptions}}<option value="{{.Name}}"{{if .Selected}} selected{{end}}>{{.Name}}</option>{{end}} | |
| 180 | </select> | |
| 181 | </label> | |
| 182 | <label class="target-field"> | |
| 183 | <span class="target-label">Head branch</span> | |
| 184 | <select name="head"> | |
| 185 | {{if not .Request.HeadRef}}<option value="" selected>pinned commit</option>{{end}} | |
| 186 | {{range .HeadOptions}}<option value="{{.Name}}"{{if .Selected}} selected{{end}}>{{.Name}}</option>{{end}} | |
| 187 | </select> | |
| 188 | </label> | |
| 189 | </div> | |
| 190 | <div class="target-actions"> | |
| 191 | {{if .HeadRefNote}}<p class="muted small">{{.HeadRefNote}}.</p>{{end}} | |
| 192 | <button class="secondary" type="submit" title="Update base and head" aria-label="Update base and head">{{icon "rotate-ccw"}}Update</button> | |
| 193 | </div> | |
| 194 | </form> | |
| 195 | {{else}} | |
| 196 | <p class="target-summary"> | |
| 197 | <code>{{.Request.Base}}</code> | |
| 198 | <span class="muted" aria-hidden="true">←</span> | |
| 199 | {{if .Request.HeadRef}}<code>{{.Request.HeadRef}}</code>{{else}}<span class="muted">pinned commit</span>{{end}} | |
| 200 | </p> | |
| 201 | {{if .HeadRefNote}}<p class="muted">{{.HeadRefNote}}.</p>{{end}} | |
| 202 | {{end}} | |
| 203 | {{end}} | |
| 204 | ||
| 205 | {{define "request_approvals"}} | |
| 206 | <section id="request-approvals"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> | |
|
d3dcf54d
Keenan Nemetz
11d ago
|
207 | <h2>{{icon "check"}}Approvals{{template "help" "Approving names the current base and head; a new base or head starts over. An approval stops counting if its author is retired or no longer maintains the repository."}}</h2> |
| 208 | <p class="muted">{{if .Required}}{{.Current}} of {{.Required}} required approval(s).{{else}}No approvals required.{{end}}</p> | |
|
f09ef39e
Keenan Nemetz
15d ago
|
209 | {{if .Approvals}} |
| 210 | <ul class="approval-list"> | |
| 211 | {{range .Approvals}} | |
| 212 | <li> | |
| 213 | <span class="cname">{{.Name}}</span> | |
|
62b59a76
Keenan Nemetz
12d ago
|
214 | <span class="muted">{{if .Counts}}current{{else if .Current}}no longer counts{{else}}stale{{end}}</span> |
|
f09ef39e
Keenan Nemetz
15d ago
|
215 | </li> |
| 216 | {{end}} | |
| 217 | </ul> | |
| 218 | {{end}} | |
| 219 | </section> | |
|
707dfd10
Keenan Nemetz
10d ago
|
220 | {{end}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
221 | |
|
707dfd10
Keenan Nemetz
10d ago
|
222 | {{define "request_checks"}} |
| 223 | <section id="request-checks"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
224 | <h2 class="with-more"><span>{{icon "circle-check"}}Checks{{template "help" "Workflow runs for the commit under review. If the base branch requires checks, a failing or missing run blocks landing."}}</span> <a class="more" href="/{{.Name}}/changes/{{.Request.ID}}/runs">View runs</a></h2> |
|
564acd4b
Keenan Nemetz
15d ago
|
225 | {{with .ContributorCI}} |
| 226 | <p class="muted">CI is waiting for a maintainer to allow <code>{{.Ref}}</code> at this commit.</p> | |
| 227 | {{end}} | |
|
f09ef39e
Keenan Nemetz
15d ago
|
228 | {{if .Checks}} |
|
d3dcf54d
Keenan Nemetz
11d ago
|
229 | <div class="side-list"> |
|
f09ef39e
Keenan Nemetz
15d ago
|
230 | {{range .Checks}} |
|
ed03b3d1
Keenan Nemetz
3h ago
|
231 | <a class="side-run" href="/{{$.Name}}/runs/{{.ID}}"> |
|
d3dcf54d
Keenan Nemetz
11d ago
|
232 | <span class="side-run-top"> |
| 233 | <span class="status {{.Status}}">{{.Status}}</span> | |
|
1cde8b9e
Keenan Nemetz
8d ago
|
234 | <span class="side-subject">{{.JobTitle}}</span> |
|
d3dcf54d
Keenan Nemetz
11d ago
|
235 | </span> |
|
57dc79af
Keenan Nemetz
6d ago
|
236 | <span class="side-meta">{{if ne .JobTitle .WorkflowTitle}}<span>{{.WorkflowTitle}}</span>{{end}}<span>{{if not .Started.IsZero}}{{duration .Duration}}{{else}}{{duration .Wait}} queued{{end}}</span><span>{{since .Created.Unix}}</span></span> |
|
d3dcf54d
Keenan Nemetz
11d ago
|
237 | </a> |
|
f09ef39e
Keenan Nemetz
15d ago
|
238 | {{end}} |
|
d3dcf54d
Keenan Nemetz
11d ago
|
239 | </div> |
|
564acd4b
Keenan Nemetz
15d ago
|
240 | {{else if not .ContributorCI}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
241 | <p class="muted">No CI run for this commit yet.</p> |
| 242 | {{end}} | |
| 243 | </section> | |
|
707dfd10
Keenan Nemetz
10d ago
|
244 | {{end}} |
|
e5478085
Keenan Nemetz
11d ago
|
245 | |
|
707dfd10
Keenan Nemetz
10d ago
|
246 | {{define "request_combined"}} |
|
e5478085
Keenan Nemetz
11d ago
|
247 | {{if .CombinedNeeded}} |
|
707dfd10
Keenan Nemetz
10d ago
|
248 | <section id="request-combined"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> |
|
ed03b3d1
Keenan Nemetz
3h ago
|
249 | <h2 class="with-more"><span>{{icon "git-merge"}}Combined result{{template "help" "The merge that would land, built from this change and the latest base. It is tested automatically so the branch is ready when the review is. Only a conflict needs work on the branch."}}</span> {{if .CombinedSHA}}<a class="more sha" href="/{{.Name}}/commit/{{.CombinedSHA}}" title="combined result commit">{{short .CombinedSHA}}</a>{{end}}</h2> |
|
e5478085
Keenan Nemetz
11d ago
|
250 | {{if eq .CombinedState "passed"}} |
| 251 | <p class="muted">Passed with the latest <code>{{.Request.Base}}</code>.</p> | |
| 252 | {{else if eq .CombinedState "testing"}} | |
| 253 | <p class="muted">Testing the merge with the latest <code>{{.Request.Base}}</code>…</p> | |
| 254 | {{else if eq .CombinedState "failed"}} | |
| 255 | <p class="conflict">The combined result with <code>{{.Request.Base}}</code> failed. The runs below name the job.</p> | |
| 256 | {{else if eq .CombinedState "conflict"}} | |
| 257 | <p class="conflict">This change conflicts with the latest <code>{{.Request.Base}}</code>. Resolve it on the branch and push again.</p> | |
| 258 | {{end}} | |
| 259 | {{if .CombinedRuns}} | |
| 260 | <div class="side-list"> | |
| 261 | {{range .CombinedRuns}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
262 | <a class="side-run" href="/{{$.Name}}/runs/{{.ID}}"> |
|
e5478085
Keenan Nemetz
11d ago
|
263 | <span class="side-run-top"> |
| 264 | <span class="status {{.Status}}">{{.Status}}</span> | |
|
1cde8b9e
Keenan Nemetz
8d ago
|
265 | <span class="side-subject">{{.JobTitle}}</span> |
|
e5478085
Keenan Nemetz
11d ago
|
266 | </span> |
|
57dc79af
Keenan Nemetz
6d ago
|
267 | <span class="side-meta">{{if ne .JobTitle .WorkflowTitle}}<span>{{.WorkflowTitle}}</span>{{end}}<span>{{if not .Started.IsZero}}{{duration .Duration}}{{else}}{{duration .Wait}} queued{{end}}</span><span>{{since .Created.Unix}}</span></span> |
|
e5478085
Keenan Nemetz
11d ago
|
268 | </a> |
| 269 | {{end}} | |
| 270 | </div> | |
| 271 | {{end}} | |
| 272 | </section> | |
|
707dfd10
Keenan Nemetz
10d ago
|
273 | {{else if .Live}} |
| 274 | <section id="request-combined" hx-swap-oob="outerHTML" hidden></section> | |
|
e5478085
Keenan Nemetz
11d ago
|
275 | {{end}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
276 | {{end}} |
| 277 | ||
|
267feec2
Keenan Nemetz
10d ago
|
278 | {{define "request_issues"}} |
| 279 | <section id="request-issues"> | |
| 280 | <h2>{{icon "circle-dot"}}Issues{{template "help" "Issues linked to this change close when it is merged. An open change can be relinked by its author or a maintainer."}}</h2> | |
|
cad93cfe
Keenan Nemetz
10d ago
|
281 | {{if .LinkedIssues}} |
| 282 | <div class="side-list"> | |
| 283 | {{range .LinkedIssues}} | |
| 284 | <div class="request-issue"> | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
285 | <a class="side-issue" href="/{{$.Name}}/issues/{{.ID}}"> |
|
cad93cfe
Keenan Nemetz
10d ago
|
286 | <span class="side-subject"><span class="side-num">{{num .Number}}</span>{{.Title}}</span> |
| 287 | <span class="side-meta">{{who .Author}}{{if not .Created.IsZero}}<span>{{since .Created.Unix}}</span>{{end}}</span> | |
| 288 | </a> | |
| 289 | {{if $.CanEditIssues}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
290 | <form method="post" action="/{{$.Name}}/changes/{{$.Request.ID}}/issues" hx-post="/{{$.Name}}/changes/{{$.Request.ID}}/issues" hx-target="#request-issues" hx-swap="outerHTML"> |
|
cad93cfe
Keenan Nemetz
10d ago
|
291 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> |
| 292 | <input type="hidden" name="issue" value="{{.ID}}"> | |
|
267feec2
Keenan Nemetz
10d ago
|
293 | <button class="link request-unlink" type="submit" name="action" value="remove" title="Unlink this issue" aria-label="Unlink {{num .Number}} from this change">{{icon "unlink"}}</button> |
|
cad93cfe
Keenan Nemetz
10d ago
|
294 | </form> |
| 295 | {{end}} | |
| 296 | </div> | |
| 297 | {{end}} | |
| 298 | </div> | |
| 299 | {{else}} | |
| 300 | <p class="muted">No linked issues.</p> | |
| 301 | {{end}} | |
| 302 | {{if .CanEditIssues}} | |
|
bb541fde
Keenan Nemetz
10d ago
|
303 | <div class="request-issue-picker"> |
|
ed03b3d1
Keenan Nemetz
3h ago
|
304 | <form class="request-issue-search" hx-get="/{{.Name}}/changes/{{.Request.ID}}/issues/search" hx-trigger="input changed delay:250ms, search, submit" hx-target="#request-issue-results" hx-swap="innerHTML"> |
|
9f5efa3c
Keenan Nemetz
10d ago
|
305 | <input id="request-issue-search" name="q" type="search" placeholder="Search by title, #number, or ULID" aria-label="Search issues by title, number, or ULID" autocomplete="off"> |
|
bb541fde
Keenan Nemetz
10d ago
|
306 | </form> |
| 307 | <div id="request-issue-results" class="request-issue-results" aria-live="polite"></div> | |
| 308 | </div> | |
|
cad93cfe
Keenan Nemetz
10d ago
|
309 | {{end}} |
|
267feec2
Keenan Nemetz
10d ago
|
310 | {{if .IssuesError}}<p class="error">{{.IssuesError}}</p>{{end}} |
|
cad93cfe
Keenan Nemetz
10d ago
|
311 | </section> |
| 312 | {{end}} | |
| 313 | ||
|
838f282e
Keenan Nemetz
10d ago
|
314 | {{define "request_issue_search"}} |
|
bb541fde
Keenan Nemetz
10d ago
|
315 | <div class="request-issue-popover"> |
|
838f282e
Keenan Nemetz
10d ago
|
316 | {{if .Error}} |
| 317 | <p class="error">{{.Error}}</p> | |
| 318 | {{else if .Results}} | |
| 319 | <div class="request-issue-matches"> | |
| 320 | {{range .Results}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
321 | <form method="post" action="/{{$.Name}}/changes/{{$.Request.ID}}/issues" class="request-issue-match" hx-post="/{{$.Name}}/changes/{{$.Request.ID}}/issues" hx-target="#request-issues" hx-swap="outerHTML"> |
|
838f282e
Keenan Nemetz
10d ago
|
322 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> |
| 323 | <input type="hidden" name="issue" value="{{.ID}}"> | |
| 324 | <button type="submit" name="action" value="add" title="Link {{num .Number}}"> | |
| 325 | <span class="side-subject"><span class="side-num">{{num .Number}}</span>{{.Title}}</span> | |
| 326 | <span class="side-meta">{{who .Author}}{{if not .Created.IsZero}}<span>{{since .Created.Unix}}</span>{{end}}</span> | |
| 327 | </button> | |
| 328 | </form> | |
| 329 | {{end}} | |
| 330 | </div> | |
| 331 | {{else if .Query}} | |
| 332 | <p class="muted">No issues match “{{.Query}}”.</p> | |
| 333 | {{end}} | |
|
bb541fde
Keenan Nemetz
10d ago
|
334 | </div> |
|
838f282e
Keenan Nemetz
10d ago
|
335 | {{end}} |
| 336 | ||
|
f6f4b1db
Keenan Nemetz
15d ago
|
337 | {{define "request_inline_comment"}} |
| 338 | <tr class="inline-comment"> | |
| 339 | <td colspan="4"> | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
340 | <form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/comments" class="inline-comment-form"> |
|
f6f4b1db
Keenan Nemetz
15d ago
|
341 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 342 | <input type="hidden" name="path" value="{{.Target.Path}}"> | |
| 343 | <input type="hidden" name="line" value="{{.Target.Line}}"> | |
| 344 | <input type="hidden" name="side" value="{{.Target.Side}}"> | |
| 345 | <div class="inline-comment-card"> | |
| 346 | <div class="inline-comment-head"> | |
| 347 | <span>Comment on <code>{{.Target.Path}}:{{.Target.Line}}</code> <span class="muted">({{.Target.Side}} side)</span></span> | |
| 348 | <button class="link" type="button" data-inline-comment-cancel>Cancel</button> | |
| 349 | </div> | |
| 350 | <textarea name="body" required autofocus placeholder="Leave an inline comment. Markdown is welcome." aria-label="Inline comment"></textarea> | |
| 351 | </div> | |
| 352 | <div class="form-actions"><button type="submit">{{icon "message-square"}}Comment</button></div> | |
| 353 | </form> | |
| 354 | </td> | |
| 355 | </tr> | |
| 356 | {{end}} | |
| 357 | ||
|
802e0e52
Keenan Nemetz
4d ago
|
358 | {{define "request_title_head"}} |
| 359 | <div class="page-head" id="request-head"> | |
|
a464f892
Keenan Nemetz
15d ago
|
360 | <div class="page-head-main"> |
|
802e0e52
Keenan Nemetz
4d ago
|
361 | <div class="details-title"> |
| 362 | <span class="page-num">{{num .Number}}</span> | |
| 363 | <h1 class="details-title-view" data-details-title-view{{if .Details.Title.Active}} hidden{{end}}>{{.Request.Title}}</h1> | |
| 364 | {{if .CanEdit}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
365 | <a class="title-edit-toggle" href="/{{.Name}}/changes/{{.Request.ID}}/edit"{{if .Details.Inline}} data-title-edit{{end}}{{if .Details.Title.Active}} hidden{{end}} aria-label="Edit title" title="Edit title">{{icon "pencil"}}</a> |
|
802e0e52
Keenan Nemetz
4d ago
|
366 | {{if .Details.Inline}} |
|
ed03b3d1
Keenan Nemetz
3h ago
|
367 | <form class="title-edit-form" data-title-edit-form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/edit" hx-post="/{{.Name}}/changes/{{.Request.ID}}/edit" hx-target="#request-head" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']"{{if not .Details.Title.Active}} hidden{{end}}> |
|
802e0e52
Keenan Nemetz
4d ago
|
368 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 369 | <input type="hidden" name="field" value="title"> | |
| 370 | <input class="details-title-input" type="text" name="title" required maxlength="200" aria-label="Title" value="{{if .Details.Title.Active}}{{.Details.Title.Value}}{{else}}{{.Request.Title}}{{end}}" data-title-edit-input{{if .Details.Title.Active}} autofocus{{end}}> | |
| 371 | <button class="secondary" type="button" data-title-edit-cancel>Cancel</button> | |
| 372 | <button type="submit">{{icon "check"}}Save</button> | |
| 373 | </form> | |
| 374 | {{end}} | |
| 375 | {{end}} | |
| 376 | </div> | |
| 377 | {{if .Details.Title.Error}}<p class="error">{{.Details.Title.Error}}</p>{{end}} | |
|
f09ef39e
Keenan Nemetz
15d ago
|
378 | <p class="page-sub"> |
| 379 | <span class="state {{.Request.State}}">{{.Request.State}}</span> | |
|
a6b42433
Keenan Nemetz
7d ago
|
380 | · by {{template "userlink" (user .Request.Author)}} {{since .Request.Created.Unix}} |
|
38b30251
Keenan Nemetz
13d ago
|
381 | {{if eq .Request.State "merged"}} |
| 382 | · merged into <code>{{.Request.Base}}</code> at <span class="sha">{{short .Request.MergedHead}}</span> | |
|
a6b42433
Keenan Nemetz
7d ago
|
383 | by {{template "userlink" (user .Request.MergedBy)}} {{since .Request.MergedAt.Unix}} |
|
38b30251
Keenan Nemetz
13d ago
|
384 | {{end}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
385 | </p> |
| 386 | </div> | |
|
707dfd10
Keenan Nemetz
10d ago
|
387 | {{template "request_actions" .}} |
| 388 | {{template "request_merge_note" .}} | |
| 389 | </div> | |
|
802e0e52
Keenan Nemetz
4d ago
|
390 | {{end}} |
| 391 | ||
| 392 | {{define "request_head"}} | |
| 393 | {{template "request_title_head" .}} | |
|
707dfd10
Keenan Nemetz
10d ago
|
394 | {{template "request_alert" .}} |
| 395 | {{end}} | |
| 396 | ||
| 397 | {{define "request_merge_note"}} | |
| 398 | <p id="request-merge-note" class="muted small"{{if .Live}} hx-swap-oob="outerHTML"{{end}}{{if not .MergeBlocked}} hidden{{end}}>{{.MergeBlocked}}</p> | |
| 399 | {{end}} | |
| 400 | ||
| 401 | {{define "request_actions"}} | |
|
802e0e52
Keenan Nemetz
4d ago
|
402 | {{if or .CanApprove .CanClose .CanMerge .MergeArmed .ContributorCI .Live}} |
|
707dfd10
Keenan Nemetz
10d ago
|
403 | <div id="request-actions" class="page-head-actions"{{if .Live}} hx-swap-oob="outerHTML"{{end}}> |
| 404 | {{with .ContributorCI}}{{if .CanAllow}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
405 | <form method="post" action="/{{$.Name}}/ci/allow"> |
|
707dfd10
Keenan Nemetz
10d ago
|
406 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> |
| 407 | <input type="hidden" name="request" value="{{$.Request.ID}}"> | |
| 408 | <input type="hidden" name="ref" value="refs/heads/{{.Ref}}"> | |
| 409 | <button class="warn" type="submit">{{icon "play"}}Allow CI</button> | |
| 410 | </form> | |
| 411 | {{end}}{{end}} | |
| 412 | {{if .CanApprove}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
413 | <form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/approve" hx-post="/{{.Name}}/changes/{{.Request.ID}}/approve" hx-swap="none" hx-disabled-elt="find button[type='submit']"> |
|
707dfd10
Keenan Nemetz
10d ago
|
414 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 415 | <input type="hidden" name="base" value="{{.Request.Base}}"> | |
| 416 | <input type="hidden" name="head" value="{{.Request.Head}}"> | |
| 417 | <button class="success" type="submit">{{icon "check"}}Approve</button> | |
| 418 | </form> | |
| 419 | {{end}} | |
| 420 | {{if .MergeArmed}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
421 | <form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/merge/cancel"> |
|
707dfd10
Keenan Nemetz
10d ago
|
422 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 423 | <button class="secondary" type="submit">{{icon "circle-x"}}Cancel merge</button> | |
| 424 | </form> | |
| 425 | {{else if .CanMerge}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
426 | <form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/merge"> |
|
707dfd10
Keenan Nemetz
10d ago
|
427 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 428 | <button class="success" type="submit"{{if .MergeBlocked}} disabled{{end}}>{{icon "git-merge"}}{{if .MergePending}}Merge when ready{{else}}Merge{{end}}</button> | |
| 429 | </form> | |
| 430 | {{end}} | |
| 431 | {{if .CanClose}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
432 | <form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/state"> |
|
707dfd10
Keenan Nemetz
10d ago
|
433 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 434 | <input type="hidden" name="state" value="{{if eq .Request.State "open"}}closed{{else}}open{{end}}"> | |
| 435 | <button class="{{if eq .Request.State "open"}}danger{{else}}secondary{{end}}" type="submit">{{if eq .Request.State "open"}}{{icon "circle-x"}}Close{{else}}{{icon "rotate-ccw"}}Reopen{{end}}</button> | |
| 436 | </form> | |
|
564acd4b
Keenan Nemetz
15d ago
|
437 | {{end}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
438 | </div> |
|
f6f4b1db
Keenan Nemetz
15d ago
|
439 | {{end}} |
|
707dfd10
Keenan Nemetz
10d ago
|
440 | {{end}} |
|
f6f4b1db
Keenan Nemetz
15d ago
|
441 | |
| 442 | {{define "request_tabs"}} | |
|
973fb809
Keenan Nemetz
22h ago
|
443 | <div class="tabrow subtabs"> |
| 444 | <nav class="tabs" aria-label="Change sections"> | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
445 | <a class="{{if eq .Tab "conversation"}}active{{end}}" href="/{{.Name}}/changes/{{.Request.ID}}"{{if eq .Tab "conversation"}} aria-current="page"{{end}}>{{icon "message-square"}}Conversation</a> |
| 446 | <a class="{{if eq .Tab "files"}}active{{end}}" href="/{{.Name}}/changes/{{.Request.ID}}/files"{{if eq .Tab "files"}} aria-current="page"{{end}}>{{icon "file"}}Changes <span class="chip-count">{{.FileCount}}</span></a> | |
| 447 | <a class="{{if eq .Tab "runs"}}active{{end}}" href="/{{.Name}}/changes/{{.Request.ID}}/runs"{{if eq .Tab "runs"}} aria-current="page"{{end}}>{{icon "play"}}Runs <span class="chip-count">{{len .Checks}}</span></a> | |
|
973fb809
Keenan Nemetz
22h ago
|
448 | </nav> |
| 449 | </div> | |
|
f6f4b1db
Keenan Nemetz
15d ago
|
450 | {{end}} |
| 451 | ||
|
802e0e52
Keenan Nemetz
4d ago
|
452 | {{define "request_description"}} |
| 453 | <article class="comment{{if .Details.Description.Active}} editing{{end}}" id="request-description"> | |
| 454 | <header class="comment-head"> | |
| 455 | {{$u := user .Request.Author}} | |
| 456 | <span class="comment-author">{{template "userlink" $u}}</span> | |
| 457 | <span class="muted">opened this {{since .Request.Created.Unix}}</span> | |
| 458 | <div class="comment-menu" data-comment-menu> | |
| 459 | <button type="button" class="comment-menu-toggle" data-comment-menu-toggle aria-haspopup="menu" aria-expanded="false" aria-label="Description actions">⋯</button> | |
| 460 | <div class="comment-menu-list" data-comment-menu-list role="menu" hidden> | |
| 461 | <button type="button" role="menuitem" data-copy-query="{{urlquery .Request.Description}}">Copy text</button> | |
| 462 | {{if .CanEdit}}<button type="button" role="menuitem" data-comment-edit>Edit</button>{{end}} | |
| 463 | </div> | |
| 464 | </div> | |
| 465 | </header> | |
| 466 | <div class="comment-body md"> | |
| 467 | {{if .Description}}{{.Description}}{{else}}<p class="muted">No description.</p>{{end}} | |
| 468 | </div> | |
| 469 | {{if .CanEdit}} | |
|
ed03b3d1
Keenan Nemetz
3h ago
|
470 | <form class="comment-edit-form details-edit-form" data-comment-edit-form method="post" action="/{{.Name}}/changes/{{.Request.ID}}/edit" hx-post="/{{.Name}}/changes/{{.Request.ID}}/edit" hx-target="#request-description" hx-swap="outerHTML" hx-disabled-elt="find button[type='submit']"{{if not .Details.Description.Active}} hidden{{end}}> |
|
802e0e52
Keenan Nemetz
4d ago
|
471 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 472 | <input type="hidden" name="field" value="body"> | |
| 473 | {{if .Details.Description.Error}}<p class="error">{{.Details.Description.Error}}</p>{{end}} | |
| 474 | <textarea name="body" data-autosize aria-label="Description">{{if .Details.Description.Active}}{{.Details.Description.Value}}{{else}}{{.Request.Description}}{{end}}</textarea> | |
| 475 | <div class="form-actions"> | |
| 476 | <button class="secondary" type="button" data-comment-edit-cancel>Cancel</button> | |
| 477 | <button type="submit">{{icon "check"}}Save</button> | |
| 478 | </div> | |
| 479 | </form> | |
| 480 | {{end}} | |
| 481 | </article> | |
| 482 | {{end}} | |
| 483 | ||
|
f6f4b1db
Keenan Nemetz
15d ago
|
484 | {{define "request"}} |
| 485 | {{template "header" .}} | |
|
8fb7aabf
Keenan Nemetz
3d ago
|
486 | {{template "repohead" (nav .Page "changes")}} |
|
f6f4b1db
Keenan Nemetz
15d ago
|
487 | {{template "request_head" .}} |
| 488 | {{template "request_tabs" .}} | |
|
f09ef39e
Keenan Nemetz
15d ago
|
489 | |
| 490 | <div class="thread"> | |
| 491 | <div class="thread-main"> | |
|
802e0e52
Keenan Nemetz
4d ago
|
492 | {{template "request_description" .}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
493 | |
|
c717d4eb
Keenan Nemetz
13d ago
|
494 | {{template "comment_thread" .Thread}} |
|
f09ef39e
Keenan Nemetz
15d ago
|
495 | </div> |
| 496 | ||
|
f6f4b1db
Keenan Nemetz
15d ago
|
497 | <aside class="thread-side"> |
|
d3dcf54d
Keenan Nemetz
11d ago
|
498 | {{template "request_aside" .}} |
|
f6f4b1db
Keenan Nemetz
15d ago
|
499 | </aside> |
|
f09ef39e
Keenan Nemetz
15d ago
|
500 | </div> |
| 501 | {{template "footer" .}} | |
| 502 | {{end}} |