this repo has no description
1{{ define "title" }} commit {{ .Diff.Commit.This }} · {{ .RepoInfo.FullName }} {{ end }}
2
3{{ define "repoContent" }}
4
5{{ $repo := .RepoInfo.FullName }}
6{{ $commit := .Diff.Commit }}
7{{ $stat := .Diff.Stat }}
8{{ $diff := .Diff.Diff }}
9
10<section class="commit">
11 <div id="commit-message">
12 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
13 <div>
14 <p class="pb-2">{{ index $messageParts 0 }}</p>
15 {{ if gt (len $messageParts) 1 }}
16 <p class="mt-1 cursor-text pb-2 text-sm">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>
17 {{ end }}
18 </div>
19 </div>
20
21 <div class="flex items-center">
22 <p class="text-sm text-gray-500">
23 {{ if index .EmailToDidOrHandle $commit.Author.Email }}
24 {{ $handle := index .EmailToDidOrHandle $commit.Author.Email }}
25 <a href="/@{{ $handle }}" class="no-underline hover:underline text-gray-500">@{{ $handle }}</a>
26 {{ else }}
27 <a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500">{{ $commit.Author.Name }}</a>
28 {{ end }}
29 <span class="px-1 select-none before:content-['\00B7']"></span>
30 {{ timeFmt $commit.Author.When }}
31 <span class="px-1 select-none before:content-['\00B7']"></span>
32 <span>{{ $stat.FilesChanged }}</span> files <span class="font-mono">(+{{ $stat.Insertions }}, -{{ $stat.Deletions }})</span>
33 <span class="px-1 select-none before:content-['\00B7']"></span>
34 </p>
35
36 <p class="flex items-center text-sm text-gray-500">
37 <a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.This 0 8 }}</a>
38 {{ if $commit.Parent }}
39 <i class="w-3 h-3 mx-1" data-lucide="arrow-left"></i>
40 <a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.Parent 0 8 }}</a>
41 {{ end }}
42 </p>
43 </div>
44
45 <div class="diff-stat">
46 <br>
47 <strong class="text-sm uppercase mb-4">Changed files</strong>
48 {{ range $diff }}
49 <ul>
50 {{ if .IsDelete }}
51 <li><a href="#file-{{ .Name.Old }}">{{ .Name.Old }}</a></li>
52 {{ else }}
53 <li><a href="#file-{{ .Name.New }}">{{ .Name.New }}</a></li>
54 {{ end }}
55 </ul>
56 {{ end }}
57 </div>
58</section>
59
60{{end}}
61
62{{ define "repoAfter" }}
63{{ template "fragments/diff" (list .RepoInfo.FullName .Diff) }}
64{{end}}