Migration This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs. Contact me

templates/views/commit.html

c0427d5fc7c0fcf8606c546071085e8af231fb81 · 1.3 KB · 42 lines raw

1 {{ define "commit.html" }}{{ template "base" . }}{{ end }}
2 {{ define "styles" }}
3 <link rel="stylesheet" href="/static/css/diff.css">
4 <link rel="stylesheet" href="/static/css/readme.css">
5 {{ end }}
6 {{ define "main" }}
7 {{ $slug := print "/" .Info.Slug }}
8 {{ $c := mod "commit" }}
9 {{ $d := mod "diff" }}
10
11 <header class="hero">
12 <div class="hero-inner">
13 <h1 class="page-title">{{ $c.Subject }}</h1>
14 <p class="page-subtitle">
15 <code style="color:var(--accent);">{{ trunc 12 $c.SHA }}</code>
16 <span class="text-muted">&middot; {{ $c.Author }} &middot; <time datetime="{{ rfc3339 $c.When }}">{{ date $c.When }}</time></span>
17 </p>
18 </div>
19 </header>
20
21 {{ with $c.Body }}
22 <div class="readme"><pre style="white-space:pre-wrap;margin:0;">{{ . }}</pre></div>
23 {{ end }}
24
25 {{ with $c.Parents }}
26 <div class="chips" style="margin-bottom:1rem;">
27 {{ range . }}
28 <a class="chip" href="{{ $slug }}/commit/{{ . }}">parent {{ trunc 12 . }}</a>
29 <a class="chip" href="{{ $slug }}/compare/{{ . }}..{{ $c.SHA }}">diff</a>
30 {{ end }}
31 </div>
32 {{ end }}
33
34 <article class="card">
35 <header class="page-head">
36 <h2 class="page-subtitle">Changed files</h2>
37 </header>
38 {{ template "diffstat" (dict "Base" $slug "Ref" $c.SHA "Diff" $d) }}
39 </article>
40
41 {{ with $d.Patch }}<div class="diff">{{ patch . }}</div>{{ end }}
42 {{ end }}