| 1 | {{define "commit.html"}}{{template "base.html" .}}{{end}} |
| 2 | {{define "title"}}{{.Commit.ShortSHA}} — {{.Repo.Name}} — {{.SiteName}}{{end}} |
| 3 | {{define "tabs"}} |
| 4 | <a href="/{{.Repo.Name}}" class="tab">home</a> |
| 5 | <a href="/{{.Repo.Name}}/log/{{.DefaultRef}}" class="tab active">log</a> |
| 6 | <a href="/{{.Repo.Name}}/refs" class="tab">refs</a> |
| 7 | {{end}} |
| 8 | {{define "content"}} |
| 9 | <article class="commit-info"> |
| 10 | <div class="commit-title"> |
| 11 | <span class="subject">{{.Commit.Subject}}</span> |
| 12 | <span class="commit-hash">{{.Commit.ShortSHA}}</span> |
| 13 | </div> |
| 14 | {{if .Commit.Body}}<pre class="body">{{.Commit.Body}}</pre>{{end}} |
| 15 | <div class="commit-subtitle"> |
| 16 | <span class="commit-meta">{{.Commit.Author}} · {{.Commit.When.Format "2006-01-02 15:04"}}</span> |
| 17 | <span class="commit-stats">{{.Stats.Files}} file(s) · <span class="add">+{{.Stats.Added}}</span> <span class="del">−{{.Stats.Removed}}</span></span> |
| 18 | </div> |
| 19 | </article> |
| 20 | |
| 21 | {{range .Files}} |
| 22 | <section class="diff-file"> |
| 23 | <header class="diff-header"> |
| 24 | <span class="name">{{if .From}}{{.From}}{{end}}{{if and .From .To (ne .From .To)}} → {{end}}{{if and .To (ne .From .To)}}{{.To}}{{end}}{{if and .From (not .To)}} (deleted){{end}}{{if and .To (not .From)}} (added){{end}}</span> |
| 25 | <span class="diff-header-stats"><span class="add">+{{.Added}}</span> <span class="del">−{{.Removed}}</span></span> |
| 26 | </header> |
| 27 | {{if .IsBin}} |
| 28 | <p class="empty">Binary file — no preview.</p> |
| 29 | {{else}} |
| 30 | <table class="diff-hunk"> |
| 31 | <tbody> |
| 32 | {{range $hi, $h := .Hunks}} |
| 33 | {{if $hi}}<tr class="diff-sep-row"><td colspan="4"><div class="diff-sep"></div></td></tr>{{end}} |
| 34 | {{range $h.Lines}} |
| 35 | <tr class="diff-{{if eq .Kind "ctx"}}context{{else}}{{.Kind}}{{end}}"> |
| 36 | <td class="diff-num">{{if .OldNum}}{{.OldNum}}{{end}}</td> |
| 37 | <td class="diff-num">{{if .NewNum}}{{.NewNum}}{{end}}</td> |
| 38 | <td class="diff-marker">{{if eq .Kind "add"}}+{{else if eq .Kind "del"}}-{{else}} {{end}}</td> |
| 39 | <td class="diff-code"><pre>{{.Text}}</pre></td> |
| 40 | </tr> |
| 41 | {{end}} |
| 42 | {{end}} |
| 43 | </tbody> |
| 44 | </table> |
| 45 | {{end}} |
| 46 | </section> |
| 47 | {{end}} |
| 48 | {{end}} |