internal/web/templates/dashboard.html

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

37 lines · 2638 bytes

 1{{define "title"}}dashboard · {{.Site}}{{end}}
 2{{define "itemlist"}}
 3<ul class="issuelist">
 4{{range .Items}}<li>
 5  <div class="issuemain">
 6    <p class="title"><a href="/{{.RepoPath}}/{{$.Kind}}/{{.Number}}">{{.Title}}</a></p>
 7    <p class="meta">{{.RepoPath}}{{if eq $.Kind "mrs"}}!{{else}}#{{end}}{{.Number}} · <a href="/{{.Author}}">{{.Author}}</a> · {{when .UpdatedAt}}{{if eq .State "source_gone"}} · <span class="chip chip-source_gone">source gone</span>{{end}}</p>
 8  </div>
 9</li>
10{{else}}<li class="empty">{{$.Empty}}</li>{{end}}
11</ul>
12{{end}}
13{{define "queue"}}
14<h2>{{$.Title}} <span class="count">{{len $.Items}}</span></h2>
15{{if $.Hint}}<p class="hint">{{$.Hint}}</p>{{end}}
16{{template "itemlist" dict "Items" $.Items "Kind" $.Kind "Empty" $.Empty}}
17{{end}}
18{{define "content"}}
19<h1>Dashboard</h1>
20{{with .Rail.Pinned}}<p class="pinned" aria-label="Pinned repositories">{{range .}}<a class="chip" href="/{{.Owner}}/{{.Name}}"><span class="owner">{{.Owner}}/</span>{{.Name}}</a> {{end}}</p>{{end}}
21
22{{if .Reviews}}{{template "queue" dict "Title" "Waiting on your review" "Items" .Reviews "Kind" "mrs" "Empty" "Nothing waiting on you"}}{{end}}
23{{if .Assigned}}{{template "queue" dict "Title" "Assigned to you" "Items" .Assigned "Kind" "issues" "Empty" "Nothing assigned to you"}}{{end}}
24{{if .MRs}}{{template "queue" dict "Title" "Open merge requests" "Items" .MRs "Kind" "mrs" "Empty" "No open merge requests" "Hint" "Yours anywhere, and every one in a repository you can write to."}}{{end}}
25{{if .Issues}}{{template "queue" dict "Title" "Open issues" "Items" .Issues "Kind" "issues" "Empty" "No open issues" "Hint" "Yours anywhere, and every one in a repository you can write to."}}{{end}}
26
27{{if not .Reviews}}<h2 class="empty">Waiting on your review <span class="count">0</span></h2>{{end}}
28{{if not .Assigned}}<h2 class="empty">Assigned to you <span class="count">0</span></h2>{{end}}
29{{if not .MRs}}<h2 class="empty">Open merge requests <span class="count">0</span></h2>{{end}}
30{{if not .Issues}}<h2 class="empty">Open issues <span class="count">0</span></h2>{{end}}
31
32<section class="feed">
33  <h2>Recent activity</h2>
34  {{range .Feed}}<p class="feedline">{{if eq .State "failure"}}<span class="dot bad"></span>{{else if eq .State "success"}}<span class="dot ok"></span>{{else if .State}}<span class="dot pend"></span>{{end}}<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>
35  {{else}}<p class="none">No activity yet</p>{{end}}
36</section>
37{{end}}