this repo has no description
1{{ define "title" }}commits · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "repoContent" }}
4<section id="commit-table" class="overflow-x-auto">
5 <!-- desktop view (hidden on small screens) -->
6 <table class="w-full border-collapse hidden md:table">
7 <thead>
8 <tr>
9 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th>
10 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th>
11 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Message</th>
12 <th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Date</th>
13 </tr>
14 </thead>
15 <tbody>
16 {{ range $index, $commit := .Commits }}
17 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
18 <tr class="border-b border-gray-200 dark:border-gray-700">
19 <td class="px-4 py-3 align-top">
20 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
21 {{ if $didOrHandle }}
22 <a href="/{{ $didOrHandle }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ $didOrHandle }}</a>
23 {{ else }}
24 <a href="mailto:{{ $commit.Author.Email }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ $commit.Author.Name }}</a>
25 {{ end }}
26 </td>
27 <td class="px-4 py-3 align-top font-mono flex items-end">
28 <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>
29 <div class="inline-flex">
30 <button class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
31 title="Copy SHA"
32 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)">
33 {{ i "copy" "w-4 h-4" }}
34 </button>
35 <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">
36 {{ i "folder-code" "w-4 h-4" }}
37 </a>
38 </div>
39 </td>
40 <td class="px-4 py-3 align-top">
41 <div>
42 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">{{ index $messageParts 0 }}</a>
43 {{ if gt (len $messageParts) 1 }}
44 <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>
45 <p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (index $messageParts 1) }}</p>
46 {{ end }}
47 </div>
48 </td>
49 <td class="px-4 py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Author.When }}</td>
50 </tr>
51 {{ end }}
52 </tbody>
53 </table>
54
55 <!-- mobile view (visible only on small screens) -->
56 <div class="md:hidden">
57 <h2 class="p-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">commits</h2>
58 {{ range $commit := .Commits }}
59 <div class="relative p-2 border-b border-gray-200 dark:border-gray-700">
60 <div id="commit-message">
61 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
62 <div class="text-base cursor-pointer">
63 <div>
64 <div class="flex items-center justify-between">
65 <div class="flex-1">
66 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
67 class="inline no-underline hover:underline dark:text-white">
68 {{ index $messageParts 0 }}
69 </a>
70 {{ if gt (len $messageParts) 1 }}
71 <button
72 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
73 hx-on:click="this.nextElementSibling.classList.toggle('hidden')">
74 {{ i "ellipsis" "w-3 h-3" }}
75 </button>
76 {{ end }}
77 {{ if gt (len $messageParts) 1 }}
78 <p class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300">
79 {{ nl2br (index $messageParts 1) }}
80 </p>
81 {{ end }}
82 </div>
83 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}"
84 class="p-1 mr-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
85 title="Browse repository at this commit">
86 {{ i "folder-code" "w-4 h-4" }}
87 </a>
88 </div>
89 </div>
90 </div>
91 </div>
92
93 <div class="text-xs text-gray-500 dark:text-gray-400">
94 <span class="font-mono">
95 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
96 class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
97 {{ slice $commit.Hash.String 0 8 }}
98 </a>
99 </span>
100 <span class="mx-2 before:content-['·'] before:select-none"></span>
101 <span>
102 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
103 <a href="{{ if $didOrHandle }}/{{ $didOrHandle }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}"
104 class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
105 {{ if $didOrHandle }}{{ $didOrHandle }}{{ else }}{{ $commit.Author.Name }}{{ end }}
106 </a>
107 </span>
108 <div class="inline-block px-1 select-none after:content-['·']"></div>
109 <span>{{ shortTimeFmt $commit.Author.When }}</span>
110 </div>
111 </div>
112 {{ end }}
113 </div>
114</section>
115
116{{ end }}
117
118{{ define "repoAfter" }}
119 {{ $commits_len := len .Commits }}
120 <div class="flex justify-end mt-4 gap-2">
121 {{ 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 }}
122 {{ 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 }}
123 </div>
124{{ end }}