internal/web/templates/dashboard.html

v1.36.0
gitbay/internal/web/templates/dashboard.html history · blame · raw

54 lines · 3735 bytes

 1{{define "width"}}wide{{end}}
 2{{define "title"}}dashboard · {{.Site}}{{end}}
 3{{define "itemlist"}}
 4<ul class="issuelist rows">
 5{{range .Items}}<li>
 6  <div class="issuemain">
 7    <p class="title"><a href="/{{.RepoPath}}/{{$.Kind}}/{{.Number}}">{{.Title}}</a></p>
 8    <p class="meta"><span class="repo">{{.RepoPath}}{{if eq $.Kind "mrs"}}!{{else}}#{{end}}{{.Number}}</span> · <a href="/{{.Author}}">{{.Author}}</a> · {{when .UpdatedAt}}{{if eq .State "source_gone"}} · <span class="chip chip-source_gone">source gone</span>{{end}}</p>
 9  </div>
10</li>
11{{else}}<li class="empty">{{$.Empty}}</li>{{end}}
12</ul>
13{{end}}
14{{define "queue"}}
15<h2 id="{{$.ID}}">{{$.Title}} <span class="count">{{len $.Items}}</span></h2>
16{{if $.Hint}}<p class="hint">{{$.Hint}}</p>{{end}}
17{{template "itemlist" dict "Items" $.Items "Kind" $.Kind "Empty" $.Empty}}
18{{end}}
19{{define "tile"}}{{if $.N}}<a class="tile wants" href="#{{$.ID}}"><b>{{$.N}}</b><span>{{$.Label}}</span></a>{{else}}<div class="tile"><b>0</b><span>{{$.Label}}</span></div>{{end}}{{end}}
20{{define "content"}}
21<div class="dashgrid">
22
23<aside class="dashpins" aria-label="Pinned repositories">
24  <h2 class="colhead">Pinned</h2>
25  {{if .Pins}}<p class="meta">issues · merge requests · last build</p>
26  <ul class="pins">
27  {{range .Pins}}<li><a href="/{{.Owner}}/{{.Name}}"><span class="owner">{{.Owner}}/</span>{{.Name}}</a><span class="n" title="{{.Issues}} open issue{{if ne .Issues 1}}s{{end}}, {{.MRs}} open merge request{{if ne .MRs 1}}s{{end}}{{with .Build}}, last build {{.}}{{end}}"><b{{if .Issues}} class="wants"{{end}}>{{.Issues}} <span class="vh">open issues</span></b> <b{{if .MRs}} class="wants"{{end}}>{{.MRs}} <span class="vh">open merge requests</span></b> <span class="dot{{if eq .Build "success"}} ok{{else if or (eq .Build "failure") (eq .Build "error")}} bad{{else if or (eq .Build "pending") (eq .Build "running")}} pend{{end}}"><span class="vh">{{with .Build}}last build {{.}}{{else}}no builds{{end}}</span></span></span></li>
28  {{end}}</ul>
29  {{else}}<p class="none">Nothing pinned yet. Press Pin on a repository.</p>{{end}}
30</aside>
31
32<section class="dashmain">
33<h1>Dashboard</h1>
34<div class="tiles">
35  {{template "tile" dict "N" (len .Reviews) "ID" "reviews" "Label" "waiting on your review"}}
36  {{template "tile" dict "N" (len .Assigned) "ID" "assigned" "Label" "assigned to you"}}
37  {{template "tile" dict "N" (len .MRs) "ID" "mrs" "Label" "open merge requests"}}
38  {{template "tile" dict "N" (len .Issues) "ID" "issues" "Label" "open issues"}}
39</div>
40{{if .Reviews}}{{template "queue" dict "ID" "reviews" "Title" "Waiting on your review" "Items" .Reviews "Kind" "mrs" "Empty" "Nothing waiting on you"}}{{end}}
41{{if .Assigned}}{{template "queue" dict "ID" "assigned" "Title" "Assigned to you" "Items" .Assigned "Kind" "issues" "Empty" "Nothing assigned to you"}}{{end}}
42{{if .MRs}}{{template "queue" dict "ID" "mrs" "Title" "Open merge requests" "Items" .MRs "Kind" "mrs" "Empty" "No open merge requests" "Hint" "Your MRs across all repos."}}{{end}}
43{{if .Issues}}{{template "queue" dict "ID" "issues" "Title" "Open issues" "Items" .Issues "Kind" "issues" "Empty" "No open issues" "Hint" "Your issues across all repos."}}{{end}}
44{{if not (or .Reviews .Assigned .MRs .Issues)}}<p class="none">Nothing open.</p>{{end}}
45</section>
46
47<aside class="feedcol" aria-label="Recent activity">
48  <h2 class="colhead">Recent activity</h2>
49  {{range .Feed}}<p class="feedline"><a href="/{{.Actor}}">{{.Actor}}</a> {{.Verb}} <a href="{{.URL}}"{{if .Jobs}} title="{{join .Jobs ", "}}"{{end}}>{{.Ref}}</a><br><span class="none">{{.Repo}} · <span title="{{whenT .WhenT}}">{{ago .WhenT}}</span></span></p>
50  {{else}}<p class="none">No activity yet</p>{{end}}
51</aside>
52
53</div>
54{{end}}