Commit 7625f6da48
Verified · cmc ci/build: success ci/quality: success ci/test: failure
Layout: unified · split
Changed files (12)
- internal/web/static/app.js +19 −3
- internal/web/static/style.css +7
- internal/web/templates/blob.html +7 −1
- internal/web/templates/commit.html +7 −3
- internal/web/templates/compare.html +6 −2
- internal/web/templates/explore.html +2 −1
- internal/web/templates/globalsearch.html +2 −2
- internal/web/templates/labels.html +20 −12
- internal/web/templates/milestones.html +11 −7
- internal/web/templates/orglabels.html +20 −12
- internal/web/templates/orgmilestones.html +11 −7
- internal/web/templates/refs.html +21 −5
internal/web/static/app.js +19 −3
| @@ -76,7 +76,19 @@ | |||
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | // ---- 3. In-place fragment swaps (previews, reactions, header toggles, sidebar pickers) ---- | 79 | document.addEventListener('click', async (e) => { |
| 80 | const btn = e.target.closest('button[data-copy]'); | ||
| 81 | if (!btn) return; | ||
| 82 | const orig = btn.textContent; | ||
| 83 | try { | ||
| 84 | await navigator.clipboard.writeText(btn.dataset.copy); | ||
| 85 | btn.textContent = 'Copied'; | ||
| 86 | showToast('Copied to clipboard'); | ||
| 87 | setTimeout(() => { btn.textContent = orig; }, 1400); | ||
| 88 | } catch { | ||
| 89 | showToast('Copy failed', true); | ||
| 90 | } | ||
| 91 | }); | ||
| 80 | document.addEventListener('submit', async (e) => { | 92 | document.addEventListener('submit', async (e) => { |
| 81 | const form = e.target; | 93 | const form = e.target; |
| 82 | if (!(form instanceof HTMLFormElement) || form.method.toLowerCase() !== 'post') return; | 94 | if (!(form instanceof HTMLFormElement) || form.method.toLowerCase() !== 'post') return; |
| @@ -269,8 +281,12 @@ | |||
| 269 | let active = 0; | 281 | let active = 0; |
| 270 | 282 | ||
| 271 | const render = () => { | 283 | const render = () => { |
| 272 | const q = input.value.trim().toLowerCase(); | 284 | const raw = input.value.trim(); |
| 273 | const filtered = q ? all.filter((it) => (it.label + ' ' + it.group).toLowerCase().includes(q)) : all; | 285 | const q = raw.toLowerCase(); |
| 286 | const filtered = q ? all.filter((it) => (it.label + ' ' + it.group).toLowerCase().includes(q)) : all.slice(); | ||
| 287 | if (raw) { | ||
| 288 | filtered.push({ group: 'Search', label: `Search “${raw}”…`, href: '/search?q=' + encodeURIComponent(raw) }); | ||
| 289 | } | ||
| 274 | active = Math.min(active, Math.max(0, filtered.length - 1)); | 290 | active = Math.min(active, Math.max(0, filtered.length - 1)); |
| 275 | list.textContent = ''; | 291 | list.textContent = ''; |
| 276 | if (filtered.length === 0) { | 292 | if (filtered.length === 0) { |
internal/web/static/style.css +7
| @@ -2467,3 +2467,10 @@ article.release.setcard { | |||
| 2467 | } | 2467 | } |
| 2468 | .commitbar input { flex: 1 1 16rem; min-width: 0; } | 2468 | .commitbar input { flex: 1 1 16rem; min-width: 0; } |
| 2469 | .rendered .copywrap .copybtn { top: var(--sp-2); transform: none; } | 2469 | .rendered .copywrap .copybtn { top: var(--sp-2); transform: none; } |
| 2470 | .btngroup a.btn[aria-current="page"] { | ||
| 2471 | border-color: var(--mark); | ||
| 2472 | background: var(--surface); | ||
| 2473 | color: var(--fg); | ||
| 2474 | font-weight: 600; | ||
| 2475 | } | ||
| 2476 | .commithead.setcard pre.message { margin: var(--sp-3) 0 0; } | ||
internal/web/templates/blob.html +7 −1
| @@ -9,7 +9,13 @@ | |||
| 9 | {{template "refmenu" .}} | 9 | {{template "refmenu" .}} |
| 10 | <span class="crumbs"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}">{{.Repo.Name}}</a>/{{range .Crumbs}}<a href="{{.URL}}">{{.Name}}</a>/{{end}}<strong>{{.Base}}</strong></span> | 10 | <span class="crumbs"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}">{{.Repo.Name}}</a>/{{range .Crumbs}}<a href="{{.URL}}">{{.Name}}</a>/{{end}}<strong>{{.Base}}</strong></span> |
| 11 | <span class="spacer"></span> | 11 | <span class="spacer"></span> |
| 12 | <span class="actions">{{if .Renderable}}{{if .Rendered}}<strong>rendered</strong> · <a href="?view=source">source</a>{{else}}<a href="?">rendered</a> · <strong>source</strong>{{end}} · {{end}}<a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}?path={{.Path}}">history</a> · {{if not .Binary}}<a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blame/{{.Ref}}/{{.Path}}">blame</a> · {{end}}<a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">raw</a>{{if .Viewer}} · <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}">edit</a>{{end}}</span> | 12 | <div class="btngroup"> |
| 13 | {{if .Renderable}}{{if .Rendered}}<a class="button btn" aria-current="page" href="?">Rendered</a><a class="button btn" href="?view=source">Source</a>{{else}}<a class="button btn" href="?">Rendered</a><a class="button btn" aria-current="page" href="?view=source">Source</a>{{end}}{{end}} | ||
| 14 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}?path={{.Path}}">History</a> | ||
| 15 | {{if not .Binary}}<a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blame/{{.Ref}}/{{.Path}}">Blame</a>{{end}} | ||
| 16 | <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">Raw</a> | ||
| 17 | {{if .Viewer}}<a class="button" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}">Edit</a>{{end}} | ||
| 18 | </div> | ||
| 13 | </div> | 19 | </div> |
| 14 | <p class="filefacts">{{if .Lines}}{{.Lines}} lines · {{end}}{{.Size}} bytes{{if .Exec}} · executable{{end}}{{if .Symlink}} · symlink{{end}}</p> | 20 | <p class="filefacts">{{if .Lines}}{{.Lines}} lines · {{end}}{{.Size}} bytes{{if .Exec}} · executable{{end}}{{if .Symlink}} · symlink{{end}}</p> |
| 15 | {{if .Symbols}}<details class="symlist"><summary>{{len .Symbols}} symbol{{if ne (len .Symbols) 1}}s{{end}} in this file</summary> | 21 | {{if .Symbols}}<details class="symlist"><summary>{{len .Symbols}} symbol{{if ne (len .Symbols) 1}}s{{end}} in this file</summary> |
internal/web/templates/commit.html +7 −3
| @@ -1,15 +1,19 @@ | |||
| 1 | {{define "width"}}wide{{end}} | 1 | {{define "width"}}wide{{end}} |
| 2 | {{define "title"}}{{.ShortSHA}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} | 2 | {{define "title"}}{{.ShortSHA}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 3 | {{define "content"}} | 3 | {{define "content"}} |
| 4 | <div class="commithead"> | 4 | <div class="commithead setcard"> |
| 5 | <h1>Commit <code>{{.ShortSHA}}</code></h1> | 5 | <div class="pagehead"> |
| 6 | <h1>Commit <code>{{.ShortSHA}}</code></h1> | ||
| 7 | <span class="grow"></span> | ||
| 8 | <button type="button" class="btn" data-copy="{{.SHA}}">Copy SHA</button> | ||
| 9 | </div> | ||
| 6 | <p class="meta"><code class="fullsha">{{.SHA}}</code></p> | 10 | <p class="meta"><code class="fullsha">{{.SHA}}</code></p> |
| 7 | {{if .Parents}}<p class="meta">parent{{if gt (len .Parents) 1}}s{{end}}:{{range .Parents}} <code><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.}}">{{short .}}</a></code>{{end}}</p>{{end}} | 11 | {{if .Parents}}<p class="meta">parent{{if gt (len .Parents) 1}}s{{end}}:{{range .Parents}} <code><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.}}">{{short .}}</a></code>{{end}}</p>{{end}} |
| 8 | <p>{{template "sigbadge" .Sig}}{{range .Checks}} <span class="badge check-{{.State}}">{{.Context}}: {{.State}}</span>{{end}}</p> | 12 | <p>{{template "sigbadge" .Sig}}{{range .Checks}} <span class="badge check-{{.State}}">{{.Context}}: {{.State}}</span>{{end}}</p> |
| 9 | <p class="meta">{{template "authorname" dict "Name" .AuthorName "User" .AuthorUser "Email" .AuthorEmail}} <{{.AuthorEmail}}> · {{when .Date}} | 13 | <p class="meta">{{template "authorname" dict "Name" .AuthorName "User" .AuthorUser "Email" .AuthorEmail}} <{{.AuthorEmail}}> · {{when .Date}} |
| 10 | {{if .CommitterEmail}}<br>committer: <{{.CommitterEmail}}>{{end}}</p> | 14 | {{if .CommitterEmail}}<br>committer: <{{.CommitterEmail}}>{{end}}</p> |
| 15 | <pre class="message" tabindex="0">{{.Message}}</pre> | ||
| 11 | </div> | 16 | </div> |
| 12 | <pre class="message" tabindex="0">{{.Message}}</pre> | ||
| 13 | {{if .DiffTruncated}}<p class="error" role="alert">This patch is larger than 4 MiB and is cut off below. Clone the repository to see all of it.</p>{{end}} | 17 | {{if .DiffTruncated}}<p class="error" role="alert">This patch is larger than 4 MiB and is cut off below. Clone the repository to see all of it.</p>{{end}} |
| 14 | {{template "difffiles" dict "Files" .DiffFiles "Base" "" "Viewer" "" "L" .Layout}} | 18 | {{template "difffiles" dict "Files" .DiffFiles "Base" "" "Viewer" "" "L" .Layout}} |
| 15 | {{end}} | 19 | {{end}} |
internal/web/templates/compare.html +6 −2
| @@ -1,8 +1,12 @@ | |||
| 1 | {{define "width"}}wide{{end}} | 1 | {{define "width"}}wide{{end}} |
| 2 | {{define "title"}}compare {{.Base}}...{{.Head}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} | 2 | {{define "title"}}compare {{.Base}}...{{.Head}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 3 | {{define "content"}} | 3 | {{define "content"}} |
| 4 | <h1>Compare <code>{{.Base}}</code> … <code>{{.Head}}</code></h1> | 4 | <div class="pagehead"> |
| 5 | <p class="meta">{{len .Commits}}{{if gt .CommitsTotal (len .Commits)}} of {{.CommitsTotal}}{{end}} commit{{if ne .CommitsTotal 1}}s{{end}} on <code>{{.Head}}</code> since the merge base <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/commit/{{.MergeBase}}"><code>{{short .MergeBase}}</code></a>{{if .CanOpenMR}} · <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/mrs/new?source={{.Head}}&target={{.Base}}">open a merge request</a>{{end}}</p> | 5 | <h1>Compare <code>{{.Base}}</code> … <code>{{.Head}}</code></h1> |
| 6 | <span class="grow"></span> | ||
| 7 | {{if .CanOpenMR}}<a class="button" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/mrs/new?source={{.Head}}&target={{.Base}}">Open merge request</a>{{end}} | ||
| 8 | </div> | ||
| 9 | <p class="meta">{{len .Commits}}{{if gt .CommitsTotal (len .Commits)}} of {{.CommitsTotal}}{{end}} commit{{if ne .CommitsTotal 1}}s{{end}} on <code>{{.Head}}</code> since the merge base <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/commit/{{.MergeBase}}"><code>{{short .MergeBase}}</code></a></p> | ||
| 6 | {{if .Commits}}<ul class="loglist"> | 10 | {{if .Commits}}<ul class="loglist"> |
| 7 | {{range .Commits}}<li> | 11 | {{range .Commits}}<li> |
| 8 | <div class="commitmain"> | 12 | <div class="commitmain"> |
internal/web/templates/explore.html +2 −1
| @@ -1,7 +1,7 @@ | |||
| 1 | {{define "width"}}wide{{end}} | 1 | {{define "width"}}wide{{end}} |
| 2 | {{define "title"}}explore · {{.Site}}{{end}} | 2 | {{define "title"}}explore · {{.Site}}{{end}} |
| 3 | {{define "content"}} | 3 | {{define "content"}} |
| 4 | <div class="withcol"> | 4 | <div class="withcol" id="explore-root"> |
| 5 | {{template "sidecol" .Facets}} | 5 | {{template "sidecol" .Facets}} |
| 6 | <div class="colmain"> | 6 | <div class="colmain"> |
| 7 | <div class="headrow"> | 7 | <div class="headrow"> |
| @@ -11,6 +11,7 @@ | |||
| 11 | <button type="submit" class="btn">Search</button> | 11 | <button type="submit" class="btn">Search</button> |
| 12 | </form> | 12 | </form> |
| 13 | <span class="spacer"></span> | 13 | <span class="spacer"></span> |
| 14 | {{if .Viewer}}<a class="button" href="/new">New repository</a>{{end}} | ||
| 14 | </div> | 15 | </div> |
| 15 | <p class="meta">{{.Total}} repositor{{if eq .Total 1}}y{{else}}ies{{end}}{{if .Query}} matching <strong>{{.Query}}</strong>, <a href="/explore">clear filter</a>{{end}}</p> | 16 | <p class="meta">{{.Total}} repositor{{if eq .Total 1}}y{{else}}ies{{end}}{{if .Query}} matching <strong>{{.Query}}</strong>, <a href="/explore">clear filter</a>{{end}}</p> |
| 16 | <ul class="repolist rows"> | 17 | <ul class="repolist rows"> |
internal/web/templates/globalsearch.html +2 −2
| @@ -1,8 +1,8 @@ | |||
| 1 | {{define "width"}}wide{{end}} | 1 | {{define "width"}}wide{{end}} |
| 2 | {{define "title"}}search · {{.Site}}{{end}} | 2 | {{define "title"}}search · {{.Site}}{{end}} |
| 3 | {{define "content"}} | 3 | {{define "content"}} |
| 4 | <div class="withcol"> | 4 | <div class="withcol" id="search-root"> |
| 5 | <nav class="sidecol" aria-label="Filters"> | 5 | <nav class="sidecol" aria-label="Filters" data-tab-swap="search-root"> |
| 6 | <details class="sidedrop"> | 6 | <details class="sidedrop"> |
| 7 | <summary><span class="sideword">Filters</span>{{if .Kind}} <span class="sideon">{{.Kind}}</span>{{end}}</summary> | 7 | <summary><span class="sideword">Filters</span>{{if .Kind}} <span class="sideon">{{.Kind}}</span>{{end}}</summary> |
| 8 | <div class="grp"><h2 class="colhead">Kind</h2> | 8 | <div class="grp"><h2 class="colhead">Kind</h2> |
internal/web/templates/labels.html +20 −12
| @@ -1,10 +1,15 @@ | |||
| 1 | {{define "title"}}labels · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} | 1 | {{define "title"}}labels · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 2 | {{define "content"}} | 2 | {{define "content"}} |
| 3 | <h1>Labels</h1> | 3 | <div class="pagehead"> |
| 4 | <h1>Labels <span class="chip">{{len .Labels}}</span></h1> | ||
| 5 | <span class="grow"></span> | ||
| 6 | {{if .Labels}}<input type="search" class="tablefilter" placeholder="Filter labels…" aria-label="Filter labels" data-filter-table="labels-table">{{end}} | ||
| 7 | </div> | ||
| 4 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} | 8 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} |
| 5 | {{if .Labels}}<div class="tablewrap"><table class="keys"> | 9 | <section class="setcard"> |
| 6 | <tr class="cols"><th scope="col">label</th>{{if or $.CanWrite $.AnyColor}}<th scope="col">colour</th>{{end}}<th scope="col">issues</th><th scope="col">merge requests</th><th scope="col"><span class="vh">actions</span></th></tr> | 10 | {{if .Labels}}<div class="tablewrap"><table class="keys" id="labels-table"> |
| 7 | {{range .Labels}}<tr> | 11 | <thead><tr class="cols"><th scope="col">label</th>{{if or $.CanWrite $.AnyColor}}<th scope="col">colour</th>{{end}}<th scope="col">issues</th><th scope="col">merge requests</th><th scope="col"><span class="vh">actions</span></th></tr></thead> |
| 12 | <tbody>{{range .Labels}}<tr> | ||
| 8 | <td><a class="chip label" style="{{index $.LabelColors .Name}}" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/issues?label={{.Name}}">{{.Name}}</a>{{if .Org}} <span class="chip chip-neutral">org</span>{{end}}</td> | 13 | <td><a class="chip label" style="{{index $.LabelColors .Name}}" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/issues?label={{.Name}}">{{.Name}}</a>{{if .Org}} <span class="chip chip-neutral">org</span>{{end}}</td> |
| 9 | {{if or $.CanWrite $.AnyColor}}<td>{{if and $.CanWrite (not .Org)}}<form method="post" action="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/labels" class="inline"> | 14 | {{if or $.CanWrite $.AnyColor}}<td>{{if and $.CanWrite (not .Org)}}<form method="post" action="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/labels" class="inline"> |
| 10 | <input type="hidden" name="name" value="{{.Name}}"> | 15 | <input type="hidden" name="name" value="{{.Name}}"> |
| @@ -13,14 +18,16 @@ | |||
| 13 | </form>{{else}}<span class="mono">{{if .Color}}{{.Color}}{{else}}—{{end}}</span>{{end}}</td>{{end}} | 18 | </form>{{else}}<span class="mono">{{if .Color}}{{.Color}}{{else}}—{{end}}</span>{{end}}</td>{{end}} |
| 14 | <td>{{.Issues}}</td> | 19 | <td>{{.Issues}}</td> |
| 15 | <td>{{.MRs}}</td> | 20 | <td>{{.MRs}}</td> |
| 16 | <td class="act">{{if and $.CanWrite (not .Org)}}<form method="post" action="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/labels" class="inline"> | 21 | <td class="act">{{if and $.CanWrite (not .Org)}}<details class="popover"><summary class="popbtn popbtn-danger">Remove</summary><div class="popmenu"> |
| 17 | <input type="hidden" name="action" value="remove"> | 22 | <form method="post" action="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/labels" class="popform popform-stack"> |
| 18 | <input type="hidden" name="name" value="{{.Name}}"> | 23 | <input type="hidden" name="action" value="remove"> |
| 19 | {{template "confirmfield" .Name}} | 24 | <input type="hidden" name="name" value="{{.Name}}"> |
| 20 | <button type="submit" class="danger">Remove</button> | 25 | {{template "confirmfield" .Name}} |
| 21 | </form>{{else if .Org}}<a href="/{{$.Repo.OwnerName}}/-/labels">org</a>{{end}}</td> | 26 | <button type="submit" class="danger">Remove</button> |
| 27 | </form> | ||
| 28 | </div></details>{{else if .Org}}<a href="/{{$.Repo.OwnerName}}/-/labels">org</a>{{end}}</td> | ||
| 22 | </tr> | 29 | </tr> |
| 23 | {{end}}</table></div> | 30 | {{end}}</tbody></table></div> |
| 24 | {{else}}<p class="none">No labels yet.</p>{{end}} | 31 | {{else}}<p class="none">No labels yet.</p>{{end}} |
| 25 | {{if .CanWrite}} | 32 | {{if .CanWrite}} |
| 26 | <details class="editbox"> | 33 | <details class="editbox"> |
| @@ -30,9 +37,10 @@ | |||
| 30 | <input type="text" id="labelname" name="name" maxlength="50" required> | 37 | <input type="text" id="labelname" name="name" maxlength="50" required> |
| 31 | <label for="labelcolor">Colour</label> | 38 | <label for="labelcolor">Colour</label> |
| 32 | <input type="text" id="labelcolor" name="color" placeholder="rrggbb, or blank for one picked from the name"> | 39 | <input type="text" id="labelcolor" name="color" placeholder="rrggbb, or blank for one picked from the name"> |
| 33 | <button type="submit" class="btn">Create label</button> | 40 | <span class="btngroup"><button type="submit">Create label</button></span> |
| 34 | </form> | 41 | </form> |
| 35 | </details> | 42 | </details> |
| 36 | <p class="meta">Removing a label takes it off every issue and merge request that carries it.</p> | 43 | <p class="meta">Removing a label takes it off every issue and merge request that carries it.</p> |
| 37 | {{end}} | 44 | {{end}} |
| 45 | </section> | ||
| 38 | {{end}} | 46 | {{end}} |
internal/web/templates/milestones.html +11 −7
| @@ -1,13 +1,14 @@ | |||
| 1 | {{define "title"}}milestones · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} | 1 | {{define "title"}}milestones · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 2 | {{define "content"}} | 2 | {{define "content"}} |
| 3 | <div class="listhead"> | 3 | <div id="milestones-root"> |
| 4 | <div class="pagehead"> | ||
| 4 | <h1>Milestones</h1> | 5 | <h1>Milestones</h1> |
| 5 | <nav class="filters"> | ||
| 6 | <a {{if eq .State "open"}}class="active" aria-current="page" {{end}}href="?state=open">open</a> | ||
| 7 | <a {{if eq .State "closed"}}class="active" aria-current="page" {{end}}href="?state=closed">closed</a> | ||
| 8 | <a {{if eq .State "all"}}class="active" aria-current="page" {{end}}href="?state=all">all</a> | ||
| 9 | </nav> | ||
| 10 | </div> | 6 | </div> |
| 7 | <nav class="statebar" aria-label="State" data-tab-swap="milestones-root"> | ||
| 8 | <a {{if eq .State "open"}}aria-current="page" {{end}}href="?state=open">open</a> | ||
| 9 | <a {{if eq .State "closed"}}aria-current="page" {{end}}href="?state=closed">closed</a> | ||
| 10 | <a {{if eq .State "all"}}aria-current="page" {{end}}href="?state=all">all</a> | ||
| 11 | </nav> | ||
| 11 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} | 12 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} |
| 12 | {{if .CanWrite}} | 13 | {{if .CanWrite}} |
| 13 | <details class="editbox"> | 14 | <details class="editbox"> |
| @@ -19,10 +20,11 @@ | |||
| 19 | <input type="text" id="msdesc" name="description"> | 20 | <input type="text" id="msdesc" name="description"> |
| 20 | <label for="msdue">Due</label> | 21 | <label for="msdue">Due</label> |
| 21 | <input type="text" id="msdue" name="due" placeholder="YYYY-MM-DD"> | 22 | <input type="text" id="msdue" name="due" placeholder="YYYY-MM-DD"> |
| 22 | <button type="submit" class="btn">Create milestone</button> | 23 | <span class="btngroup"><button type="submit">Create milestone</button></span> |
| 23 | </form> | 24 | </form> |
| 24 | </details> | 25 | </details> |
| 25 | {{end}} | 26 | {{end}} |
| 27 | <section class="setcard"> | ||
| 26 | <ul class="milestonelist"> | 28 | <ul class="milestonelist"> |
| 27 | {{range .Milestones}}<li> | 29 | {{range .Milestones}}<li> |
| 28 | <div class="msmain"> | 30 | <div class="msmain"> |
| @@ -38,4 +40,6 @@ | |||
| 38 | </li> | 40 | </li> |
| 39 | {{else}}<li class="empty">no {{if ne .State "all"}}{{.State}} {{end}}milestones</li>{{end}} | 41 | {{else}}<li class="empty">no {{if ne .State "all"}}{{.State}} {{end}}milestones</li>{{end}} |
| 40 | </ul> | 42 | </ul> |
| 43 | </section> | ||
| 44 | </div> | ||
| 41 | {{end}} | 45 | {{end}} |
internal/web/templates/orglabels.html +20 −12
| @@ -1,11 +1,16 @@ | |||
| 1 | {{define "title"}}labels · {{.Org}}{{end}} | 1 | {{define "title"}}labels · {{.Org}}{{end}} |
| 2 | {{define "content"}} | 2 | {{define "content"}} |
| 3 | <h1><a href="/{{.Org}}">{{.Org}}</a> labels</h1> | 3 | <div class="pagehead"> |
| 4 | <h1><a href="/{{.Org}}">{{.Org}}</a> labels <span class="chip">{{len .Labels}}</span></h1> | ||
| 5 | <span class="grow"></span> | ||
| 6 | {{if .Labels}}<input type="search" class="tablefilter" placeholder="Filter labels…" aria-label="Filter labels" data-filter-table="org-labels-table">{{end}} | ||
| 7 | </div> | ||
| 4 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} | 8 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} |
| 5 | <p class="meta">Every repository under {{.Org}} sees these beside its own. Counts span the repositories you can read.</p> | 9 | <p class="meta">Every repository under {{.Org}} sees these beside its own. Counts span the repositories you can read.</p> |
| 6 | {{if .Labels}}<div class="tablewrap"><table class="keys"> | 10 | <section class="setcard"> |
| 7 | <tr class="cols"><th scope="col">label</th><th scope="col">colour</th><th scope="col">issues</th><th scope="col">merge requests</th>{{if .CanAdmin}}<th scope="col"><span class="vh">actions</span></th>{{end}}</tr> | 11 | {{if .Labels}}<div class="tablewrap"><table class="keys" id="org-labels-table"> |
| 8 | {{range .Labels}}<tr> | 12 | <thead><tr class="cols"><th scope="col">label</th><th scope="col">colour</th><th scope="col">issues</th><th scope="col">merge requests</th>{{if .CanAdmin}}<th scope="col"><span class="vh">actions</span></th>{{end}}</tr></thead> |
| 13 | <tbody>{{range .Labels}}<tr> | ||
| 9 | <td><span class="chip label" style="{{index $.LabelColors .Name}}">{{.Name}}</span></td> | 14 | <td><span class="chip label" style="{{index $.LabelColors .Name}}">{{.Name}}</span></td> |
| 10 | <td>{{if $.CanAdmin}}<form method="post" action="/{{$.Org}}/-/labels" class="inline"> | 15 | <td>{{if $.CanAdmin}}<form method="post" action="/{{$.Org}}/-/labels" class="inline"> |
| 11 | <input type="hidden" name="name" value="{{.Name}}"> | 16 | <input type="hidden" name="name" value="{{.Name}}"> |
| @@ -14,14 +19,16 @@ | |||
| 14 | </form>{{else}}<span class="mono">{{if .Color}}{{.Color}}{{else}}—{{end}}</span>{{end}}</td> | 19 | </form>{{else}}<span class="mono">{{if .Color}}{{.Color}}{{else}}—{{end}}</span>{{end}}</td> |
| 15 | <td>{{.Issues}}</td> | 20 | <td>{{.Issues}}</td> |
| 16 | <td>{{.MRs}}</td> | 21 | <td>{{.MRs}}</td> |
| 17 | {{if $.CanAdmin}}<td class="act"><form method="post" action="/{{$.Org}}/-/labels" class="inline"> | 22 | {{if $.CanAdmin}}<td class="act"><details class="popover"><summary class="popbtn popbtn-danger">Remove</summary><div class="popmenu"> |
| 18 | <input type="hidden" name="action" value="remove"> | 23 | <form method="post" action="/{{$.Org}}/-/labels" class="popform popform-stack"> |
| 19 | <input type="hidden" name="name" value="{{.Name}}"> | 24 | <input type="hidden" name="action" value="remove"> |
| 20 | {{template "confirmfield" .Name}} | 25 | <input type="hidden" name="name" value="{{.Name}}"> |
| 21 | <button type="submit" class="danger">Remove</button> | 26 | {{template "confirmfield" .Name}} |
| 22 | </form></td>{{end}} | 27 | <button type="submit" class="danger">Remove</button> |
| 28 | </form> | ||
| 29 | </div></details></td>{{end}} | ||
| 23 | </tr> | 30 | </tr> |
| 24 | {{end}}</table></div> | 31 | {{end}}</tbody></table></div> |
| 25 | {{else}}<p class="none">No org labels yet.</p>{{end}} | 32 | {{else}}<p class="none">No org labels yet.</p>{{end}} |
| 26 | {{if .CanAdmin}} | 33 | {{if .CanAdmin}} |
| 27 | <details class="editbox"> | 34 | <details class="editbox"> |
| @@ -31,9 +38,10 @@ | |||
| 31 | <input type="text" id="labelname" name="name" maxlength="50" required> | 38 | <input type="text" id="labelname" name="name" maxlength="50" required> |
| 32 | <label for="labelcolor">Colour</label> | 39 | <label for="labelcolor">Colour</label> |
| 33 | <input type="text" id="labelcolor" name="color" placeholder="rrggbb, or blank for one picked from the name"> | 40 | <input type="text" id="labelcolor" name="color" placeholder="rrggbb, or blank for one picked from the name"> |
| 34 | <button type="submit" class="btn">Create label</button> | 41 | <span class="btngroup"><button type="submit">Create label</button></span> |
| 35 | </form> | 42 | </form> |
| 36 | </details> | 43 | </details> |
| 37 | <p class="meta">Removing a label takes it off every issue and merge request under {{.Org}}. Creating one folds in same-named repository labels.</p> | 44 | <p class="meta">Removing a label takes it off every issue and merge request under {{.Org}}. Creating one folds in same-named repository labels.</p> |
| 38 | {{end}} | 45 | {{end}} |
| 46 | </section> | ||
| 39 | {{end}} | 47 | {{end}} |
internal/web/templates/orgmilestones.html +11 −7
| @@ -1,13 +1,14 @@ | |||
| 1 | {{define "title"}}milestones · {{.Org}}{{end}} | 1 | {{define "title"}}milestones · {{.Org}}{{end}} |
| 2 | {{define "content"}} | 2 | {{define "content"}} |
| 3 | <div class="listhead"> | 3 | <div id="milestones-root"> |
| 4 | <div class="pagehead"> | ||
| 4 | <h1><a href="/{{.Org}}">{{.Org}}</a> milestones</h1> | 5 | <h1><a href="/{{.Org}}">{{.Org}}</a> milestones</h1> |
| 5 | <nav class="filters"> | ||
| 6 | <a {{if eq .State "open"}}class="active" aria-current="page" {{end}}href="?state=open">open</a> | ||
| 7 | <a {{if eq .State "closed"}}class="active" aria-current="page" {{end}}href="?state=closed">closed</a> | ||
| 8 | <a {{if eq .State "all"}}class="active" aria-current="page" {{end}}href="?state=all">all</a> | ||
| 9 | </nav> | ||
| 10 | </div> | 6 | </div> |
| 7 | <nav class="statebar" aria-label="State" data-tab-swap="milestones-root"> | ||
| 8 | <a {{if eq .State "open"}}aria-current="page" {{end}}href="?state=open">open</a> | ||
| 9 | <a {{if eq .State "closed"}}aria-current="page" {{end}}href="?state=closed">closed</a> | ||
| 10 | <a {{if eq .State "all"}}aria-current="page" {{end}}href="?state=all">all</a> | ||
| 11 | </nav> | ||
| 11 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} | 12 | {{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}} |
| 12 | {{if .CanAdmin}} | 13 | {{if .CanAdmin}} |
| 13 | <details class="editbox"> | 14 | <details class="editbox"> |
| @@ -19,11 +20,12 @@ | |||
| 19 | <input type="text" id="msdesc" name="description"> | 20 | <input type="text" id="msdesc" name="description"> |
| 20 | <label for="msdue">Due</label> | 21 | <label for="msdue">Due</label> |
| 21 | <input type="text" id="msdue" name="due" placeholder="YYYY-MM-DD"> | 22 | <input type="text" id="msdue" name="due" placeholder="YYYY-MM-DD"> |
| 22 | <button type="submit" class="btn">Create milestone</button> | 23 | <span class="btngroup"><button type="submit">Create milestone</button></span> |
| 23 | </form> | 24 | </form> |
| 24 | </details> | 25 | </details> |
| 25 | {{end}} | 26 | {{end}} |
| 26 | <p class="meta">Progress spans the repositories under {{.Org}} you can read.</p> | 27 | <p class="meta">Progress spans the repositories under {{.Org}} you can read.</p> |
| 28 | <section class="setcard"> | ||
| 27 | <ul class="milestonelist"> | 29 | <ul class="milestonelist"> |
| 28 | {{range .Milestones}}<li> | 30 | {{range .Milestones}}<li> |
| 29 | <div class="msmain"> | 31 | <div class="msmain"> |
| @@ -39,4 +41,6 @@ | |||
| 39 | </li> | 41 | </li> |
| 40 | {{else}}<li class="empty">no {{if ne .State "all"}}{{.State}} {{end}}org milestones</li>{{end}} | 42 | {{else}}<li class="empty">no {{if ne .State "all"}}{{.State}} {{end}}org milestones</li>{{end}} |
| 41 | </ul> | 43 | </ul> |
| 44 | </section> | ||
| 45 | </div> | ||
| 42 | {{end}} | 46 | {{end}} |
internal/web/templates/refs.html +21 −5
| @@ -1,13 +1,29 @@ | |||
| 1 | {{define "title"}}refs · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} | 1 | {{define "title"}}refs · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}} |
| 2 | {{define "content"}} | 2 | {{define "content"}} |
| 3 | <h1>Refs</h1> | 3 | <div class="pagehead"> |
| 4 | <h1>Refs</h1> | ||
| 5 | </div> | ||
| 6 | <section class="setcard"> | ||
| 4 | <form method="get" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/compare" class="compareform"> | 7 | <form method="get" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/compare" class="compareform"> |
| 5 | <label>Compare <input name="base" value="{{.Repo.DefaultBranch}}" size="14" aria-label="Compare base ref" autocomplete="off" spellcheck="false"></label> | 8 | <label>Compare <input name="base" value="{{.Repo.DefaultBranch}}" size="14" aria-label="Compare base ref" autocomplete="off" spellcheck="false"></label> |
| 6 | <label>with <input name="head" size="14" placeholder="branch, tag or sha" aria-label="with head ref" autocomplete="off" spellcheck="false"></label> | 9 | <label>with <input name="head" size="14" placeholder="branch, tag or sha" aria-label="with head ref" autocomplete="off" spellcheck="false"></label> |
| 7 | <button type="submit" class="btn">Compare</button> | 10 | <button type="submit" class="btn">Compare</button> |
| 8 | </form> | 11 | </form> |
| 9 | <h2>Branches</h2> | 12 | </section> |
| 10 | <table class="refs"><thead><tr><th scope="col">Branch</th><th scope="col">Commit</th></tr></thead>{{range .Branches}}<tr><td class="name">{{template "branchicon"}} <a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/tree/{{.Name}}/">{{.Name}}</a></td><td class="sha"><code>{{short .SHA}}</code></td></tr>{{else}}<tr><td class="empty">none</td></tr>{{end}}</table> | 13 | <section class="setcard"> |
| 11 | <h2>Tags</h2> | 14 | <div class="pagehead"> |
| 12 | <table class="refs"><thead><tr><th scope="col">Tag</th><th scope="col">Commit</th></tr></thead>{{range .Tags}}<tr><td class="name"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/tree/{{.Name}}/">{{.Name}}</a></td><td class="sha"><code>{{short .SHA}}</code></td></tr>{{else}}<tr><td class="empty">none</td></tr>{{end}}</table> | 15 | <h2>Branches <span class="chip">{{len .Branches}}</span></h2> |
| 16 | <span class="grow"></span> | ||
| 17 | {{if .Branches}}<input type="search" class="tablefilter" placeholder="Filter branches…" aria-label="Filter branches" data-filter-table="refs-branches">{{end}} | ||
| 18 | </div> | ||
| 19 | <div class="tablewrap"><table class="refs" id="refs-branches"><thead><tr><th scope="col">Branch</th><th scope="col">Commit</th></tr></thead><tbody>{{range .Branches}}<tr><td class="name">{{template "branchicon"}} <a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/tree/{{.Name}}/">{{.Name}}</a></td><td class="sha"><code>{{short .SHA}}</code></td></tr>{{else}}<tr><td class="empty" colspan="2">none</td></tr>{{end}}</tbody></table></div> | ||
| 20 | </section> | ||
| 21 | <section class="setcard"> | ||
| 22 | <div class="pagehead"> | ||
| 23 | <h2>Tags <span class="chip">{{len .Tags}}</span></h2> | ||
| 24 | <span class="grow"></span> | ||
| 25 | {{if .Tags}}<input type="search" class="tablefilter" placeholder="Filter tags…" aria-label="Filter tags" data-filter-table="refs-tags">{{end}} | ||
| 26 | </div> | ||
| 27 | <div class="tablewrap"><table class="refs" id="refs-tags"><thead><tr><th scope="col">Tag</th><th scope="col">Commit</th></tr></thead><tbody>{{range .Tags}}<tr><td class="name"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/tree/{{.Name}}/">{{.Name}}</a></td><td class="sha"><code>{{short .SHA}}</code></td></tr>{{else}}<tr><td class="empty" colspan="2">none</td></tr>{{end}}</tbody></table></div> | ||
| 28 | </section> | ||
| 13 | {{end}} | 29 | {{end}} |