| 1 | {{define "setup"}} |
| 2 | {{template "layout-start" .}} |
| 3 | <header class="pagehead"><h1>{{if .StorageUnset}}{{t "setup.choose"}}{{else}}{{t "setup.pathTitle"}}{{end}}</h1></header> |
| 4 | {{if not .StorageUnset}} |
| 5 | <p class="flash bad">{{t "setup.changeWarn"}}</p> |
| 6 | {{end}} |
| 7 | <section class="panel"> |
| 8 | {{if .StorageTotal}} |
| 9 | <div class="diskuse"> |
| 10 | {{if .StorageBlueGit}}<p>{{t "setup.usedDir" .StorageBlueGit}}{{if .StoragePartial}} <span class="muted">{{t "setup.usedDirPartial"}}</span>{{end}}</p>{{else if .StoragePartial}}<p class="muted">{{t "setup.usedDirCounting"}}</p>{{end}} |
| 11 | {{if .HasReserved}}<p>{{t "setup.diskStatReserved" .StorageTotal .StorageUsed .StorageReserved .StorageFree}}</p>{{else}}<p>{{t "setup.diskStat" .StorageTotal .StorageUsed .StorageFree}}</p>{{end}} |
| 12 | <div class="diskbar"> |
| 13 | <svg class="diskbar-svg" viewBox="0 0 100 8" preserveAspectRatio="none" role="img" aria-label="{{t "setup.diskMeter"}}"> |
| 14 | <rect class="track" width="100" height="8"></rect> |
| 15 | <rect class="fill" width="{{.StoragePercent}}" height="8"></rect> |
| 16 | </svg> |
| 17 | <span>{{.StoragePercent}}%</span> |
| 18 | </div> |
| 19 | </div> |
| 20 | {{end}} |
| 21 | <form method="post" action="/setup"> |
| 22 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 23 | <label>{{t "setup.disk"}} |
| 24 | <input name="path" value="{{.StoragePath}}" required placeholder="/absolute/path"> |
| 25 | </label> |
| 26 | <button type="submit">{{t "action.save"}}</button> |
| 27 | </form> |
| 28 | <p class="muted">{{t "setup.rules" .MinFree}}</p> |
| 29 | </section> |
| 30 | {{with .Cache}} |
| 31 | <section class="panel" id="cache"> |
| 32 | <h2>{{t "setup.cacheTitle"}}</h2> |
| 33 | <p class="muted">{{t "setup.cacheLead"}}</p> |
| 34 | {{if .enabled}}<p>{{t "setup.cacheUse" .bytes_h .max_h .entries .hits .misses}}</p>{{else}}<p class="muted">{{t "setup.cacheOff"}}</p>{{end}} |
| 35 | <form method="post" action="/setup/cache"> |
| 36 | <input type="hidden" name="csrf" value="{{$.CSRF}}"> |
| 37 | <label>{{t "setup.cachePath"}} <input name="cache_path" value="{{.path}}" placeholder="/var/cache/bluegit"></label> |
| 38 | <label>{{t "setup.cacheMax"}} <input name="max_mb" type="number" min="0" value="{{.max_mb}}" placeholder="512"></label> |
| 39 | <button type="submit">{{t "action.save"}}</button> |
| 40 | </form> |
| 41 | {{if .enabled}}<form method="post" action="/setup/cache/clear"><input type="hidden" name="csrf" value="{{$.CSRF}}"><button type="submit" class="btn-ghost">{{t "setup.cacheClear"}}</button></form>{{end}} |
| 42 | <h3>{{t "setup.locTitle"}}</h3> |
| 43 | <table class="kv">{{range .locations}}<tr><th>{{index . "what"}}</th><td><code>{{index . "path"}}</code></td><td>{{with index . "disk"}}{{.}}{{else}}?{{end}}</td></tr>{{end}}</table> |
| 44 | </section> |
| 45 | {{end}} |
| 46 | {{if .ShowUpdate}}{{template "updatestatus" .}}{{end}} |
| 47 | {{template "layout-end" .}} |
| 48 | {{end}} |
| 49 | |
| 50 | {{define "home"}} |
| 51 | {{template "layout-start" .}} |
| 52 | <section class="hero"> |
| 53 | <img src="/assets/logo.svg" alt="BlueGit"> |
| 54 | <div> |
| 55 | <h1>BlueGit</h1> |
| 56 | <p>{{t "home.lead"}}</p> |
| 57 | {{if .StorageUnset}}<p class="flash bad">{{t "home.storage"}}</p>{{end}} |
| 58 | <p><a class="btn" href="/login">{{t "nav.signin"}}</a></p> |
| 59 | </div> |
| 60 | </section> |
| 61 | {{if .Repos}} |
| 62 | <section class="panel"> |
| 63 | <h2>{{t "home.public"}}</h2> |
| 64 | <ul class="repolist"> |
| 65 | {{range .Repos}}<li>{{template "namemark" .}}<div class="grown"><a class="reponame" href="/{{.FullPath}}">{{.FullPath}}</a>{{if .Description}} <span class="muted">{{.Description}}</span>{{end}}</div></li>{{end}} |
| 66 | </ul> |
| 67 | </section> |
| 68 | {{end}} |
| 69 | {{template "releaserepos" .}} |
| 70 | {{template "layout-end" .}} |
| 71 | {{end}} |
| 72 | |
| 73 | {{define "releaserepos"}} |
| 74 | {{if .ReleaseRepos}} |
| 75 | <section class="panel"> |
| 76 | <h2>{{t "home.releaseOnly"}}</h2> |
| 77 | <ul class="repolist"> |
| 78 | {{range .ReleaseRepos}}<li>{{template "namemark" .}}<div class="grown"><a class="reponame" href="/{{.FullPath}}/-/releases">{{.FullPath}}</a> <span class="pill">{{t "rel.vis.onlyPill"}}</span>{{if .Description}} <span class="muted">{{.Description}}</span>{{end}}</div></li>{{end}} |
| 79 | </ul> |
| 80 | </section> |
| 81 | {{end}} |
| 82 | {{end}} |
| 83 | |
| 84 | {{define "dashboard"}} |
| 85 | {{template "layout-start" .}} |
| 86 | <header class="pagehead"> |
| 87 | <h1>{{t "nav.dashboard"}}</h1> |
| 88 | <div class="pageacts"><a class="btn" href="/new">{{t "nav.new"}}</a></div> |
| 89 | </header> |
| 90 | {{if .StorageUnset}}<p class="flash bad">{{t "home.storage"}}</p>{{end}} |
| 91 | {{if .Card}}{{template "usercard" .Card}}{{end}} |
| 92 | {{if .Heat}}{{template "heatmap" .Heat}}{{end}} |
| 93 | <div class="grid-2"> |
| 94 | <section class="panel"> |
| 95 | <h2><span data-tip="{{t "repo.sortPushedTip"}}">{{t "dash.repos"}}</span></h2> |
| 96 | {{if not .Repos}}<p class="muted">{{t "dash.noRepos"}}</p>{{end}} |
| 97 | <ul class="repolist"> |
| 98 | {{range .Repos}}<li>{{template "namemark" .}}<div class="grown"><a class="reponame" href="/{{.FullPath}}" title="{{pushedLabel .}}">{{.FullPath}}</a> <span class="pill">{{visName .Visibility}}</span>{{if .Description}}<div class="muted">{{.Description}}</div>{{end}}</div></li>{{end}} |
| 99 | </ul> |
| 100 | {{if .MoreRepos}}<p><a class="btn ghost tiny" href="/?all=repos" data-tip="{{t "dash.moreTip"}}">{{t "dash.showAll" .MoreRepos}}</a></p>{{end}} |
| 101 | </section> |
| 102 | <section class="panel"> |
| 103 | <h2><span data-tip="{{t "dash.groupsTip"}}">{{t "dash.groups"}}</span></h2> |
| 104 | {{if not .Groups}}<p class="muted">{{t "dash.noGroups"}}</p>{{end}} |
| 105 | <ul class="repolist"> |
| 106 | {{range .Groups}}<li>{{template "namemark" .}}<div class="grown"><a class="reponame" href="/groups/{{.Path}}">{{.Name}}</a> <span class="muted">{{.Path}}</span></div></li>{{end}} |
| 107 | </ul> |
| 108 | {{if .MoreGroups}}<p><a class="btn ghost tiny" href="/?all=groups" data-tip="{{t "dash.moreTip"}}">{{t "dash.showAll" .MoreGroups}}</a></p>{{end}} |
| 109 | </section> |
| 110 | </div> |
| 111 | {{template "releaserepos" .}} |
| 112 | {{template "layout-end" .}} |
| 113 | {{end}} |
| 114 | |
| 115 | {{define "profile"}} |
| 116 | {{template "layout-start" .}} |
| 117 | {{if .Card}}{{template "usercard" .Card}}{{end}} |
| 118 | {{if .Heat}}{{template "heatmap" .Heat}}{{end}} |
| 119 | <div class="grid-2"> |
| 120 | <section> |
| 121 | <h2><span data-tip="{{t "repo.sortPushedTip"}}">{{t "dash.repos"}}</span></h2> |
| 122 | <ul class="repolist"> |
| 123 | {{range .Repos}} |
| 124 | <li> |
| 125 | {{template "namemark" .}} |
| 126 | <a class="reponame" href="/{{.FullPath}}" title="{{pushedLabel .}}">{{.Name}}</a> |
| 127 | {{template "visicon" .Visibility}} |
| 128 | <span class="muted grown">{{.Description}}</span> |
| 129 | </li> |
| 130 | {{else}}<li class="muted">{{t "dash.noRepos"}}</li>{{end}} |
| 131 | </ul> |
| 132 | </section> |
| 133 | <section> |
| 134 | <h2>{{t "dash.groups"}}</h2> |
| 135 | <ul class="repolist"> |
| 136 | {{range .Groups}} |
| 137 | <li> |
| 138 | {{template "namemark" .}} |
| 139 | <a class="reponame" href="/groups/{{.Path}}">{{.Name}}</a> |
| 140 | {{template "visicon" .Visibility}} |
| 141 | <span class="muted grown">{{.Path}}</span> |
| 142 | </li> |
| 143 | {{else}}<li class="muted">{{t "dash.noGroups"}}</li>{{end}} |
| 144 | </ul> |
| 145 | </section> |
| 146 | </div> |
| 147 | {{template "layout-end" .}} |
| 148 | {{end}} |
| 149 | |
| 150 | {{define "usercard"}} |
| 151 | <section class="usercard panel"> |
| 152 | {{if .User.AvatarURL}}<img class="avatar xl" src="{{.User.AvatarURL}}" alt="">{{else}}<span class="avatar xl">{{initial .User.Username}}</span>{{end}} |
| 153 | <div> |
| 154 | {{if eq .Heading "h1"}}<h1>{{.Name}}</h1>{{else}}<h2>{{.Name}}</h2>{{end}} |
| 155 | <p class="handle">@{{.User.Username}}</p> |
| 156 | {{if .Bio}}<p class="bio">{{.Bio}}</p>{{end}} |
| 157 | {{if .Since}}<p class="muted">{{t "profile.since" .Since}}</p>{{end}} |
| 158 | <ul class="usercounts"> |
| 159 | <li><strong>{{.Repos}}</strong> <span>{{t "dash.repos"}}</span></li> |
| 160 | <li><strong>{{.Groups}}</strong> <span>{{t "dash.groups"}}</span></li> |
| 161 | <li><strong>{{.Contrib}}</strong> <span>{{t "profile.contrib"}}</span></li> |
| 162 | </ul> |
| 163 | </div> |
| 164 | <div class="usercard-actions"> |
| 165 | <button type="button" class="ghost" data-copy="{{.URL}}">{{t "profile.copy"}}</button> |
| 166 | {{if .Own}}<a class="btn" href="/settings">{{t "profile.edit"}}</a>{{end}} |
| 167 | </div> |
| 168 | </section> |
| 169 | {{end}} |
| 170 | |
| 171 | {{define "heatmap"}} |
| 172 | <section class="heat" aria-label="{{t "heat.title"}}"> |
| 173 | <h2>{{t "heat.title"}}</h2> |
| 174 | <div class="heat-scroll"> |
| 175 | <div class="heat-months"> |
| 176 | {{range .Weeks}}<span>{{.Label}}</span>{{end}} |
| 177 | </div> |
| 178 | <div class="heat-body"> |
| 179 | <div class="heat-dow" aria-hidden="true"><span></span><span>{{t "heat.mon"}}</span><span></span><span>{{t "heat.wed"}}</span><span></span><span>{{t "heat.fri"}}</span><span></span></div> |
| 180 | <div class="heat-cols"> |
| 181 | {{range .Weeks}} |
| 182 | <div class="heat-col"> |
| 183 | {{range .Days}}{{if .Off}}<span class="sq off"></span>{{else}}<span class="sq lv{{.Level}}" title="{{.Tip}}" aria-label="{{.Tip}}" tabindex="0"></span>{{end}}{{end}} |
| 184 | </div> |
| 185 | {{end}} |
| 186 | </div> |
| 187 | </div> |
| 188 | </div> |
| 189 | <div class="heat-foot"> |
| 190 | <p class="heat-total">{{.TotalText}}</p> |
| 191 | <div> |
| 192 | <p class="heat-legend"><span>{{t "heat.less"}}</span><span class="sq lv0"></span><span class="sq lv1"></span><span class="sq lv2"></span><span class="sq lv3"></span><span class="sq lv4"></span><span>{{t "heat.more"}}</span></p> |
| 193 | <p class="muted">{{t "heat.note"}}</p> |
| 194 | </div> |
| 195 | </div> |
| 196 | </section> |
| 197 | {{end}} |
| 198 | |
| 199 | {{define "new"}} |
| 200 | {{template "layout-start" .}} |
| 201 | <header class="pagehead"><h1>{{t "title.new"}}</h1></header> |
| 202 | <div class="chooser" data-chooser> |
| 203 | <button type="button" class="pick" data-open="repo">{{t "new.repo"}}</button> |
| 204 | <button type="button" class="pick" data-open="group">{{t "new.group"}}</button> |
| 205 | </div> |
| 206 | <div class="sheet" data-sheet hidden> |
| 207 | <p><button type="button" class="ghost" data-close>{{t "action.close"}}</button></p> |
| 208 | <form class="panel" method="post" action="/new/repo" data-kind="repo" data-free="{{t "slug.free"}}" data-taken="{{t "slug.taken"}}" data-bad="{{t "slug.bad"}}" hidden> |
| 209 | <h2>{{t "new.repo"}}</h2> |
| 210 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 211 | <label>{{t "new.name"}} <input name="name" required autocomplete="off"></label> |
| 212 | <p class="preview"><span data-slug-text></span> <span data-slug-flag></span></p> |
| 213 | <label>{{t "new.description"}} <input name="description"></label> |
| 214 | <fieldset class="picklist"> |
| 215 | <legend>{{t "new.owner"}}</legend> |
| 216 | <label> |
| 217 | <input type="radio" name="group" value="" checked> |
| 218 | {{if .User.AvatarURL}}<img class="avatar" src="{{.User.AvatarURL}}" alt="">{{else}}<span class="avatar {{tileHue .User.Username}}">{{initial .User.Username}}</span>{{end}} |
| 219 | <span>{{t "new.me"}}</span> |
| 220 | </label> |
| 221 | {{range .Groups}}<label> |
| 222 | <input type="radio" name="group" value="{{.Path}}"> |
| 223 | {{template "namemark" .}} |
| 224 | <span>{{.Name}}</span> |
| 225 | </label>{{end}} |
| 226 | </fieldset> |
| 227 | <label>{{t "new.visibility"}} |
| 228 | <select name="visibility"><option value="private">{{t "vis.private"}}</option><option value="public">{{t "vis.public"}}</option></select> |
| 229 | </label> |
| 230 | <p class="form-err" data-form-err></p> |
| 231 | <button type="submit">{{t "action.save"}}</button> |
| 232 | </form> |
| 233 | <form class="panel" method="post" action="/new/group" data-kind="group" data-free="{{t "slug.free"}}" data-taken="{{t "slug.taken"}}" data-bad="{{t "slug.bad"}}" hidden> |
| 234 | <h2>{{t "new.group"}}</h2> |
| 235 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 236 | <label>{{t "new.name"}} <input name="name" required autocomplete="off"></label> |
| 237 | <p class="preview"><span data-slug-text></span> <span data-slug-flag></span></p> |
| 238 | <label>{{t "new.description"}} <input name="description"></label> |
| 239 | <label>{{t "new.role"}} |
| 240 | <select name="default_role"> |
| 241 | <option value="readonly">{{t "role.readonly"}}</option> |
| 242 | <option value="reporter">{{t "role.reporter"}}</option> |
| 243 | <option value="developer" selected>{{t "role.developer"}}</option> |
| 244 | <option value="maintainer">{{t "role.maintainer"}}</option> |
| 245 | </select> |
| 246 | </label> |
| 247 | <p class="muted">{{t "new.roleHint"}}</p> |
| 248 | <p class="form-err" data-form-err></p> |
| 249 | <button type="submit">{{t "action.save"}}</button> |
| 250 | </form> |
| 251 | </div> |
| 252 | <script src="/assets/slug.js"></script> |
| 253 | <script src="/assets/new.js"></script> |
| 254 | {{template "layout-end" .}} |
| 255 | {{end}} |
| 256 | |
| 257 | {{define "account"}} |
| 258 | {{template "layout-start" .}} |
| 259 | <header class="pagehead"><h1>{{t "title.account"}}</h1></header> |
| 260 | <p class="muted">{{t "acct.hint"}}</p> |
| 261 | <section class="panel"> |
| 262 | <h2>{{t "profile.edit"}}</h2> |
| 263 | <form method="post" action="/settings/profile"> |
| 264 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 265 | <label>{{t "acct.name"}} <input name="name" value="{{.User.DisplayName}}" maxlength="80"></label> |
| 266 | <label>{{t "acct.bio"}} <textarea name="bio" maxlength="280" rows="3">{{.User.Bio}}</textarea></label> |
| 267 | <p class="muted">{{t "acct.bioHint"}}</p> |
| 268 | <button type="submit">{{t "action.save"}}</button> |
| 269 | </form> |
| 270 | </section> |
| 271 | <section class="panel"> |
| 272 | <h2>{{t "acct.language"}}</h2> |
| 273 | <form method="post" action="/settings/language"> |
| 274 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 275 | <div class="formline"> |
| 276 | <select name="language"> |
| 277 | {{range .Langs}}<option value="{{.Code}}" {{if eq .Code $.Lang}}selected{{end}}>{{.Label}}</option>{{end}} |
| 278 | </select> |
| 279 | <button type="submit">{{t "action.save"}}</button> |
| 280 | </div> |
| 281 | </form> |
| 282 | </section> |
| 283 | {{if .NewToken}}<p class="code">{{.NewToken}}</p>{{end}} |
| 284 | <section class="panel"> |
| 285 | <h2>{{t "acct.tokens"}}</h2> |
| 286 | <form method="post" action="/settings/tokens"> |
| 287 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 288 | <div class="formline"><input name="name" placeholder="{{t "acct.tokenName"}}" aria-label="{{t "acct.tokenName"}}" required><button type="submit">{{t "acct.newToken"}}</button></div> |
| 289 | </form> |
| 290 | {{if .Tokens}} |
| 291 | <div class="hscroll"> |
| 292 | <table class="acct"> |
| 293 | <thead><tr> |
| 294 | <th>{{t "acct.col.name"}}</th> |
| 295 | <th>{{t "acct.col.prefix"}}</th> |
| 296 | <th>{{t "acct.col.created"}}</th> |
| 297 | <th>{{t "acct.col.used"}}</th> |
| 298 | {{if .ShowExpiry}}<th>{{t "acct.col.expires"}}</th>{{end}} |
| 299 | <th></th> |
| 300 | </tr></thead> |
| 301 | <tbody> |
| 302 | {{range .Tokens}}<tr> |
| 303 | <td>{{.Name}}</td> |
| 304 | <td><code>{{.Prefix}}</code></td> |
| 305 | <td>{{date .CreatedAt}}</td> |
| 306 | <td>{{with date .LastUsedAt}}{{.}}{{else}}{{t "acct.never"}}{{end}}</td> |
| 307 | {{if $.ShowExpiry}}<td>{{date .ExpiresAt}}</td>{{end}} |
| 308 | <td class="act"> |
| 309 | <form method="post" action="/settings/tokens/delete" data-confirm="{{t "acct.revokeAsk"}}"> |
| 310 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 311 | <button class="danger" type="submit">{{t "acct.revoke"}}</button> |
| 312 | </form> |
| 313 | </td> |
| 314 | </tr>{{end}} |
| 315 | </tbody> |
| 316 | </table> |
| 317 | </div> |
| 318 | {{end}} |
| 319 | </section> |
| 320 | <section class="panel" id="runners"> |
| 321 | <h2>{{t "runner.title"}}</h2> |
| 322 | <p class="muted">{{t "runner.userLead"}} <a class="helplink" href="/help/runners">{{t "help.runnerDocs"}}</a></p> |
| 323 | <form method="post" action="/settings/runners/pref"> |
| 324 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 325 | <label class="tiphost"><input type="radio" name="pref" value="builtin_first" {{if ne .RunnerPref "own_first"}}checked{{end}}> {{t "runner.prefBuiltin"}} {{tip "runner.tip.prefBuiltin"}}</label> |
| 326 | <label class="tiphost"><input type="radio" name="pref" value="own_first" {{if eq .RunnerPref "own_first"}}checked{{end}}> {{t "runner.prefOwn"}} {{tip "runner.tip.prefOwn"}}</label> |
| 327 | <button type="submit">{{t "action.save"}}</button> |
| 328 | </form> |
| 329 | {{template "runnerlist" (dict "Runners" .RunnerList "CSRF" .CSRF "Delete" "/settings/runners/delete" "Token" .NewRunnerToken "New" "/settings/runners/token" "Base" .BaseURL)}} |
| 330 | </section> |
| 331 | <section class="panel"> |
| 332 | <h2>{{t "acct.ssh"}}</h2> |
| 333 | <form method="post" action="/settings/ssh"> |
| 334 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 335 | <label>{{t "acct.keyName"}} <input name="name" placeholder="laptop"></label> |
| 336 | <label>{{t "acct.pubkey"}} <textarea name="key" placeholder="ssh-ed25519 AAAA... " required></textarea></label> |
| 337 | <button type="submit">{{t "acct.add"}}</button> |
| 338 | </form> |
| 339 | {{if .Keys}} |
| 340 | <div class="hscroll"> |
| 341 | <table class="acct"> |
| 342 | <thead><tr> |
| 343 | <th>{{t "acct.col.name"}}</th> |
| 344 | <th>{{t "acct.col.fingerprint"}}</th> |
| 345 | <th>{{t "acct.col.created"}}</th> |
| 346 | <th></th> |
| 347 | </tr></thead> |
| 348 | <tbody> |
| 349 | {{range .Keys}}<tr> |
| 350 | <td>{{.Name}}</td> |
| 351 | <td><code>{{.Fingerprint}}</code></td> |
| 352 | <td>{{date .CreatedAt}}</td> |
| 353 | <td class="act"> |
| 354 | <form method="post" action="/settings/ssh/delete" data-confirm="{{t "acct.removeAsk"}}"> |
| 355 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 356 | <button class="danger" type="submit">{{t "acct.remove"}}</button> |
| 357 | </form> |
| 358 | </td> |
| 359 | </tr>{{end}} |
| 360 | </tbody> |
| 361 | </table> |
| 362 | </div> |
| 363 | {{end}} |
| 364 | </section> |
| 365 | <p><a href="/settings/export">{{t "acct.export"}}</a></p> |
| 366 | {{template "layout-end" .}} |
| 367 | {{end}} |
| 368 | |
| 369 | {{define "ficon"}} |
| 370 | {{if eq . "dir"}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#8aa0b8" d="M1.5 3.5A1.5 1.5 0 0 1 3 2h3l1.2 1.5H13A1.5 1.5 0 0 1 14.5 5v7.2a1.3 1.3 0 0 1-1.3 1.3H2.8A1.3 1.3 0 0 1 1.5 12.2z"/></svg> |
| 371 | {{else if eq . "md"}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#1f6feb" d="M2 3h12v10H2z"/><path fill="#fff" d="M4 10V6h1.2l1.3 2 1.3-2H9v4H7.8V8L6.5 10 5.2 8v2zm6.2 0V8.2H9l1.8-2.2h1.4L10.6 8.2H12V10z"/></svg> |
| 372 | {{else if eq . "code"}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#cf222e" d="M6.2 4.2 2.4 8l3.8 3.8-1.1 1.1L.2 8l4.9-4.9zm3.6 0 1.1-1.1L15.8 8l-4.9 4.9-1.1-1.1L13.6 8z"/></svg> |
| 373 | {{else if eq . "cfg"}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#9a6700" d="M8 1.5 14 5v6l-6 3.5L2 11V5z"/></svg> |
| 374 | {{else if eq . "lic"}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#8250df" d="M4 1.5h8v13l-4-2.2-4 2.2z"/></svg> |
| 375 | {{else if eq . "img"}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#1a7f37" d="M2 3h12v10H2z"/><circle cx="6" cy="6.5" r="1.2" fill="#fff"/><path fill="#fff" d="m3.5 11 3-3 2 2 1.5-1.5 2.5 2.5z"/></svg> |
| 376 | {{else}}<svg class="ficon" viewBox="0 0 16 16" aria-hidden="true"><path fill="#6e7781" d="M4 1.5h5l3 3V14H4z"/><path fill="#fff" d="M9 1.5v3h3"/></svg> |
| 377 | {{end}} |
| 378 | {{end}} |
| 379 | |
| 380 | {{define "visicon"}} |
| 381 | {{if eq . "public"}}<svg class="vis" viewBox="0 0 16 16" aria-label="{{t "vis.public"}}"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.4"/><path fill="none" stroke="currentColor" stroke-width="1.2" d="M2 8h12M8 2c1.8 1.8 1.8 10.2 0 12M8 2c-1.8 1.8-1.8 10.2 0 12"/></svg> |
| 382 | {{else}}<svg class="vis" viewBox="0 0 16 16" aria-label="{{t "vis.private"}}"><rect x="3.5" y="7" width="9" height="6.5" rx="1" fill="none" stroke="currentColor" stroke-width="1.4"/><path fill="none" stroke="currentColor" stroke-width="1.4" d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"/></svg> |
| 383 | {{end}} |
| 384 | {{end}} |
| 385 | |
| 386 | {{define "branchpick"}} |
| 387 | <label class="branch"> |
| 388 | <select data-rev> |
| 389 | {{range .Branches}}<option value="{{.Name}}" {{if eq .Name $.Rev}}selected{{end}}>{{.Name}}</option>{{end}} |
| 390 | </select> |
| 391 | </label> |
| 392 | {{if .RevProtected}}<svg class="vis" viewBox="0 0 16 16" aria-label="{{t "vis.protected"}}"><rect x="3.5" y="7" width="9" height="6.5" rx="1" fill="none" stroke="currentColor" stroke-width="1.4"/><path fill="none" stroke="currentColor" stroke-width="1.4" d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"/></svg>{{end}} |
| 393 | {{end}} |
| 394 | |
| 395 | {{define "avatar"}} |
| 396 | {{if .UserURL}}<a class="avatarlink" href="{{.UserURL}}">{{end}} |
| 397 | {{if .Avatar}}<img class="avatar" src="{{.Avatar}}" alt="">{{else}}<span class="avatar">{{if .Initial}}{{.Initial}}{{else}}{{initial .Author}}{{end}}</span>{{end}} |
| 398 | {{if .UserURL}}</a>{{end}} |
| 399 | {{end}} |
| 400 | |
| 401 | {{define "commitwho"}}<span class="commitwho">{{if .UserURL}}<a href="{{.UserURL}}">{{.Author}}</a>{{else}}{{.Author}}{{end}}{{if .RawName}} {{.RawName}}{{end}}{{if .PushedBy}} · <a href="/users/{{.PushedBy}}">{{t "commit.pushedBy" .PushedBy}}</a>{{end}}</span>{{end}} |
| 402 | |
| 403 | {{define "commitbar"}} |
| 404 | {{if .Head}} |
| 405 | <div class="commitbar"> |
| 406 | {{template "avatar" .Head}} |
| 407 | <div class="grow"> |
| 408 | <a class="subject" href="/{{.Repo.FullPath}}/-/commit/{{.Head.SHA}}">{{.Head.Subject}}</a> |
| 409 | <div class="muted">{{template "commitwho" .Head}} · {{.Head.When}}</div> |
| 410 | </div> |
| 411 | {{if and .Head.PipeStatus (eq .Page "overview")}} |
| 412 | <span class="headpipe" data-head-pipe data-pipe="{{.Head.PipeID}}"{{if .Head.PipeLive}} data-live="/{{.Repo.FullPath}}/-/pipelines/{{.Head.PipeID}}" data-live-on="1"{{end}}> |
| 413 | <a class="status {{.Head.PipeStatus}}" data-pipe-status href="/{{.Repo.FullPath}}/-/pipelines/{{.Head.PipeID}}"><span class="mark"></span><span data-pipe-label>{{.Head.PipeLabel}}</span></a> |
| 414 | <span class="muted" data-pipe-duration>{{.Head.PipeDuration}}</span> |
| 415 | {{template "stage-dots" .}} |
| 416 | </span> |
| 417 | {{template "pipe-retry" (dict "Can" .CanWrite "CSRF" .CSRF "Path" .Repo.FullPath "ID" .Head.PipeID "Failed" .Head.PipeFailed "Back" (printf "/%s" .Repo.FullPath))}} |
| 418 | {{else if .Head.PipeStatus}}<a class="status {{.Head.PipeStatus}}" href="/{{.Repo.FullPath}}/-/pipelines/{{.Head.PipeID}}"><span class="mark"></span>{{.Head.PipeLabel}}</a>{{end}} |
| 419 | <code class="sha">{{slice .Head.SHA 0 8}}</code> |
| 420 | <button type="button" class="iconbtn" data-copy="{{.Head.SHA}}" aria-label="{{t "action.copy"}}">{{t "action.copy"}}</button> |
| 421 | <a class="btn ghost" href="/{{.Repo.FullPath}}/-/commits?rev={{.Rev}}">{{t "repo.history"}}</a> |
| 422 | </div> |
| 423 | {{end}} |
| 424 | {{end}} |
| 425 | |
| 426 | {{define "stage-dots"}} |
| 427 | {{with .Head}} |
| 428 | <div class="stages"> |
| 429 | {{range .PipeStages}} |
| 430 | <span class="stage"> |
| 431 | <button type="button" class="stage-dot {{.Status}}" data-stage="{{.Name}}" data-tip="{{.Tip}}" aria-label="{{.Tip}}"><span class="mark"></span></button> |
| 432 | <div class="stage-pop" popover="manual"> |
| 433 | <strong>{{t "pipe.stage"}}: {{.Name}}</strong> |
| 434 | <ul> |
| 435 | {{range .Jobs}}<li data-job="{{.ID}}"><a href="/{{$.Repo.FullPath}}/-/pipelines/{{$.Head.PipeID}}/jobs/{{.ID}}"><span class="stage-dot sm {{.Status}}"><span class="mark"></span></span>{{.Name}}{{if .Queue}} <span class="queue" data-queue>{{.Queue}}</span>{{end}}</a></li>{{end}} |
| 436 | </ul> |
| 437 | </div> |
| 438 | </span> |
| 439 | {{end}} |
| 440 | </div> |
| 441 | {{end}} |
| 442 | {{end}} |
| 443 | |
| 444 | {{define "codemenu"}} |
| 445 | <details class="menu" data-clone> |
| 446 | <summary class="btn">{{t "repo.code"}}</summary> |
| 447 | <div class="menu-panel" popover="manual"> |
| 448 | {{if .CloneSSH}} |
| 449 | <p class="muted">{{t "repo.ssh"}}</p> |
| 450 | <div class="copyline"><input readonly value="{{.CloneSSH}}" aria-label="{{t "repo.ssh"}}"><button type="button" data-copy="{{.CloneSSH}}">{{t "action.copy"}}</button></div> |
| 451 | {{end}} |
| 452 | <p class="muted">{{t "repo.https"}}</p> |
| 453 | <div class="copyline"><input readonly value="{{.CloneHTTP}}" aria-label="{{t "repo.https"}}"><button type="button" data-copy="{{.CloneHTTP}}">{{t "action.copy"}}</button></div> |
| 454 | <p class="muted">{{t "repo.cloneHint"}}</p> |
| 455 | </div> |
| 456 | </details> |
| 457 | {{end}} |
| 458 | |
| 459 | {{define "filetable"}} |
| 460 | {{if .Files}} |
| 461 | <div class="hscroll"> |
| 462 | <table class="files"> |
| 463 | <thead><tr><th>{{t "repo.name"}}</th><th>{{t "repo.lastCommit"}}</th><th>{{t "repo.lastChange"}}</th></tr></thead> |
| 464 | <tbody> |
| 465 | {{range .Files}} |
| 466 | <tr> |
| 467 | <td>{{template "ficon" .Icon}} {{if .Dir}}<a href="/{{$.Repo.FullPath}}/-/tree/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{else}}<a href="/{{$.Repo.FullPath}}/-/blob/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{end}}</td> |
| 468 | <td class="msg">{{if .SHA}}<a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a>{{end}}</td> |
| 469 | <td class="muted">{{.When}}</td> |
| 470 | </tr> |
| 471 | {{end}} |
| 472 | </tbody> |
| 473 | </table> |
| 474 | </div> |
| 475 | {{else if eq .Page "files"}}<p class="muted">{{t "repo.emptyDir"}}</p>{{else if not .Head}}<p class="panel">{{t "repo.noCommits"}}</p>{{end}} |
| 476 | {{end}} |
| 477 | |
| 478 | {{define "repo"}} |
| 479 | {{template "layout-start" .}} |
| 480 | <header class="pagehead"> |
| 481 | <h1>{{t "tab.overview"}}</h1> |
| 482 | <div class="pageacts"> |
| 483 | <a class="btn ghost" href="/{{.Repo.FullPath}}/-/tree?rev={{.Rev}}&focus=1">{{t "repo.searchFile"}}</a> |
| 484 | </div> |
| 485 | </header> |
| 486 | {{if .Heat}}{{template "heatmap" .Heat}}{{end}} |
| 487 | <div class="proj"> |
| 488 | <div> |
| 489 | <div class="toolbar"> |
| 490 | <div class="left">{{template "branchpick" .}} <span class="pathnow">{{.Repo.Name}}</span></div> |
| 491 | <div class="right">{{template "codemenu" .}}</div> |
| 492 | </div> |
| 493 | {{template "commitbar" .}} |
| 494 | {{template "filetable" .}} |
| 495 | {{if .ReadmeName}} |
| 496 | <article class="readme"> |
| 497 | <header>{{template "ficon" "md"}} {{.ReadmeName}}</header> |
| 498 | <div class="mdbody">{{.Readme}}</div> |
| 499 | </article> |
| 500 | {{end}} |
| 501 | </div> |
| 502 | <aside class="side"> |
| 503 | <h2>{{t "repo.project"}}</h2> |
| 504 | {{if .Repo.Description}}<p>{{.Repo.Description}}</p>{{end}} |
| 505 | <ul class="counts"> |
| 506 | <li><a href="/{{.Repo.FullPath}}/-/commits?rev={{.Rev}}">{{tn .NCommits "count.commit.one" "count.commit.many"}}</a></li> |
| 507 | <li><a href="/{{.Repo.FullPath}}/-/branches">{{tn .NBranches "count.branch.one" "count.branch.many"}}</a></li> |
| 508 | <li><a href="/{{.Repo.FullPath}}/-/tags">{{tn .NTags "count.tag.one" "count.tag.many"}}</a></li> |
| 509 | <li><a href="/{{.Repo.FullPath}}/-/releases">{{tn .NReleases "count.release.one" "count.release.many"}}</a></li> |
| 510 | </ul> |
| 511 | {{if .ReadmeName}}<p><a href="/{{.Repo.FullPath}}/-/blob/{{.ReadmeName}}?rev={{.Rev}}">README</a></p>{{end}} |
| 512 | {{if .LicensePath}}<p><a href="/{{.Repo.FullPath}}/-/blob/{{.LicensePath}}?rev={{.Rev}}">LICENSE</a></p>{{end}} |
| 513 | {{if .Created}}<p class="muted">{{t "repo.created" .Created}}</p>{{end}} |
| 514 | </aside> |
| 515 | </div> |
| 516 | <script src="/assets/repo.js"></script> |
| 517 | {{if and .Head .Head.PipeLive}}<script src="/assets/pipeline.js"></script>{{end}} |
| 518 | {{template "layout-end" .}} |
| 519 | {{end}} |
| 520 | |
| 521 | {{define "files"}} |
| 522 | {{template "layout-start" .}} |
| 523 | <header class="pagehead"><h1>{{t "tab.files"}}</h1></header> |
| 524 | <div class="fileview"> |
| 525 | <aside class="treebox"> |
| 526 | <h2>{{t "repo.files"}}</h2> |
| 527 | <input type="search" placeholder="{{t "group.search"}}" aria-label="{{t "group.search"}}" data-tree-filter> |
| 528 | <ul class="treelist" data-repo="{{.Repo.FullPath}}"> |
| 529 | {{range .Tree}} |
| 530 | <li class="depth-{{.Depth}}{{if .Dir}} dir{{end}}{{if .Open}} open{{end}}{{if .Active}} active{{end}}" data-path="{{.Path}}"{{if .Dir}} data-dir="1"{{end}}> |
| 531 | {{if .Dir}}<button type="button" class="twist" aria-expanded="{{if .Open}}true{{else}}false{{end}}" aria-label="{{t "repo.fold"}}"><svg class="chevron" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 11 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></button>{{else}}<span class="twistpad" aria-hidden="true"></span>{{end}} |
| 532 | {{template "ficon" .Icon}} |
| 533 | {{if .Dir}}<a href="/{{$.Repo.FullPath}}/-/tree/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{else}}<a href="/{{$.Repo.FullPath}}/-/blob/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{end}} |
| 534 | </li> |
| 535 | {{end}} |
| 536 | </ul> |
| 537 | </aside> |
| 538 | <div class="filecol"> |
| 539 | <div class="toolbar"> |
| 540 | <div class="left"> |
| 541 | {{template "branchpick" .}} |
| 542 | <span class="pathnow"> |
| 543 | <a href="/{{.Repo.FullPath}}/-/tree?rev={{.Rev}}">{{.Repo.Name}}</a> |
| 544 | {{if .BlobPath}}{{range splitPath .BlobPath}} / <span>{{.}}</span>{{end}}{{else if .TreePath}}{{range splitPath .TreePath}} / <span>{{.}}</span>{{end}}{{end}} |
| 545 | </span> |
| 546 | {{if or .BlobPath .TreePath}}<button type="button" class="iconbtn" data-copy="{{if .BlobPath}}{{.BlobPath}}{{else}}{{.TreePath}}{{end}}" aria-label="{{t "action.copy"}}">{{t "action.copy"}}</button>{{end}} |
| 547 | </div> |
| 548 | <div class="right">{{template "codemenu" .}}</div> |
| 549 | </div> |
| 550 | <div class="filepane"> |
| 551 | {{if .BlobPath}} |
| 552 | <h2 class="filename">{{template "ficon" (iconOf .FileName)}} {{.FileName}}</h2> |
| 553 | {{template "commitbar" .}} |
| 554 | <article class="codebox"> |
| 555 | {{$raw := printf "/%s/-/raw/%s?rev=%s" .Repo.FullPath .BlobPath .Rev}} |
| 556 | <header class="codehead"><span class="codename">{{template "ficon" (iconOf .FileName)}} {{.FileName}} <span class="muted">{{.BlobSize}}</span></span> |
| 557 | <span class="fileacts"> |
| 558 | <a class="btn ghost small" href="{{$raw}}&download=1" download="{{.FileName}}" title="{{t "file.tip.download" .FileName}}">{{t "file.download"}}</a> |
| 559 | <a class="btn ghost small" href="{{$raw}}" target="_blank" rel="noopener" title="{{t "file.tip.raw"}}">{{t "file.raw"}}</a> |
| 560 | <button type="button" class="ghost small" data-copy-file="{{$raw}}"{{if .Binary}} disabled aria-disabled="true" title="{{t "file.tip.copyBinary"}}"{{else}} title="{{t "file.tip.copy"}}"{{end}} data-copy-ok="{{t "file.copied"}}" data-copy-fail="{{t "file.copyFail"}}" data-copy-title="{{t "file.copyFailTitle"}}" data-copy-close="{{t "action.close"}}">{{t "file.copy"}}</button> |
| 561 | </span> |
| 562 | </header> |
| 563 | {{if .IsSVG}}<figure class="svgpreview" aria-label="{{t "file.svgPreview"}}"><img src="{{$raw}}&as=img" alt="{{.FileName}}" data-svg-preview><figcaption class="muted" hidden data-svg-empty>{{t "file.svgEmpty"}}</figcaption></figure>{{end}} |
| 564 | {{if .IsImage}}<figure class="imgpreview"><img src="{{$raw}}" alt="{{.FileName}}" data-img-preview></figure>{{else if .Binary}}<p>{{t "repo.binary"}}</p>{{else}} |
| 565 | <table class="code"> |
| 566 | {{range .Lines}}<tr><td class="ln">{{.N}}</td><td class="src">{{.HTML}}</td></tr>{{end}} |
| 567 | </table> |
| 568 | {{end}} |
| 569 | </article> |
| 570 | {{else}} |
| 571 | {{template "filetable" .}} |
| 572 | {{end}} |
| 573 | </div> |
| 574 | </div> |
| 575 | </div> |
| 576 | <script src="/assets/repo.js"></script> |
| 577 | {{template "layout-end" .}} |
| 578 | {{end}} |
| 579 | |
| 580 | {{define "tags"}} |
| 581 | {{template "layout-start" .}} |
| 582 | <div class="refhead"> |
| 583 | <h1>{{t "title.tags"}}</h1> |
| 584 | {{if .CanWrite}}<button type="button" data-tag-create>{{t "tag.create"}}</button>{{end}} |
| 585 | </div> |
| 586 | <form class="refsearch" method="get" action="/{{.Repo.FullPath}}/-/tags"> |
| 587 | <input type="search" name="q" value="{{.Query}}" placeholder="{{t "tag.search"}}" aria-label="{{t "tag.search"}}"> |
| 588 | <button class="refgo" type="submit" aria-label="{{t "tag.search"}}"><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></button> |
| 589 | </form> |
| 590 | {{if .Tags}} |
| 591 | <section class="refgroup"> |
| 592 | {{range .Tags}} |
| 593 | <article class="refrow"> |
| 594 | <div class="refmain"> |
| 595 | <div class="refname"> |
| 596 | <code>{{.Name}}</code> |
| 597 | <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> |
| 598 | {{if .Protected}}<span class="pill refbadge">{{t "vis.protected"}}</span>{{end}} |
| 599 | </div> |
| 600 | <p class="refmeta"> |
| 601 | {{if .SHA}}<a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}"><code>{{.Short}}</code></a>{{end}} |
| 602 | {{if .Subject}}{{if .SHA}}<span class="refdot" aria-hidden="true">·</span>{{end}}<span class="refsubject" title="{{.Subject}}">{{.Subject}}</span>{{end}} |
| 603 | {{if .When}}{{if or .SHA .Subject}}<span class="refdot" aria-hidden="true">·</span>{{end}}<span class="muted when-short" title="{{.Date}}">{{.When}}</span>{{end}} |
| 604 | </p> |
| 605 | {{if .Annotated}}<p class="refnote"><span class="pill">{{t "tag.annotated"}}</span> {{.Message}}</p>{{else}}<p class="muted refnote">{{t "tag.lightweight"}}</p>{{end}} |
| 606 | {{if .HasRelease}}<p class="refnote"><a href="/{{$.Repo.FullPath}}/-/releases#{{.Name}}">{{t "tag.release"}}</a></p>{{end}} |
| 607 | </div> |
| 608 | <div class="refacts"> |
| 609 | <details class="rowmenu"> |
| 610 | <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> |
| 611 | <div class="menu-panel refdl"> |
| 612 | <a href="{{.ZipURL}}">{{t "tag.zip"}}</a> |
| 613 | <a href="{{.TarURL}}">{{t "tag.tgz"}}</a> |
| 614 | </div> |
| 615 | </details> |
| 616 | {{if .CanDelete}}<button type="button" class="ghost tiny" data-tag-open data-tag="{{.Name}}">{{t "tag.delete"}}</button>{{end}} |
| 617 | </div> |
| 618 | </article> |
| 619 | {{end}} |
| 620 | </section> |
| 621 | {{else if .Query}}<p class="muted">{{t "tag.noMatch"}}</p>{{else}}<p class="muted">{{t "repo.noTags"}}</p>{{end}} |
| 622 | {{if .CanWrite}} |
| 623 | <dialog class="branch-dialog" data-tag-form> |
| 624 | <form method="post" action="/{{.Repo.FullPath}}/-/tags"> |
| 625 | <h2>{{t "tag.create"}}</h2> |
| 626 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 627 | <label>{{t "tag.name"}} <input name="name" required autocomplete="off"></label> |
| 628 | <label>{{t "tag.target"}} <input name="target" list="tag-targets" value="{{.Rev}}" required></label> |
| 629 | <datalist id="tag-targets">{{range .Branches}}<option value="{{.Name}}"></option>{{end}}</datalist> |
| 630 | <label>{{t "tag.message"}} <input name="message" autocomplete="off"></label> |
| 631 | <div class="row"> |
| 632 | <button type="submit">{{t "tag.create"}}</button> |
| 633 | <button type="button" class="ghost" data-tag-form-close>{{t "action.cancel"}}</button> |
| 634 | </div> |
| 635 | </form> |
| 636 | </dialog> |
| 637 | <dialog class="danger-modal" data-tag-dialog> |
| 638 | <form method="post" action="/{{.Repo.FullPath}}/-/tags/delete"> |
| 639 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 640 | <input type="hidden" name="name" value="" data-tag-name> |
| 641 | <p data-tag-copy data-pattern="{{t "tag.confirm" "%s"}}"></p> |
| 642 | <div class="row"> |
| 643 | <button type="submit" data-tag-submit>{{t "tag.delete"}}</button> |
| 644 | <button type="button" class="ghost" data-tag-cancel>{{t "action.close"}}</button> |
| 645 | </div> |
| 646 | </form> |
| 647 | </dialog> |
| 648 | <script src="/assets/tags.js"></script> |
| 649 | {{end}} |
| 650 | {{template "layout-end" .}} |
| 651 | {{end}} |
| 652 | |
| 653 | {{define "commits"}} |
| 654 | {{template "layout-start" .}} |
| 655 | <form class="clog" method="get" action="/{{.Repo.FullPath}}/-/commits"> |
| 656 | <div class="clogref"> |
| 657 | <label class="clogpick"> |
| 658 | <svg class="ico" viewBox="0 0 16 16" aria-hidden="true"><circle cx="4" cy="3.2" r="1.5" fill="currentColor"/><circle cx="4" cy="12.8" r="1.5" fill="currentColor"/><circle cx="12" cy="6.4" r="1.5" fill="currentColor"/><path d="M4 4.7v6.6M4 6.4c2.4 0 4.2.2 6 .2 1.2 0 2 1 2 1.8" fill="none" stroke="currentColor" stroke-width="1.3"/></svg> |
| 659 | <select name="rev" data-rev aria-label="{{t "tab.branches"}}"> |
| 660 | {{range .Branches}}<option value="{{.Name}}"{{if eq .Name $.Rev}} selected{{end}}>{{.Name}}</option>{{end}} |
| 661 | </select> |
| 662 | </label> |
| 663 | <a class="clogrepo" href="/{{.Repo.FullPath}}{{if .Rev}}?rev={{urlquery .Rev}}{{end}}">{{.Repo.Name}}</a> |
| 664 | </div> |
| 665 | <h1>{{t "title.commits"}}</h1> |
| 666 | <label class="clogsearch"> |
| 667 | <input type="search" name="q" value="{{.Query}}" placeholder="{{t "commit.search"}}" aria-label="{{t "commit.search"}}" autocomplete="off"> |
| 668 | <button type="submit" aria-label="{{t "commit.search"}}"><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></button> |
| 669 | </label> |
| 670 | </form> |
| 671 | {{if .CommitDays}} |
| 672 | {{range .CommitDays}} |
| 673 | <section class="cday"> |
| 674 | <h2>{{.Label}}</h2> |
| 675 | {{range .Items}} |
| 676 | <article class="ccard" data-commit> |
| 677 | {{if .WhoURL}}<a class="avatarlink" href="{{.WhoURL}}">{{end}} |
| 678 | {{if .Ident}}{{.Ident}}{{else if .Avatar}}<img class="avatar" src="{{.Avatar}}" alt="">{{else}}<span class="avatar">{{if .Initial}}{{.Initial}}{{else}}{{initial .Author}}{{end}}</span>{{end}} |
| 679 | {{if .WhoURL}}</a>{{end}} |
| 680 | <div class="cmain"> |
| 681 | <a class="csubject" href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a> |
| 682 | <p class="cby">{{if .WhoURL}}<a href="{{.WhoURL}}">{{.Who}}</a>{{else}}{{.Who}}{{end}} {{t "commit.authoredWhen" .When}}</p> |
| 683 | </div> |
| 684 | <div class="cacts"> |
| 685 | {{if .PipeStatus}}<a class="status {{.PipeStatus}} markonly" href="/{{$.Repo.FullPath}}/-/pipelines/{{.PipeID}}" aria-label="{{.PipeLabel}}"><span class="mark"></span></a>{{end}} |
| 686 | <code>{{if gt (len .SHA) 8}}{{slice .SHA 0 8}}{{else}}{{.SHA}}{{end}}</code> |
| 687 | <button type="button" class="iconbtn" data-copy="{{.SHA}}" 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> |
| 688 | <a class="iconbtn" href="/{{$.Repo.FullPath}}/-/tree?rev={{urlquery .SHA}}" aria-label="{{t "commit.files"}}"><svg class="ico" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M1.5 3.25C1.5 2.56 2.06 2 2.75 2h3.19c.46 0 .9.18 1.23.51l.91.91h5.17c.69 0 1.25.56 1.25 1.25v7.08c0 .69-.56 1.25-1.25 1.25H2.75c-.69 0-1.25-.56-1.25-1.25V3.25z"/></svg></a> |
| 689 | <button type="button" class="iconbtn cchev" data-commit-toggle aria-expanded="false" aria-label="{{t "commit.expand"}}"></button> |
| 690 | </div> |
| 691 | <div class="cmsg" hidden>{{.Body}}</div> |
| 692 | </article> |
| 693 | {{end}} |
| 694 | </section> |
| 695 | {{end}} |
| 696 | {{if or .CommitPrev .CommitNext}} |
| 697 | <nav class="clogmore"> |
| 698 | {{if .CommitPrev}}<a href="{{.CommitPrev}}">{{t "commit.prev"}}</a>{{end}} |
| 699 | {{if .CommitNext}}<a href="{{.CommitNext}}">{{t "commit.more"}}</a>{{end}} |
| 700 | </nav> |
| 701 | {{end}} |
| 702 | {{else if .Query}} |
| 703 | <p class="muted">{{t "commit.none"}}</p> |
| 704 | {{else}} |
| 705 | <p class="muted">{{t "repo.noCommits"}}</p> |
| 706 | {{end}} |
| 707 | <script src="/assets/commits.js"></script> |
| 708 | <script src="/assets/repo.js"></script> |
| 709 | {{template "layout-end" .}} |
| 710 | {{end}} |
| 711 | |
| 712 | |
| 713 | {{define "runnerlist"}} |
| 714 | {{if .Token}}<p>{{t "runner.tokenOnce"}}</p><p class="code">{{.Token}}</p> |
| 715 | <pre class="code">sudo bluegit-runner register --url {{.Base}} --token {{.Token}}</pre>{{end}} |
| 716 | <form method="post" action="{{.New}}"> |
| 717 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 718 | <span class="tiphost"><button type="submit">{{t "runner.new"}}</button> {{tip "runner.tip.token"}}</span> |
| 719 | </form> |
| 720 | {{if .Runners}} |
| 721 | <div class="hscroll"> |
| 722 | <table class="acct"> |
| 723 | <thead><tr><th>{{t "acct.col.name"}}</th><th>{{t "runner.status"}}</th><th>{{t "runner.seen"}}</th><th>{{t "runner.version"}}</th><th></th></tr></thead> |
| 724 | <tbody> |
| 725 | {{range .Runners}}<tr> |
| 726 | <td>{{.Name}}</td> |
| 727 | <td>{{if .Paused}}<span class="pill">{{t "runner.paused"}}</span> {{end}}{{if and .Draining .Online}}<span class="pill">{{t "runner.draining"}}</span> {{end}}{{if .Online}}<span class="pill">{{t "runner.online"}}</span>{{else}}<span class="muted">{{t "runner.offline"}}</span>{{end}}</td> |
| 728 | <td>{{date .LastSeen}}</td> |
| 729 | <td>{{.Version}}</td> |
| 730 | <td class="act"> |
| 731 | <form method="post" action="{{$.Delete}}" data-confirm="{{t "runner.revokeAsk"}}"> |
| 732 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 733 | <button class="danger" type="submit">{{t "acct.revoke"}}</button> |
| 734 | </form> |
| 735 | </td> |
| 736 | </tr>{{end}} |
| 737 | </tbody> |
| 738 | </table> |
| 739 | </div> |
| 740 | {{else}}<p class="muted">{{t "runner.none"}}</p>{{end}} |
| 741 | {{end}} |