| 1 | {{define "setup"}} |
| 2 | {{template "layout-start" .}} |
| 3 | <h1>{{if .StorageUnset}}Opslag kiezen{{else}}Opslagpad{{end}}</h1> |
| 4 | {{if not .StorageUnset}} |
| 5 | <p class="flash bad">Het pad wijzigen verplaatst geen repositories, artifacts of releases.</p> |
| 6 | {{end}} |
| 7 | <section class="panel"> |
| 8 | {{if .StorageFree}}<p>Vrije ruimte: <strong>{{.StorageFree}}</strong> van {{.StorageTotal}}.</p>{{end}} |
| 9 | <form method="post" action="/setup"> |
| 10 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 11 | <label>Pad op de schijf |
| 12 | <input name="path" value="{{.StoragePath}}" required placeholder="/absoluut/pad"> |
| 13 | </label> |
| 14 | <button type="submit">Opslaan</button> |
| 15 | </form> |
| 16 | <p class="muted">Het pad moet bestaan, beschrijfbaar zijn en minstens {{.MinFree}} vrij hebben.</p> |
| 17 | </section> |
| 18 | {{template "layout-end" .}} |
| 19 | {{end}} |
| 20 | |
| 21 | {{define "home"}} |
| 22 | {{template "layout-start" .}} |
| 23 | <section class="hero"> |
| 24 | <img src="/assets/logo.svg" alt="BlueGit"> |
| 25 | <div> |
| 26 | <h1>BlueGit</h1> |
| 27 | <p>Meld je aan om repositories te bekijken.</p> |
| 28 | {{if .StorageUnset}}<p class="flash bad">Opslag is nog niet ingesteld. Repositories zijn tijdelijk niet beschikbaar.</p>{{end}} |
| 29 | <p><a class="btn" href="/login">Aanmelden</a></p> |
| 30 | </div> |
| 31 | </section> |
| 32 | {{if .Repos}} |
| 33 | <section class="panel"> |
| 34 | <h2>Openbare repositories</h2> |
| 35 | <ul class="clean"> |
| 36 | {{range .Repos}}<li><a href="/{{.FullPath}}">{{.FullPath}}</a> <span class="muted">{{.Description}}</span></li>{{end}} |
| 37 | </ul> |
| 38 | </section> |
| 39 | {{end}} |
| 40 | {{template "layout-end" .}} |
| 41 | {{end}} |
| 42 | |
| 43 | {{define "dashboard"}} |
| 44 | {{template "layout-start" .}} |
| 45 | <h1>Overzicht</h1> |
| 46 | {{if .StorageUnset}}<p class="flash bad">Opslag is nog niet ingesteld. Repositories zijn tijdelijk niet beschikbaar.</p>{{end}} |
| 47 | <div class="grid-2"> |
| 48 | <section class="panel"> |
| 49 | <h2>Repositories</h2> |
| 50 | {{if not .Repos}}<p class="muted">Nog geen repositories.</p>{{end}} |
| 51 | <ul class="clean"> |
| 52 | {{range .Repos}}<li><a href="/{{.FullPath}}">{{.FullPath}}</a> <span class="pill">{{.Visibility}}</span><div class="muted">{{.Description}}</div></li>{{end}} |
| 53 | </ul> |
| 54 | </section> |
| 55 | <section class="panel"> |
| 56 | <h2>Groepen</h2> |
| 57 | {{if not .Groups}}<p class="muted">Nog geen groepen.</p>{{end}} |
| 58 | <ul class="clean"> |
| 59 | {{range .Groups}}<li><a href="/groups/{{.Path}}">{{.Name}}</a> <span class="muted">{{.Path}}</span></li>{{end}} |
| 60 | </ul> |
| 61 | </section> |
| 62 | </div> |
| 63 | {{template "layout-end" .}} |
| 64 | {{end}} |
| 65 | |
| 66 | {{define "new"}} |
| 67 | {{template "layout-start" .}} |
| 68 | <h1>Nieuw</h1> |
| 69 | <div class="grid-2"> |
| 70 | <form class="panel" method="post" action="/new/repo" data-kind="repo"> |
| 71 | <h2>Repository</h2> |
| 72 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 73 | <label>Naam <input name="name" required autocomplete="off"></label> |
| 74 | <p class="preview" data-slug-out></p> |
| 75 | <label>Beschrijving <input name="description"></label> |
| 76 | <label>Eigenaar |
| 77 | <select name="group"> |
| 78 | <option value="">Ikzelf</option> |
| 79 | {{range .Groups}}<option value="{{.Path}}">{{.Name}}</option>{{end}} |
| 80 | </select> |
| 81 | </label> |
| 82 | <label>Zichtbaarheid |
| 83 | <select name="visibility"><option value="private">Privé</option><option value="public">Openbaar</option></select> |
| 84 | </label> |
| 85 | <button type="submit">Aanmaken</button> |
| 86 | </form> |
| 87 | <form class="panel" method="post" action="/new/group" data-kind="group"> |
| 88 | <h2>Groep</h2> |
| 89 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 90 | <label>Naam <input name="name" required autocomplete="off"></label> |
| 91 | <p class="preview" data-slug-out></p> |
| 92 | <label>Beschrijving <input name="description"></label> |
| 93 | <button type="submit">Aanmaken</button> |
| 94 | </form> |
| 95 | </div> |
| 96 | <script src="/assets/slug.js"></script> |
| 97 | {{template "layout-end" .}} |
| 98 | {{end}} |
| 99 | |
| 100 | {{define "account"}} |
| 101 | {{template "layout-start" .}} |
| 102 | <h1>Account</h1> |
| 103 | <p class="muted">Voor git via HTTPS: je gebruikersnaam en een token als wachtwoord.</p> |
| 104 | {{if .NewToken}}<p class="code">{{.NewToken}}</p>{{end}} |
| 105 | <section class="panel"> |
| 106 | <h2>Toegangstokens</h2> |
| 107 | <form method="post" action="/settings/tokens"> |
| 108 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 109 | <div class="row"><input name="name" placeholder="naam, bijvoorbeeld laptop" required><button type="submit">Nieuw token</button></div> |
| 110 | </form> |
| 111 | <ul class="clean"> |
| 112 | {{range .Tokens}}<li>{{.Name}} <span class="muted">{{.Prefix}}…</span> |
| 113 | <form method="post" action="/settings/tokens/delete" class="row"> |
| 114 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 115 | <button class="ghost" type="submit">Intrekken</button> |
| 116 | </form> |
| 117 | </li>{{end}} |
| 118 | </ul> |
| 119 | </section> |
| 120 | <section class="panel"> |
| 121 | <h2>SSH-sleutels</h2> |
| 122 | <form method="post" action="/settings/ssh"> |
| 123 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 124 | <label>Naam <input name="name" placeholder="laptop"></label> |
| 125 | <label>Publieke sleutel <textarea name="key" placeholder="ssh-ed25519 AAAA... " required></textarea></label> |
| 126 | <button type="submit">Toevoegen</button> |
| 127 | </form> |
| 128 | <ul class="clean"> |
| 129 | {{range .Keys}}<li>{{.Name}} <span class="muted">{{.Fingerprint}}</span> |
| 130 | <form method="post" action="/settings/ssh/delete"> |
| 131 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 132 | <button class="ghost" type="submit">Verwijderen</button> |
| 133 | </form> |
| 134 | </li>{{end}} |
| 135 | </ul> |
| 136 | </section> |
| 137 | <p><a href="/settings/export">Gegevens downloaden (JSON)</a></p> |
| 138 | {{template "layout-end" .}} |
| 139 | {{end}} |
| 140 | |
| 141 | {{define "ficon"}} |
| 142 | {{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> |
| 143 | {{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> |
| 144 | {{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> |
| 145 | {{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> |
| 146 | {{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> |
| 147 | {{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> |
| 148 | {{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> |
| 149 | {{end}} |
| 150 | {{end}} |
| 151 | |
| 152 | {{define "visicon"}} |
| 153 | {{if eq .Repo.Visibility "public"}}<svg class="vis" viewBox="0 0 16 16" aria-label="Openbaar"><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> |
| 154 | {{else}}<svg class="vis" viewBox="0 0 16 16" aria-label="Privé"><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> |
| 155 | {{end}} |
| 156 | {{end}} |
| 157 | |
| 158 | {{define "branchpick"}} |
| 159 | <label class="branch"> |
| 160 | <select data-rev> |
| 161 | {{range .Branches}}<option value="{{.Name}}" {{if eq .Name $.Rev}}selected{{end}}>{{.Name}}</option>{{end}} |
| 162 | </select> |
| 163 | </label> |
| 164 | {{if .RevProtected}}<svg class="vis" viewBox="0 0 16 16" aria-label="Beschermd"><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}} |
| 165 | {{end}} |
| 166 | |
| 167 | {{define "commitbar"}} |
| 168 | {{if .Head}} |
| 169 | <div class="commitbar"> |
| 170 | <span class="avatar">{{initial .Head.Author}}</span> |
| 171 | <div class="grow"> |
| 172 | <a href="/{{.Repo.FullPath}}/-/commit/{{.Head.SHA}}">{{.Head.Subject}}</a> |
| 173 | <div class="muted">{{.Head.Author}} · {{.Head.When}}</div> |
| 174 | </div> |
| 175 | <code class="sha">{{slice .Head.SHA 0 8}}</code> |
| 176 | <button type="button" class="iconbtn" data-copy="{{.Head.SHA}}" aria-label="Kopieer">Kopieer</button> |
| 177 | <a class="btn ghost" href="/{{.Repo.FullPath}}/-/commits?rev={{.Rev}}">Geschiedenis</a> |
| 178 | </div> |
| 179 | {{end}} |
| 180 | {{end}} |
| 181 | |
| 182 | {{define "codemenu"}} |
| 183 | <details class="menu"> |
| 184 | <summary class="btn ghost">Code</summary> |
| 185 | <div class="menu-panel"> |
| 186 | {{if .CloneSSH}} |
| 187 | <p class="muted">SSH</p> |
| 188 | <div class="copyline"><input readonly value="{{.CloneSSH}}"><button type="button" data-copy="{{.CloneSSH}}">Kopieer</button></div> |
| 189 | {{end}} |
| 190 | <p class="muted">HTTPS</p> |
| 191 | <div class="copyline"><input readonly value="{{.CloneHTTP}}"><button type="button" data-copy="{{.CloneHTTP}}">Kopieer</button></div> |
| 192 | <p class="muted">Gebruikersnaam en een token als wachtwoord.</p> |
| 193 | </div> |
| 194 | </details> |
| 195 | {{end}} |
| 196 | |
| 197 | {{define "filetable"}} |
| 198 | {{if .Files}} |
| 199 | <table class="files"> |
| 200 | <thead><tr><th>Naam</th><th>Laatste commit</th><th>Laatste wijziging</th></tr></thead> |
| 201 | <tbody> |
| 202 | {{range .Files}} |
| 203 | <tr> |
| 204 | <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> |
| 205 | <td class="msg">{{if .SHA}}<a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a>{{end}}</td> |
| 206 | <td class="muted">{{.When}}</td> |
| 207 | </tr> |
| 208 | {{end}} |
| 209 | </tbody> |
| 210 | </table> |
| 211 | {{else if eq .Page "files"}}<p class="muted">Deze map is leeg.</p>{{else if not .Head}}<p class="panel">Nog geen commits.</p>{{end}} |
| 212 | {{end}} |
| 213 | |
| 214 | {{define "repo"}} |
| 215 | {{template "layout-start" .}} |
| 216 | <p class="crumbs">{{if eq .Repo.OwnerKind "group"}}<a href="/groups/{{.Repo.OwnerPath}}">{{.Repo.OwnerPath}}</a>{{else}}<span>{{.Repo.OwnerPath}}</span>{{end}} / <span>{{.Repo.Name}}</span></p> |
| 217 | {{template "repotabs" .}} |
| 218 | <div class="projhead"> |
| 219 | <span class="tile">{{initial .Repo.Name}}</span> |
| 220 | <h1>{{.Repo.Name}}</h1> |
| 221 | {{template "visicon" .}} |
| 222 | </div> |
| 223 | <div class="proj"> |
| 224 | <div> |
| 225 | <div class="toolbar"> |
| 226 | <div class="left">{{template "branchpick" .}} <span class="pathnow">{{.Repo.Name}}</span></div> |
| 227 | <div class="right"> |
| 228 | <a class="btn ghost" href="/{{.Repo.FullPath}}/-/tree?rev={{.Rev}}&focus=1">Bestand zoeken</a> |
| 229 | {{template "codemenu" .}} |
| 230 | </div> |
| 231 | </div> |
| 232 | {{template "commitbar" .}} |
| 233 | {{template "filetable" .}} |
| 234 | {{if .ReadmeName}} |
| 235 | <article class="readme"> |
| 236 | <header>{{template "ficon" "md"}} {{.ReadmeName}}</header> |
| 237 | <div class="mdbody">{{.Readme}}</div> |
| 238 | </article> |
| 239 | {{end}} |
| 240 | </div> |
| 241 | <aside class="side"> |
| 242 | <h2>Projectinformatie</h2> |
| 243 | {{if .Repo.Description}}<p>{{.Repo.Description}}</p>{{end}} |
| 244 | <ul class="counts"> |
| 245 | <li><a href="/{{.Repo.FullPath}}/-/commits?rev={{.Rev}}">{{.NCommits}} {{if eq .NCommits 1}}commit{{else}}commits{{end}}</a></li> |
| 246 | <li><a href="/{{.Repo.FullPath}}/-/branches">{{.NBranches}} {{if eq .NBranches 1}}branch{{else}}branches{{end}}</a></li> |
| 247 | <li><a href="/{{.Repo.FullPath}}/-/tags">{{.NTags}} {{if eq .NTags 1}}tag{{else}}tags{{end}}</a></li> |
| 248 | <li><a href="/{{.Repo.FullPath}}/-/releases">{{.NReleases}} {{if eq .NReleases 1}}release{{else}}releases{{end}}</a></li> |
| 249 | </ul> |
| 250 | {{if .ReadmeName}}<p><a href="/{{.Repo.FullPath}}/-/blob/{{.ReadmeName}}?rev={{.Rev}}">README</a></p>{{end}} |
| 251 | {{if .LicensePath}}<p><a href="/{{.Repo.FullPath}}/-/blob/{{.LicensePath}}?rev={{.Rev}}">LICENSE</a></p>{{end}} |
| 252 | {{if .Created}}<p class="muted">Aangemaakt op {{.Created}}</p>{{end}} |
| 253 | </aside> |
| 254 | </div> |
| 255 | <script src="/assets/repo.js"></script> |
| 256 | {{template "layout-end" .}} |
| 257 | {{end}} |
| 258 | |
| 259 | {{define "files"}} |
| 260 | {{template "layout-start" .}} |
| 261 | <p class="crumbs">{{if eq .Repo.OwnerKind "group"}}<a href="/groups/{{.Repo.OwnerPath}}">{{.Repo.OwnerPath}}</a>{{else}}<span>{{.Repo.OwnerPath}}</span>{{end}} / <a href="/{{.Repo.FullPath}}?rev={{.Rev}}">{{.Repo.Name}}</a></p> |
| 262 | {{template "repotabs" .}} |
| 263 | <div class="fileview"> |
| 264 | <aside class="treebox"> |
| 265 | <h2>Bestanden</h2> |
| 266 | <input type="search" placeholder="Zoeken" data-tree-filter> |
| 267 | <ul class="treelist"> |
| 268 | {{range .Tree}} |
| 269 | <li class="depth-{{.Depth}}{{if .Active}} active{{end}}" data-path="{{.Path}}"> |
| 270 | {{template "ficon" .Icon}} |
| 271 | {{if .Dir}}<a href="/{{$.Repo.FullPath}}/-/tree/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{else}}<a href="/{{$.Repo.FullPath}}/-/blob/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{end}} |
| 272 | </li> |
| 273 | {{end}} |
| 274 | </ul> |
| 275 | </aside> |
| 276 | <div> |
| 277 | <div class="toolbar"> |
| 278 | <div class="left"> |
| 279 | {{template "branchpick" .}} |
| 280 | <span class="pathnow"> |
| 281 | <a href="/{{.Repo.FullPath}}/-/tree?rev={{.Rev}}">{{.Repo.Name}}</a> |
| 282 | {{if .BlobPath}}{{range splitPath .BlobPath}} / <span>{{.}}</span>{{end}}{{else if .TreePath}}{{range splitPath .TreePath}} / <span>{{.}}</span>{{end}}{{end}} |
| 283 | </span> |
| 284 | {{if or .BlobPath .TreePath}}<button type="button" class="iconbtn" data-copy="{{if .BlobPath}}{{.BlobPath}}{{else}}{{.TreePath}}{{end}}" aria-label="Kopieer">Kopieer</button>{{end}} |
| 285 | </div> |
| 286 | </div> |
| 287 | {{if .BlobPath}} |
| 288 | <h1 class="filename">{{template "ficon" (iconOf .FileName)}} {{.FileName}}</h1> |
| 289 | {{template "commitbar" .}} |
| 290 | <article class="codebox"> |
| 291 | <header>{{template "ficon" (iconOf .FileName)}} {{.FileName}} <span class="muted">{{.BlobSize}}</span></header> |
| 292 | {{if .Binary}}<p>Binair bestand.</p>{{else}} |
| 293 | <table class="code"> |
| 294 | {{range .Lines}}<tr><td class="ln">{{.N}}</td><td class="src">{{.HTML}}</td></tr>{{end}} |
| 295 | </table> |
| 296 | {{end}} |
| 297 | </article> |
| 298 | {{else}} |
| 299 | {{template "filetable" .}} |
| 300 | {{end}} |
| 301 | </div> |
| 302 | </div> |
| 303 | <script src="/assets/repo.js"></script> |
| 304 | {{template "layout-end" .}} |
| 305 | {{end}} |
| 306 | |
| 307 | {{define "tags"}} |
| 308 | {{template "layout-start" .}} |
| 309 | <h1>Tags</h1> |
| 310 | {{template "repotabs" .}} |
| 311 | <ul class="clean"> |
| 312 | {{range .TagNames}}<li><code>{{.}}</code></li>{{else}}<li class="muted">Nog geen tags.</li>{{end}} |
| 313 | </ul> |
| 314 | {{template "layout-end" .}} |
| 315 | {{end}} |
| 316 | |
| 317 | {{define "commits"}} |
| 318 | {{template "layout-start" .}} |
| 319 | <h1>Commits</h1> |
| 320 | {{template "repotabs" .}} |
| 321 | <ul class="clean"> |
| 322 | {{range .Commits}}<li><a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Short}}</a> {{.Subject}} <span class="muted">{{.Author}} · {{.Date}}</span></li>{{else}}<li class="muted">Nog geen commits.</li>{{end}} |
| 323 | </ul> |
| 324 | {{template "layout-end" .}} |
| 325 | {{end}} |
| 326 | |
| 327 | {{define "commit"}} |
| 328 | {{template "layout-start" .}} |
| 329 | <h1>{{.Commit.Subject}}</h1> |
| 330 | {{template "repotabs" .}} |
| 331 | <p class="muted">{{.Commit.SHA}} · {{.Commit.Author}} · {{.Commit.Date}}</p> |
| 332 | {{if .Commit.Body}}<pre>{{.Commit.Body}}</pre>{{end}} |
| 333 | {{template "layout-end" .}} |
| 334 | {{end}} |
| 335 | |
| 336 | {{define "branches"}} |
| 337 | {{template "layout-start" .}} |
| 338 | <h1>Branches</h1> |
| 339 | {{template "repotabs" .}} |
| 340 | <ul class="clean"> |
| 341 | {{range .Branches}}<li><a href="/{{$.Repo.FullPath}}?rev={{.Name}}">{{.Name}}</a> {{if .Protected}}<span class="pill">beschermd</span>{{end}}</li>{{else}}<li class="muted">Nog geen branches.</li>{{end}} |
| 342 | </ul> |
| 343 | {{template "layout-end" .}} |
| 344 | {{end}} |