commit.html

 1{{define "content"}}
 2<nav aria-label="breadcrumb">
 3  <ul>
 4    <li><a href="/{{.Repo.Name}}">{{.Repo.Name}}</a></li>
 5    <li aria-current="page">{{.Commit.ID | shortHash}}</li>
 6  </ul>
 7</nav>
 8
 9<header>
10  <hgroup>
11    <h2 id="commit-heading">{{.Commit.Message | commitSubject}}</h2>
12    <p><strong>{{.Commit.Author.Name}}</strong> created <time datetime="{{.Commit.Author.When | rfc3339}}" data-tooltip="{{.Commit.Author.When | formatDate}}">{{.Commit.Author.When | relativeTime}}</time></p>
13  </hgroup>
14  {{$body := .Commit.Message | commitBody}}
15  {{if $body}}
16  <pre><code>{{$body}}</code></pre>
17  {{end}}
18  
19  <nav aria-label="Commit actions">
20    <ul>
21      <li><a href="/{{.Repo.Name}}/tree/{{.Commit.ID}}">Browse file tree</a></li>
22    </ul>
23  </nav>
24</header>
25
26<section aria-labelledby="changes-heading">
27  <h3 id="changes-heading">Change summary</h3>
28  <pre aria-label="Diff statistics"><code>{{.Diff.Stats}}</code></pre>
29</section>
30
31<section aria-labelledby="diff-heading">
32  <h3 id="diff-heading">Detailed changes</h3>
33  {{range .Diff.Files}}
34  <article aria-labelledby="file-{{.Name}}">
35    <h4 id="file-{{.Name}}">
36      {{if ne .OldName .Name}}
37        {{.OldName}} → <a href="/{{$.Repo.Name}}/blob/{{$.Commit.ID}}/{{.Name}}">{{.Name}}</a>
38      {{else}}
39        <a href="/{{$.Repo.Name}}/blob/{{$.Commit.ID}}/{{.Name}}">{{.Name}}</a>
40      {{end}}
41      <small><a href="#file-{{.Name}}" class="secondary" title="Link to heading for {{.Name}}">🔗</a></small>
42    </h4>
43    <pre aria-label="Diff for {{.Name}}"><code>{{range .Sections}}{{range .Lines}}{{if eq .Type 2}}<ins>{{.Content}}</ins>{{else if eq .Type 3}}<del>{{.Content}}</del>{{else}}{{.Content}}{{end}}
44{{end}}{{end}}</code></pre>
45  </article>
46  {{end}}
47</section>
48{{end}}