BlueGit

timfa bluegit

Files

bluegit / internal / server / templates / branches.html

branches.html

fix: toon mergeblokkades en markeer een al gepushte merge
timfa project_87923614_bot_3aff574f6f98414b945a8799374f9092 · pushed by timfa · 3 weeks ago
81edde89 History
branches.html 5.2 KiB Download Raw
1{{define "branches"}}
2{{template "layout-start" .}}
3<header class="pagehead">
4 <h1>{{t "title.branches"}}</h1>
5 {{if .CanWrite}}<button type="button" data-branch-open="create">{{t "branch.create"}}</button>{{end}}
6</header>
7<label class="branchsearch">{{t "branch.search"}}
8 <input type="search" data-branch-filter autocomplete="off" placeholder="{{t "branch.search"}}">
9</label>
10<table class="branchtable">
11 <thead>
12 <tr>
13 <th>{{t "branch.name"}}</th>
14 <th>{{t "branch.last"}}</th>
15 <th>{{t "branch.compare"}}</th>
16 <th>{{t "mr.pipeline"}}</th>
17 <th>{{t "mr.title"}}</th>
18 <th>{{t "branch.actions"}}</th>
19 </tr>
20 </thead>
21 <tbody>
22 {{range .Branches}}
23 <tr data-branch-row data-name="{{.Name}}">
24 <td>
25 <a href="/{{$.Repo.FullPath}}?rev={{urlquery .Name}}">{{.Name}}</a>
26 {{if .Default}}<span class="pill">{{t "branch.default"}}</span>{{end}}
27 {{if .Protected}}<span class="pill">{{t "vis.protected"}}</span>{{end}}
28 </td>
29 <td>
30 {{if .SHA}}<a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}"><code>{{.Short}}</code></a> <span class="subject" title="{{.Subject}}">{{.Subject}}</span> <span class="muted when-short" title="{{.WhenTitle}}">{{.When}}</span>{{end}}
31 </td>
32 <td class="nums">
33 {{if and (eq .Ahead 0) (eq .Behind 0)}}<span class="muted">{{t "branch.even"}}</span>{{else}}
34 {{if .Ahead}}<span class="addstat">{{t "branch.ahead" .Ahead}}</span>{{end}}
35 {{if .Behind}}<span class="delstat">{{t "branch.behind" .Behind}}</span>{{end}}
36 {{end}}
37 </td>
38 <td>
39 {{if .PipeStatus}}<a class="status {{.PipeStatus}}" href="/{{$.Repo.FullPath}}/-/pipelines/{{.PipeID}}"><span class="mark"></span>{{.PipeLabel}}</a>{{end}}
40 </td>
41 <td class="mrlinks">
42 {{range .OpenMRs}}<a href="/{{$.Repo.FullPath}}/-/merge-requests/{{.}}">!{{.}}</a>{{end}}
43 </td>
44 <td class="branchacts">
45 <div class="branchline">
46 {{if not .Default}}
47 <a class="tiny" href="/{{$.Repo.FullPath}}/-/compare?from={{urlquery $.Repo.DefaultBranch}}&amp;to={{urlquery .Name}}">{{t "branch.compare"}}</a>
48 {{if not .OpenMRs}}<a class="tiny" href="/{{$.Repo.FullPath}}/-/merge-requests/new?source={{urlquery .Name}}&amp;target={{urlquery $.Repo.DefaultBranch}}">{{t "branch.mrShort"}}</a>{{end}}
49 {{end}}
50 {{if and $.CanWrite (not .Default) (not .Protected)}}
51 <details class="rowmenu tiny-menu">
52 <summary aria-label="{{t "branch.more"}}">⋯</summary>
53 <div class="menu-panel">
54 <button type="button" class="ghost" data-rename="{{.Name}}">{{t "branch.rename"}}</button>
55 <button type="button" class="ghost" data-delete="{{.Name}}">{{t "branch.delete"}}</button>
56 </div>
57 </details>
58 {{end}}
59 </div>
60 </td>
61 </tr>
62 {{else}}
63 <tr><td colspan="6" class="muted">{{t "repo.noBranches"}}</td></tr>
64 {{end}}
65 </tbody>
66</table>
67{{if .CanWrite}}
68<dialog class="branch-dialog" data-branch-dialog="create">
69 <form method="post" action="/{{.Repo.FullPath}}/-/branches">
70 <h2>{{t "branch.create"}}</h2>
71 <input type="hidden" name="csrf" value="{{.CSRF}}">
72 <label>{{t "branch.name"}} <input name="name" required autocomplete="off"></label>
73 <label>{{t "branch.from"}}
74 <input name="from" list="branch-revs" value="{{.Repo.DefaultBranch}}" required>
75 </label>
76 <datalist id="branch-revs">
77 {{range .Branches}}<option value="{{.Name}}"></option>{{end}}
78 {{range .Tags}}<option value="{{.Name}}"></option>{{end}}
79 </datalist>
80 <div class="row">
81 <button type="submit">{{t "branch.create"}}</button>
82 <button type="button" class="ghost" data-dialog-close>{{t "action.cancel"}}</button>
83 </div>
84 </form>
85</dialog>
86<dialog class="branch-dialog" data-branch-dialog="delete">
87 <form method="post" action="/{{.Repo.FullPath}}/-/branches/delete">
88 <h2>{{t "branch.delete"}}</h2>
89 <input type="hidden" name="csrf" value="{{.CSRF}}">
90 <input type="hidden" name="name" value="" data-delete-name>
91 <p data-delete-ask data-pattern="{{t "branch.deleteAsk" "%s"}}"></p>
92 <label>{{t "branch.confirm"}} <input name="confirm" required autocomplete="off"></label>
93 <div class="row">
94 <button type="submit">{{t "branch.delete"}}</button>
95 <button type="button" class="ghost" data-dialog-close>{{t "action.cancel"}}</button>
96 </div>
97 </form>
98</dialog>
99<dialog class="branch-dialog" data-branch-dialog="rename">
100 <form method="post" action="/{{.Repo.FullPath}}/-/branches/rename">
101 <h2>{{t "branch.rename"}}</h2>
102 <input type="hidden" name="csrf" value="{{.CSRF}}">
103 <input type="hidden" name="name" value="" data-rename-name>
104 <p data-rename-ask data-pattern="{{t "branch.renameAsk" "%s"}}"></p>
105 <label>{{t "branch.name"}} <input name="new_name" required autocomplete="off"></label>
106 <label>{{t "branch.confirm"}} <input name="confirm" required autocomplete="off"></label>
107 <div class="row">
108 <button type="submit">{{t "branch.rename"}}</button>
109 <button type="button" class="ghost" data-dialog-close>{{t "action.cancel"}}</button>
110 </div>
111 </form>
112</dialog>
113<script src="/assets/branch.js"></script>
114{{end}}
115{{template "layout-end" .}}
116{{end}}