| 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 .StorageFree}}<p>{{t "setup.free" .StorageFree .StorageTotal}}</p>{{end}} |
| 9 | <form method="post" action="/setup"> |
| 10 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 11 | <label>{{t "setup.disk"}} |
| 12 | <input name="path" value="{{.StoragePath}}" required placeholder="/absolute/path"> |
| 13 | </label> |
| 14 | <button type="submit">{{t "action.save"}}</button> |
| 15 | </form> |
| 16 | <p class="muted">{{t "setup.rules" .MinFree}}</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>{{t "home.lead"}}</p> |
| 28 | {{if .StorageUnset}}<p class="flash bad">{{t "home.storage"}}</p>{{end}} |
| 29 | <p><a class="btn" href="/login">{{t "nav.signin"}}</a></p> |
| 30 | </div> |
| 31 | </section> |
| 32 | {{if .Repos}} |
| 33 | <section class="panel"> |
| 34 | <h2>{{t "home.public"}}</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 | <header class="pagehead"> |
| 46 | <h1>{{t "nav.dashboard"}}</h1> |
| 47 | <div class="pageacts"><a class="btn" href="/new">{{t "nav.new"}}</a></div> |
| 48 | </header> |
| 49 | {{if .StorageUnset}}<p class="flash bad">{{t "home.storage"}}</p>{{end}} |
| 50 | {{if .Heat}}{{template "heatmap" .Heat}}{{end}} |
| 51 | <div class="grid-2"> |
| 52 | <section class="panel"> |
| 53 | <h2>{{t "dash.repos"}}</h2> |
| 54 | {{if not .Repos}}<p class="muted">{{t "dash.noRepos"}}</p>{{end}} |
| 55 | <ul class="clean"> |
| 56 | {{range .Repos}}<li><a href="/{{.FullPath}}">{{.FullPath}}</a> <span class="pill">{{visName .Visibility}}</span><div class="muted">{{.Description}}</div></li>{{end}} |
| 57 | </ul> |
| 58 | </section> |
| 59 | <section class="panel"> |
| 60 | <h2>{{t "dash.groups"}}</h2> |
| 61 | {{if not .Groups}}<p class="muted">{{t "dash.noGroups"}}</p>{{end}} |
| 62 | <ul class="clean"> |
| 63 | {{range .Groups}}<li><a href="/groups/{{.Path}}">{{.Name}}</a> <span class="muted">{{.Path}}</span></li>{{end}} |
| 64 | </ul> |
| 65 | </section> |
| 66 | </div> |
| 67 | {{template "layout-end" .}} |
| 68 | {{end}} |
| 69 | |
| 70 | {{define "profile"}} |
| 71 | {{template "layout-start" .}} |
| 72 | <header class="pagehead"> |
| 73 | <div class="projhead"> |
| 74 | {{if .Profile.AvatarURL}}<img class="avatar lg" src="{{.Profile.AvatarURL}}" alt="">{{else}}<span class="avatar lg">{{initial .Profile.Username}}</span>{{end}} |
| 75 | <h1>{{.Profile.Username}}</h1> |
| 76 | </div> |
| 77 | </header> |
| 78 | {{if .Heat}}{{template "heatmap" .Heat}}{{end}} |
| 79 | {{template "layout-end" .}} |
| 80 | {{end}} |
| 81 | |
| 82 | {{define "heatmap"}} |
| 83 | <section class="heat" aria-label="{{t "heat.title"}}"> |
| 84 | <h2>{{t "heat.title"}}</h2> |
| 85 | <div class="heat-scroll"> |
| 86 | <div class="heat-months"> |
| 87 | {{range .Weeks}}<span>{{.Label}}</span>{{end}} |
| 88 | </div> |
| 89 | <div class="heat-body"> |
| 90 | <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> |
| 91 | <div class="heat-cols"> |
| 92 | {{range .Weeks}} |
| 93 | <div class="heat-col"> |
| 94 | {{range .Days}}{{if .Off}}<span class="sq off"></span>{{else}}<span class="sq lv{{.Level}}" title="{{.Tip}}" tabindex="0"></span>{{end}}{{end}} |
| 95 | </div> |
| 96 | {{end}} |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | <div class="heat-foot"> |
| 101 | <p class="heat-total">{{.TotalText}}</p> |
| 102 | <div> |
| 103 | <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> |
| 104 | <p class="muted">{{t "heat.note"}}</p> |
| 105 | </div> |
| 106 | </div> |
| 107 | </section> |
| 108 | {{end}} |
| 109 | |
| 110 | {{define "new"}} |
| 111 | {{template "layout-start" .}} |
| 112 | <header class="pagehead"><h1>{{t "title.new"}}</h1></header> |
| 113 | <div class="chooser" data-chooser> |
| 114 | <button type="button" class="pick" data-open="repo">{{t "new.repo"}}</button> |
| 115 | <button type="button" class="pick" data-open="group">{{t "new.group"}}</button> |
| 116 | </div> |
| 117 | <div class="sheet" data-sheet hidden> |
| 118 | <p><button type="button" class="ghost" data-close>{{t "action.close"}}</button></p> |
| 119 | <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> |
| 120 | <h2>{{t "new.repo"}}</h2> |
| 121 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 122 | <label>{{t "new.name"}} <input name="name" required autocomplete="off"></label> |
| 123 | <p class="preview"><span data-slug-text></span> <span data-slug-flag></span></p> |
| 124 | <label>{{t "new.description"}} <input name="description"></label> |
| 125 | <label>{{t "new.owner"}} |
| 126 | <select name="group"> |
| 127 | <option value="">{{t "new.me"}}</option> |
| 128 | {{range .Groups}}<option value="{{.Path}}">{{.Name}}</option>{{end}} |
| 129 | </select> |
| 130 | </label> |
| 131 | <label>{{t "new.visibility"}} |
| 132 | <select name="visibility"><option value="private">{{t "vis.private"}}</option><option value="public">{{t "vis.public"}}</option></select> |
| 133 | </label> |
| 134 | <p class="form-err" data-form-err></p> |
| 135 | <button type="submit">{{t "action.save"}}</button> |
| 136 | </form> |
| 137 | <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> |
| 138 | <h2>{{t "new.group"}}</h2> |
| 139 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 140 | <label>{{t "new.name"}} <input name="name" required autocomplete="off"></label> |
| 141 | <p class="preview"><span data-slug-text></span> <span data-slug-flag></span></p> |
| 142 | <label>{{t "new.description"}} <input name="description"></label> |
| 143 | <label>{{t "new.role"}} |
| 144 | <select name="default_role"> |
| 145 | <option value="readonly">{{t "role.readonly"}}</option> |
| 146 | <option value="developer" selected>{{t "role.developer"}}</option> |
| 147 | <option value="maintainer">{{t "role.maintainer"}}</option> |
| 148 | </select> |
| 149 | </label> |
| 150 | <p class="muted">{{t "new.roleHint"}}</p> |
| 151 | <p class="form-err" data-form-err></p> |
| 152 | <button type="submit">{{t "action.save"}}</button> |
| 153 | </form> |
| 154 | </div> |
| 155 | <script src="/assets/slug.js"></script> |
| 156 | <script src="/assets/new.js"></script> |
| 157 | {{template "layout-end" .}} |
| 158 | {{end}} |
| 159 | |
| 160 | {{define "account"}} |
| 161 | {{template "layout-start" .}} |
| 162 | <header class="pagehead"><h1>{{t "title.account"}}</h1></header> |
| 163 | <p class="muted">{{t "acct.hint"}}</p> |
| 164 | <section class="panel"> |
| 165 | <h2>{{t "acct.language"}}</h2> |
| 166 | <form method="post" action="/settings/language"> |
| 167 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 168 | <div class="row"> |
| 169 | <select name="language"> |
| 170 | {{range .Langs}}<option value="{{.Code}}" {{if eq .Code $.Lang}}selected{{end}}>{{.Label}}</option>{{end}} |
| 171 | </select> |
| 172 | <button type="submit">{{t "action.save"}}</button> |
| 173 | </div> |
| 174 | </form> |
| 175 | </section> |
| 176 | {{if .NewToken}}<p class="code">{{.NewToken}}</p>{{end}} |
| 177 | <section class="panel"> |
| 178 | <h2>{{t "acct.tokens"}}</h2> |
| 179 | <form method="post" action="/settings/tokens"> |
| 180 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 181 | <div class="row"><input name="name" placeholder="{{t "acct.tokenName"}}" required><button type="submit">{{t "acct.newToken"}}</button></div> |
| 182 | </form> |
| 183 | <ul class="clean"> |
| 184 | {{range .Tokens}}<li>{{.Name}} <span class="muted">{{.Prefix}}…</span> |
| 185 | <form method="post" action="/settings/tokens/delete" class="row"> |
| 186 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 187 | <button class="ghost" type="submit">{{t "acct.revoke"}}</button> |
| 188 | </form> |
| 189 | </li>{{end}} |
| 190 | </ul> |
| 191 | </section> |
| 192 | <section class="panel"> |
| 193 | <h2>{{t "acct.ssh"}}</h2> |
| 194 | <form method="post" action="/settings/ssh"> |
| 195 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 196 | <label>{{t "acct.keyName"}} <input name="name" placeholder="laptop"></label> |
| 197 | <label>{{t "acct.pubkey"}} <textarea name="key" placeholder="ssh-ed25519 AAAA... " required></textarea></label> |
| 198 | <button type="submit">{{t "acct.add"}}</button> |
| 199 | </form> |
| 200 | <ul class="clean"> |
| 201 | {{range .Keys}}<li>{{.Name}} <span class="muted">{{.Fingerprint}}</span> |
| 202 | <form method="post" action="/settings/ssh/delete"> |
| 203 | <input type="hidden" name="csrf" value="{{$.CSRF}}"><input type="hidden" name="id" value="{{.ID}}"> |
| 204 | <button class="ghost" type="submit">{{t "acct.remove"}}</button> |
| 205 | </form> |
| 206 | </li>{{end}} |
| 207 | </ul> |
| 208 | </section> |
| 209 | <p><a href="/settings/export">{{t "acct.export"}}</a></p> |
| 210 | {{template "layout-end" .}} |
| 211 | {{end}} |
| 212 | |
| 213 | {{define "ficon"}} |
| 214 | {{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> |
| 215 | {{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> |
| 216 | {{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> |
| 217 | {{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> |
| 218 | {{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> |
| 219 | {{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> |
| 220 | {{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> |
| 221 | {{end}} |
| 222 | {{end}} |
| 223 | |
| 224 | {{define "visicon"}} |
| 225 | {{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> |
| 226 | {{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> |
| 227 | {{end}} |
| 228 | {{end}} |
| 229 | |
| 230 | {{define "branchpick"}} |
| 231 | <label class="branch"> |
| 232 | <select data-rev> |
| 233 | {{range .Branches}}<option value="{{.Name}}" {{if eq .Name $.Rev}}selected{{end}}>{{.Name}}</option>{{end}} |
| 234 | </select> |
| 235 | </label> |
| 236 | {{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}} |
| 237 | {{end}} |
| 238 | |
| 239 | {{define "avatar"}} |
| 240 | {{if .Avatar}}<img class="avatar" src="{{.Avatar}}" alt="">{{else}}<span class="avatar">{{if .Initial}}{{.Initial}}{{else}}{{initial .Author}}{{end}}</span>{{end}} |
| 241 | {{end}} |
| 242 | |
| 243 | {{define "commitwho"}}<span class="commitwho">{{if .UserURL}}<a href="{{.UserURL}}">{{.Author}}</a>{{else}}{{.Author}}{{end}}{{if .RawName}} {{.RawName}}{{end}}{{if .PushedBy}} · {{t "commit.pushedBy" .PushedBy}}{{end}}</span>{{end}} |
| 244 | |
| 245 | {{define "commitbar"}} |
| 246 | {{if .Head}} |
| 247 | <div class="commitbar"> |
| 248 | {{template "avatar" .Head}} |
| 249 | <div class="grow"> |
| 250 | <a class="subject" href="/{{.Repo.FullPath}}/-/commit/{{.Head.SHA}}">{{.Head.Subject}}</a> |
| 251 | <div class="muted">{{template "commitwho" .Head}} · {{.Head.When}}</div> |
| 252 | </div> |
| 253 | {{if .Head.PipeStatus}}<a class="status {{.Head.PipeStatus}}" href="/{{.Repo.FullPath}}/-/pipelines/{{.Head.PipeID}}"><span class="mark"></span>{{.Head.PipeLabel}}</a>{{end}} |
| 254 | <code class="sha">{{slice .Head.SHA 0 8}}</code> |
| 255 | <button type="button" class="iconbtn" data-copy="{{.Head.SHA}}" aria-label="{{t "action.copy"}}">{{t "action.copy"}}</button> |
| 256 | <a class="btn ghost" href="/{{.Repo.FullPath}}/-/commits?rev={{.Rev}}">{{t "repo.history"}}</a> |
| 257 | </div> |
| 258 | {{end}} |
| 259 | {{end}} |
| 260 | |
| 261 | {{define "codemenu"}} |
| 262 | <details class="menu"> |
| 263 | <summary class="btn ghost">{{t "repo.code"}}</summary> |
| 264 | <div class="menu-panel"> |
| 265 | {{if .CloneSSH}} |
| 266 | <p class="muted">{{t "repo.ssh"}}</p> |
| 267 | <div class="copyline"><input readonly value="{{.CloneSSH}}"><button type="button" data-copy="{{.CloneSSH}}">{{t "action.copy"}}</button></div> |
| 268 | {{end}} |
| 269 | <p class="muted">{{t "repo.https"}}</p> |
| 270 | <div class="copyline"><input readonly value="{{.CloneHTTP}}"><button type="button" data-copy="{{.CloneHTTP}}">{{t "action.copy"}}</button></div> |
| 271 | <p class="muted">{{t "repo.cloneHint"}}</p> |
| 272 | </div> |
| 273 | </details> |
| 274 | {{end}} |
| 275 | |
| 276 | {{define "filetable"}} |
| 277 | {{if .Files}} |
| 278 | <div class="hscroll"> |
| 279 | <table class="files"> |
| 280 | <thead><tr><th>{{t "repo.name"}}</th><th>{{t "repo.lastCommit"}}</th><th>{{t "repo.lastChange"}}</th></tr></thead> |
| 281 | <tbody> |
| 282 | {{range .Files}} |
| 283 | <tr> |
| 284 | <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> |
| 285 | <td class="msg">{{if .SHA}}<a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a>{{end}}</td> |
| 286 | <td class="muted">{{.When}}</td> |
| 287 | </tr> |
| 288 | {{end}} |
| 289 | </tbody> |
| 290 | </table> |
| 291 | </div> |
| 292 | {{else if eq .Page "files"}}<p class="muted">{{t "repo.emptyDir"}}</p>{{else if not .Head}}<p class="panel">{{t "repo.noCommits"}}</p>{{end}} |
| 293 | {{end}} |
| 294 | |
| 295 | {{define "repo"}} |
| 296 | {{template "layout-start" .}} |
| 297 | <header class="pagehead"> |
| 298 | <h1>{{t "tab.overview"}}</h1> |
| 299 | <div class="pageacts"> |
| 300 | <a class="btn ghost" href="/{{.Repo.FullPath}}/-/tree?rev={{.Rev}}&focus=1">{{t "repo.searchFile"}}</a> |
| 301 | {{template "codemenu" .}} |
| 302 | </div> |
| 303 | </header> |
| 304 | {{if .Heat}}{{template "heatmap" .Heat}}{{end}} |
| 305 | <div class="proj"> |
| 306 | <div> |
| 307 | <div class="toolbar"> |
| 308 | <div class="left">{{template "branchpick" .}} <span class="pathnow">{{.Repo.Name}}</span></div> |
| 309 | </div> |
| 310 | {{template "commitbar" .}} |
| 311 | {{template "filetable" .}} |
| 312 | {{if .ReadmeName}} |
| 313 | <article class="readme"> |
| 314 | <header>{{template "ficon" "md"}} {{.ReadmeName}}</header> |
| 315 | <div class="mdbody">{{.Readme}}</div> |
| 316 | </article> |
| 317 | {{end}} |
| 318 | </div> |
| 319 | <aside class="side"> |
| 320 | <h2>{{t "repo.project"}}</h2> |
| 321 | {{if .Repo.Description}}<p>{{.Repo.Description}}</p>{{end}} |
| 322 | <ul class="counts"> |
| 323 | <li><a href="/{{.Repo.FullPath}}/-/commits?rev={{.Rev}}">{{tn .NCommits "count.commit.one" "count.commit.many"}}</a></li> |
| 324 | <li><a href="/{{.Repo.FullPath}}/-/branches">{{tn .NBranches "count.branch.one" "count.branch.many"}}</a></li> |
| 325 | <li><a href="/{{.Repo.FullPath}}/-/tags">{{tn .NTags "count.tag.one" "count.tag.many"}}</a></li> |
| 326 | <li><a href="/{{.Repo.FullPath}}/-/releases">{{tn .NReleases "count.release.one" "count.release.many"}}</a></li> |
| 327 | </ul> |
| 328 | {{if .ReadmeName}}<p><a href="/{{.Repo.FullPath}}/-/blob/{{.ReadmeName}}?rev={{.Rev}}">README</a></p>{{end}} |
| 329 | {{if .LicensePath}}<p><a href="/{{.Repo.FullPath}}/-/blob/{{.LicensePath}}?rev={{.Rev}}">LICENSE</a></p>{{end}} |
| 330 | {{if .Created}}<p class="muted">{{t "repo.created" .Created}}</p>{{end}} |
| 331 | </aside> |
| 332 | </div> |
| 333 | <script src="/assets/repo.js"></script> |
| 334 | {{template "layout-end" .}} |
| 335 | {{end}} |
| 336 | |
| 337 | {{define "files"}} |
| 338 | {{template "layout-start" .}} |
| 339 | <header class="pagehead"><h1>{{t "tab.files"}}</h1></header> |
| 340 | <div class="fileview"> |
| 341 | <aside class="treebox"> |
| 342 | <h2>{{t "repo.files"}}</h2> |
| 343 | <input type="search" placeholder="{{t "group.search"}}" data-tree-filter> |
| 344 | <ul class="treelist"> |
| 345 | {{range .Tree}} |
| 346 | <li class="depth-{{.Depth}}{{if .Active}} active{{end}}" data-path="{{.Path}}"> |
| 347 | {{template "ficon" .Icon}} |
| 348 | {{if .Dir}}<a href="/{{$.Repo.FullPath}}/-/tree/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{else}}<a href="/{{$.Repo.FullPath}}/-/blob/{{.Path}}?rev={{$.Rev}}">{{.Name}}</a>{{end}} |
| 349 | </li> |
| 350 | {{end}} |
| 351 | </ul> |
| 352 | </aside> |
| 353 | <div> |
| 354 | <div class="toolbar"> |
| 355 | <div class="left"> |
| 356 | {{template "branchpick" .}} |
| 357 | <span class="pathnow"> |
| 358 | <a href="/{{.Repo.FullPath}}/-/tree?rev={{.Rev}}">{{.Repo.Name}}</a> |
| 359 | {{if .BlobPath}}{{range splitPath .BlobPath}} / <span>{{.}}</span>{{end}}{{else if .TreePath}}{{range splitPath .TreePath}} / <span>{{.}}</span>{{end}}{{end}} |
| 360 | </span> |
| 361 | {{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}} |
| 362 | </div> |
| 363 | </div> |
| 364 | {{if .BlobPath}} |
| 365 | <h2 class="filename">{{template "ficon" (iconOf .FileName)}} {{.FileName}}</h2> |
| 366 | {{template "commitbar" .}} |
| 367 | <article class="codebox"> |
| 368 | <header>{{template "ficon" (iconOf .FileName)}} {{.FileName}} <span class="muted">{{.BlobSize}}</span></header> |
| 369 | {{if .Binary}}<p>{{t "repo.binary"}}</p>{{else}} |
| 370 | <table class="code"> |
| 371 | {{range .Lines}}<tr><td class="ln">{{.N}}</td><td class="src">{{.HTML}}</td></tr>{{end}} |
| 372 | </table> |
| 373 | {{end}} |
| 374 | </article> |
| 375 | {{else}} |
| 376 | {{template "filetable" .}} |
| 377 | {{end}} |
| 378 | </div> |
| 379 | </div> |
| 380 | <script src="/assets/repo.js"></script> |
| 381 | {{template "layout-end" .}} |
| 382 | {{end}} |
| 383 | |
| 384 | {{define "tags"}} |
| 385 | {{template "layout-start" .}} |
| 386 | <header class="pagehead"><h1>{{t "title.tags"}}</h1></header> |
| 387 | <form class="bar" method="get" action="/{{.Repo.FullPath}}/-/tags"> |
| 388 | <input type="search" name="q" value="{{.Query}}" placeholder="{{t "tag.search"}}" aria-label="{{t "tag.search"}}"> |
| 389 | </form> |
| 390 | {{if .CanWrite}} |
| 391 | <form class="panel" method="post" action="/{{.Repo.FullPath}}/-/tags"> |
| 392 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 393 | <div class="row"> |
| 394 | <input name="name" placeholder="{{t "tag.name"}}" required> |
| 395 | <input name="target" list="tag-targets" placeholder="{{t "tag.target"}}" value="{{.Rev}}" required> |
| 396 | <input name="message" placeholder="{{t "tag.message"}}"> |
| 397 | <button type="submit">{{t "tag.create"}}</button> |
| 398 | </div> |
| 399 | </form> |
| 400 | <datalist id="tag-targets">{{range .Branches}}<option value="{{.Name}}"></option>{{end}}</datalist> |
| 401 | {{end}} |
| 402 | {{if .Tags}} |
| 403 | <div class="hscroll"> |
| 404 | <table class="tags"> |
| 405 | <thead> |
| 406 | <tr> |
| 407 | <th>{{t "tag.name"}}</th> |
| 408 | <th>{{t "tag.commit"}}</th> |
| 409 | <th>{{t "tag.date"}}</th> |
| 410 | <th>{{t "tag.message"}}</th> |
| 411 | <th></th> |
| 412 | </tr> |
| 413 | </thead> |
| 414 | <tbody> |
| 415 | {{range .Tags}} |
| 416 | <tr> |
| 417 | <td><code>{{.Name}}</code> {{if .Protected}}<span class="pill">{{t "vis.protected"}}</span>{{end}}</td> |
| 418 | <td>{{if .SHA}}<a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}"><code>{{.Short}}</code> {{.Subject}}</a>{{end}}</td> |
| 419 | <td>{{.Date}}</td> |
| 420 | <td>{{if .Annotated}}<span class="pill">{{t "tag.annotated"}}</span> {{if .Message}}<span class="tagmsg">{{.Message}}</span>{{end}}{{else}}<span class="muted">{{t "tag.lightweight"}}</span>{{end}}</td> |
| 421 | <td class="acts"> |
| 422 | {{if .HasRelease}}<a href="/{{$.Repo.FullPath}}/-/releases#{{.Name}}">{{t "tag.release"}}</a>{{end}} |
| 423 | <a href="{{.ZipURL}}">{{t "tag.zip"}}</a> |
| 424 | <a href="{{.TarURL}}">{{t "tag.tgz"}}</a> |
| 425 | {{if .CanDelete}}<button type="button" class="ghost" data-tag-open data-tag="{{.Name}}">{{t "tag.delete"}}</button>{{end}} |
| 426 | </td> |
| 427 | </tr> |
| 428 | {{end}} |
| 429 | </tbody> |
| 430 | </table> |
| 431 | </div> |
| 432 | {{else if .Query}}<p class="muted">{{t "tag.noMatch"}}</p>{{else}}<p class="muted">{{t "repo.noTags"}}</p>{{end}} |
| 433 | {{if .CanWrite}} |
| 434 | <dialog class="danger-modal" data-tag-dialog> |
| 435 | <form method="post" action="/{{.Repo.FullPath}}/-/tags/delete"> |
| 436 | <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| 437 | <input type="hidden" name="name" value="" data-tag-name> |
| 438 | <p data-tag-copy data-pattern="{{t "tag.confirm" "%s"}}"></p> |
| 439 | <div class="row"> |
| 440 | <button type="submit" data-tag-submit>{{t "tag.delete"}}</button> |
| 441 | <button type="button" class="ghost" data-tag-cancel>{{t "action.close"}}</button> |
| 442 | </div> |
| 443 | </form> |
| 444 | </dialog> |
| 445 | <script src="/assets/tags.js"></script> |
| 446 | {{end}} |
| 447 | {{template "layout-end" .}} |
| 448 | {{end}} |
| 449 | |
| 450 | {{define "commits"}} |
| 451 | {{template "layout-start" .}} |
| 452 | <header class="pagehead"><h1>{{t "title.commits"}}</h1></header> |
| 453 | <ul class="clean"> |
| 454 | {{range .Commits}}<li class="commitline">{{template "avatar" .}}<div><a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a> <div class="muted"><code>{{.Short}}</code> · {{template "commitwho" .}} · {{.Date}}</div></div></li>{{else}}<li class="muted">{{t "repo.noCommits"}}</li>{{end}} |
| 455 | </ul> |
| 456 | {{template "layout-end" .}} |
| 457 | {{end}} |
| 458 | |