BlueGit

timfa bluegit

Files

bluegit / internal / server / templates / branches.html

branches.html

feat: geef de branches- en tagspagina de GitLab-opbouw
timfa project_87923614_bot_3aff574f6f98414b945a8799374f9092 · pushed by timfa · 3 weeks ago
Passed 6e85d750 History
branches.html 7.1 KiB Download Raw
1{{define "branches"}}
2{{template "layout-start" .}}
3<div class="refhead">
4 <nav class="reftabs" aria-label="{{t "branch.actions"}}">
5 <a href="/{{.Repo.FullPath}}/-/branches?state=overview"{{if eq .Branch.State "overview"}} class="on" aria-current="page"{{end}}>{{t "branch.tab.overview"}}</a>
6 <a href="/{{.Repo.FullPath}}/-/branches?state=active"{{if eq .Branch.State "active"}} class="on" aria-current="page"{{end}}>{{t "branch.tab.active"}}</a>
7 <a href="/{{.Repo.FullPath}}/-/branches?state=stale"{{if eq .Branch.State "stale"}} class="on" aria-current="page"{{end}}>{{t "branch.tab.stale"}}</a>
8 <a href="/{{.Repo.FullPath}}/-/branches?state=all"{{if eq .Branch.State "all"}} class="on" aria-current="page"{{end}}>{{t "branch.tab.all"}}</a>
9 </nav>
10 {{if .CanWrite}}<button type="button" data-branch-open="create">{{t "branch.create"}}</button>{{end}}
11</div>
12<label class="refsearch">
13 <input type="search" data-branch-filter autocomplete="off" placeholder="{{t "branch.filter"}}" aria-label="{{t "branch.filter"}}">
14 <svg class="ico" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M11.5 7a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0zm-.9 4.3 3.4 3.4a.75.75 0 1 0 1.1-1.1l-3.4-3.4a6 6 0 1 0-1.1 1.1z"/></svg>
15</label>
16{{if and (not .Branch.Active) (not .Branch.Stale)}}
17<p class="muted">{{t "repo.noBranches"}}</p>
18{{else}}
19 {{if .Branch.ShowActive}}
20 <section class="refgroup" data-ref-group>
21 <h2>{{t "branch.group.active"}}</h2>
22 {{range .Branch.Active}}{{template "branchrow" .}}{{else}}<p class="muted refempty">{{t "branch.none.active"}}</p>{{end}}
23 </section>
24 {{end}}
25 {{if .Branch.ShowStale}}
26 <section class="refgroup" data-ref-group>
27 <h2>{{t "branch.group.stale"}}</h2>
28 {{range .Branch.Stale}}{{template "branchrow" .}}{{else}}<p class="muted refempty">{{t "branch.none.stale"}}</p>{{end}}
29 </section>
30 {{end}}
31{{end}}
32{{if .CanWrite}}
33<dialog class="branch-dialog" data-branch-dialog="create">
34 <form method="post" action="/{{.Repo.FullPath}}/-/branches">
35 <h2>{{t "branch.create"}}</h2>
36 <input type="hidden" name="csrf" value="{{.CSRF}}">
37 <label>{{t "branch.name"}} <input name="name" required autocomplete="off"></label>
38 <label>{{t "branch.from"}}
39 <input name="from" list="branch-revs" value="{{.Repo.DefaultBranch}}" required>
40 </label>
41 <datalist id="branch-revs">
42 {{range .Branches}}<option value="{{.Name}}"></option>{{end}}
43 {{range .Tags}}<option value="{{.Name}}"></option>{{end}}
44 </datalist>
45 <div class="row">
46 <button type="submit">{{t "branch.create"}}</button>
47 <button type="button" class="ghost" data-dialog-close>{{t "action.cancel"}}</button>
48 </div>
49 </form>
50</dialog>
51<dialog class="branch-dialog" data-branch-dialog="delete">
52 <form method="post" action="/{{.Repo.FullPath}}/-/branches/delete">
53 <h2>{{t "branch.delete"}}</h2>
54 <input type="hidden" name="csrf" value="{{.CSRF}}">
55 <input type="hidden" name="name" value="" data-delete-name>
56 <p data-delete-ask data-pattern="{{t "branch.deleteAsk" "%s"}}"></p>
57 <label>{{t "branch.confirm"}} <input name="confirm" required autocomplete="off"></label>
58 <div class="row">
59 <button type="submit">{{t "branch.delete"}}</button>
60 <button type="button" class="ghost" data-dialog-close>{{t "action.cancel"}}</button>
61 </div>
62 </form>
63</dialog>
64<dialog class="branch-dialog" data-branch-dialog="rename">
65 <form method="post" action="/{{.Repo.FullPath}}/-/branches/rename">
66 <h2>{{t "branch.rename"}}</h2>
67 <input type="hidden" name="csrf" value="{{.CSRF}}">
68 <input type="hidden" name="name" value="" data-rename-name>
69 <p data-rename-ask data-pattern="{{t "branch.renameAsk" "%s"}}"></p>
70 <label>{{t "branch.name"}} <input name="new_name" required autocomplete="off"></label>
71 <label>{{t "branch.confirm"}} <input name="confirm" required autocomplete="off"></label>
72 <div class="row">
73 <button type="submit">{{t "branch.rename"}}</button>
74 <button type="button" class="ghost" data-dialog-close>{{t "action.cancel"}}</button>
75 </div>
76 </form>
77</dialog>
78{{end}}
79<script src="/assets/branch.js"></script>
80{{template "layout-end" .}}
81{{end}}
82
83{{define "branchrow"}}
84<article class="refrow" data-branch-row data-name="{{.Name}}">
85 <div class="refmain">
86 <div class="refname">
87 <a href="/{{.RepoPath}}?rev={{urlquery .Name}}"><code>{{.Name}}</code></a>
88 <button type="button" class="iconbtn refcopy" data-copy="{{.Name}}" aria-label="{{t "action.copy"}}"><svg class="ico" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M5.5 1A1.5 1.5 0 0 0 4 2.5V10a1.5 1.5 0 0 0 1.5 1.5h6A1.5 1.5 0 0 0 13 10V2.5A1.5 1.5 0 0 0 11.5 1h-6zM2 5.5A1.5 1.5 0 0 1 3.5 4H4v6.5A2.5 2.5 0 0 0 6.5 13H11v.5A1.5 1.5 0 0 1 9.5 15h-6A1.5 1.5 0 0 1 2 13.5v-8z"/></svg></button>
89 {{if .Default}}<span class="pill refbadge def">{{t "branch.default"}}</span>{{end}}
90 {{if .Protected}}<span class="pill refbadge">{{t "vis.protected"}}</span>{{end}}
91 </div>
92 <p class="refmeta">
93 {{if .SHA}}<a href="/{{.RepoPath}}/-/commit/{{.SHA}}"><code>{{.Short}}</code></a>{{end}}
94 {{if .Subject}}{{if .SHA}}<span class="refdot" aria-hidden="true">·</span>{{end}}<span class="refsubject" title="{{.Subject}}">{{.Subject}}</span>{{end}}
95 {{if .When}}{{if or .SHA .Subject}}<span class="refdot" aria-hidden="true">·</span>{{end}}<span class="muted when-short" title="{{.WhenTitle}}">{{.When}}</span>{{end}}
96 {{if .PipeStatus}}<a class="status {{.PipeStatus}}" href="/{{.RepoPath}}/-/pipelines/{{.PipeID}}"><span class="mark"></span>{{.PipeLabel}}</a>{{end}}
97 </p>
98 </div>
99 <div class="refacts">
100 {{if not .Default}}
101 {{if and (eq .Ahead 0) (eq .Behind 0)}}<span class="muted">{{t "branch.even"}}</span>{{else}}
102 {{if .Ahead}}<span class="addstat">{{t "branch.ahead" .Ahead}}</span>{{end}}
103 {{if .Behind}}<span class="delstat">{{t "branch.behind" .Behind}}</span>{{end}}
104 {{end}}
105 {{range .OpenMRs}}<a class="tiny" href="/{{$.RepoPath}}/-/merge-requests/{{.}}">!{{.}}</a>{{else}}
106 <a class="tiny" href="/{{$.RepoPath}}/-/merge-requests/new?source={{urlquery $.Name}}&amp;target={{urlquery $.Target}}">{{t "branch.makeMR"}}</a>
107 {{end}}
108 {{end}}
109 <details class="rowmenu">
110 <summary class="refdlbtn" aria-label="{{t "branch.download"}}"><svg class="ico" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M7.25 2.25a.75.75 0 0 1 1.5 0v6.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V2.25zM3.75 12.5a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5z"/></svg></summary>
111 <div class="menu-panel refdl">
112 <a href="{{.ZipURL}}">{{t "tag.zip"}}</a>
113 <a href="{{.TarURL}}">{{t "tag.tgz"}}</a>
114 </div>
115 </details>
116 {{if .CanEdit}}
117 <button type="button" class="ghost tiny" data-delete="{{.Name}}">{{t "branch.delete"}}</button>
118 <details class="rowmenu tiny-menu">
119 <summary aria-label="{{t "branch.more"}}">⋯</summary>
120 <div class="menu-panel">
121 <button type="button" class="ghost" data-rename="{{.Name}}">{{t "branch.rename"}}</button>
122 </div>
123 </details>
124 {{end}}
125 </div>
126</article>
127{{end}}