internal/web/templates/dashboard.html

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

44 lines · 2284 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
21<div class="withaside">
22<div class="mainside">
23
24{{if .Reviews}}{{template "queue" dict "Title" "Waiting on your review" "Items" .Reviews "Kind" "mrs" "Empty" "Nothing waiting on you"}}{{end}}
25{{if .Assigned}}{{template "queue" dict "Title" "Assigned to you" "Items" .Assigned "Kind" "issues" "Empty" "Nothing assigned to you"}}{{end}}
26{{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}}
27{{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}}
28
29{{if not .Reviews}}<h2 class="empty">Waiting on your review <span class="count">0</span></h2>{{end}}
30{{if not .Assigned}}<h2 class="empty">Assigned to you <span class="count">0</span></h2>{{end}}
31{{if not .MRs}}<h2 class="empty">Open merge requests <span class="count">0</span></h2>{{end}}
32{{if not .Issues}}<h2 class="empty">Open issues <span class="count">0</span></h2>{{end}}
33
34</div>
35
36<aside class="aside">
37  <div class="grp">
38    <h2>Recent activity</h2>
39    {{range .Feed}}<p class="row feedline"><a href="/{{.Actor}}">{{.Actor}}</a> {{.Verb}} <a href="{{.URL}}">{{.Ref}}</a><br><span class="none">{{.Repo}} · {{when .When}}</span></p>
40    {{else}}<p class="none">No activity yet</p>{{end}}
41  </div>
42</aside>
43</div>
44{{end}}