Migration
This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs.
Contact me
templates/views/compare.html
cb5a7c7c656de5a381e0234208c552c0856e43e3
· 1.7 KB · 51 lines
raw
| 1 | {{ define "compare.html" }}{{ template "base" . }}{{ end }} |
| 2 | {{ define "styles" }}<link rel="stylesheet" href="/static/css/diff.css">{{ end }} |
| 3 | {{ define "main" }} |
| 4 | {{ $slug := print "/" .Info.Slug }} |
| 5 | {{ $c := mod "compare" }} |
| 6 | |
| 7 | <header class="hero"> |
| 8 | <div class="hero-inner"> |
| 9 | <h1 class="page-title">Compare</h1> |
| 10 | <p class="page-subtitle"> |
| 11 | <code style="color:var(--accent);">{{ $c.Base }}</code> |
| 12 | {{ if $c.ThreeDot }}…{{ else }}..{{ end }} |
| 13 | <code style="color:var(--accent);">{{ $c.Head }}</code> |
| 14 | <span class="text-muted">· {{ len $c.Commits }} commits</span> |
| 15 | </p> |
| 16 | </div> |
| 17 | </header> |
| 18 | |
| 19 | <div class="facts-bar"> |
| 20 | <div class="fact"> |
| 21 | <span class="fact-label">base</span> |
| 22 | <span class="fact-value"><a href="{{ $slug }}/commit/{{ $c.BaseSHA }}"><code>{{ trunc 12 $c.BaseSHA }}</code></a></span> |
| 23 | </div> |
| 24 | <div class="fact"> |
| 25 | <span class="fact-label">head</span> |
| 26 | <span class="fact-value"><a href="{{ $slug }}/commit/{{ $c.HeadSHA }}"><code>{{ trunc 12 $c.HeadSHA }}</code></a></span> |
| 27 | </div> |
| 28 | {{ with $c.MergeBase }} |
| 29 | <div class="fact"> |
| 30 | <span class="fact-label">merge base</span> |
| 31 | <span class="fact-value"><code>{{ trunc 12 . }}</code></span> |
| 32 | </div> |
| 33 | {{ end }} |
| 34 | </div> |
| 35 | |
| 36 | <article class="card"> |
| 37 | <header class="page-head"> |
| 38 | <h2 class="page-subtitle">Changed files</h2> |
| 39 | </header> |
| 40 | {{ template "diffstat" (dict "Base" $slug "Ref" $c.HeadSHA "Diff" $c.Diff) }} |
| 41 | </article> |
| 42 | |
| 43 | {{ with $c.Commits }} |
| 44 | <article class="card"> |
| 45 | <header class="page-head"><h2 class="page-subtitle">Commits</h2></header> |
| 46 | {{ template "commit-table" (dict "Base" $slug "Commits" .) }} |
| 47 | </article> |
| 48 | {{ end }} |
| 49 | |
| 50 | {{ with $c.Diff.Patch }}<div class="diff">{{ patch . }}</div>{{ end }} |
| 51 | {{ end }} |