this repo has no description
1{{ define "title" }}commits · {{ .RepoInfo.FullName }}{{ end }}
2{{ define "repoContent" }}
3<section id="commit-table">
4 <table class="w-full border-collapse">
5 <thead class="bg-gray-100 dark:bg-gray-700">
6 <tr>
7 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th>
8 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th>
9 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Message</th>
10 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Date</th>
11 </tr>
12 </thead>
13 <tbody>
14 {{ range $index, $commit := .Commits }}
15 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
16 <tr class="border-b border-gray-200 dark:border-gray-700">
17 <td class="px-4 py-3 align-top">
18 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
19 {{ if $didOrHandle }}
20 <a href="/{{ $didOrHandle }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ $didOrHandle }}</a>
21 {{ else }}
22 <a href="mailto:{{ $commit.Author.Email }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ $commit.Author.Name }}</a>
23 {{ end }}
24 </td>
25 <td class="px-4 py-3 align-top font-mono flex items-end">
26 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ slice $commit.Hash.String 0 8 }}</a>
27 <div class="inline-flex">
28 <button class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
29 title="Copy SHA"
30 onclick="navigator.clipboard.writeText('{{ $commit.Hash.String }}'); this.innerHTML=`{{ i "copy-check" "w-4 h-4" }}`; setTimeout(() => this.innerHTML=`{{ i "copy" "w-4 h-4" }}`, 1500)">
31 {{ i "copy" "w-4 h-4" }}
32 </button>
33 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}" class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" title="Browse repository at this commit">
34 {{ i "folder-code" "w-4 h-4" }}
35 </a>
36 </div>
37 </td>
38 <td class="px-4 py-3 align-top">
39 {{ if eq $index 0 }}
40 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">
41 <p>{{ index $messageParts 0 }}</p>
42 {{ if gt (len $messageParts) 1 }}<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (unwrapText (index $messageParts 1)) }}</p>{{ end }}
43 </a>
44 {{ else }}
45 <div>
46 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">{{ index $messageParts 0 }}</a>
47 {{ if gt (len $messageParts) 1 }}
48 <button class="ml-2 py-1/2 px-1 bg-gray-200 hover:bg-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 rounded" hx-on:click="this.nextElementSibling.classList.toggle('hidden')">{{ i "ellipsis" "w-3 h-3" }}</button>
49 <p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (index $messageParts 1) }}</p>
50 {{ end }}
51 </div>
52 {{ end }}
53 </td>
54 <td class="px-4 py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Author.When }}</td>
55 </tr>
56 {{ end }}
57 </tbody>
58 </table>
59</section>
60
61 {{ $commits_len := len .Commits }}
62 <div class="flex justify-end mt-4 gap-2">
63 {{ if gt .Page 1 }}<a class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700" hx-boost="true" onclick="window.location.href = window.location.pathname + '?page={{ sub .Page 1 }}'">{{ i "chevron-left" "w-4 h-4" }} previous</a>{{ else }}<div></div>{{ end }}
64 {{ if eq $commits_len 60 }}<a class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700" hx-boost="true" onclick="window.location.href = window.location.pathname + '?page={{ add .Page 1 }}'">next {{ i "chevron-right" "w-4 h-4" }}</a>{{ end }}
65 </div>
66{{ end }}