this repo has no description
1{{ define "title" }}commits · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "extrameta" }}
4 {{ $title := printf "commits · %s" .RepoInfo.FullName }}
5 {{ $url := printf "https://tangled.sh/%s/commits" .RepoInfo.FullName }}
6
7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
8{{ end }}
9
10{{ define "repoContent" }}
11 <section id="commit-table" class="overflow-x-auto">
12 <h2 class="font-bold text-sm mb-4 uppercase dark:text-white">commits</h2>
13
14 <!-- desktop view (hidden on small screens) -->
15 <div
16 class="hidden md:flex md:flex-col divide-y divide-gray-200 dark:divide-gray-700">
17 {{ $grid := "grid grid-cols-14 gap-4" }}
18 <div class="{{ $grid }}">
19 <div
20 class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold col-span-2">
21 Author
22 </div>
23 <div
24 class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold col-span-3">
25 Commit
26 </div>
27 <div
28 class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold col-span-6">
29 Message
30 </div>
31 <div
32 class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold col-span-1"></div>
33 <div
34 class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold col-span-2 justify-self-end">
35 Date
36 </div>
37 </div>
38 {{ range $index, $commit := .Commits }}
39 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
40 <div class="{{ $grid }} py-3">
41 <div class="align-top truncate col-span-2">
42 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
43 {{ if $didOrHandle }}
44 {{ template "user/fragments/picHandleLink" $didOrHandle }}
45 {{ else }}
46 <a
47 href="mailto:{{ $commit.Author.Email }}"
48 class="text-gray-700 dark:text-gray-300 no-underline hover:underline">
49 {{ $commit.Author.Name }}
50 </a>
51 {{ end }}
52 </div>
53 <div class="align-top font-mono flex items-start col-span-3">
54 {{ $verified := $.VerifiedCommits.IsVerified $commit.Hash.String }}
55 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }}
56 {{ if $verified }}
57 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }}
58 {{ end }}
59 <a
60 href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
61 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1/2 rounded flex items-center gap-2">
62 {{ slice $commit.Hash.String 0 8 }}
63 {{ if $verified }}
64 {{ i "shield-check" "w-4 h-4" }}
65 {{ end }}
66 </a>
67 <div class="{{ if not $verified }}ml-6{{ end }}inline-flex">
68 <button
69 class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
70 title="Copy SHA"
71 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)">
72 {{ i "copy" "w-4 h-4" }}
73 </button>
74 <a
75 href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}"
76 class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
77 title="Browse repository at this commit">
78 {{ i "folder-code" "w-4 h-4" }}
79 </a>
80 </div>
81 </div>
82 <div class="align-top col-span-6">
83 <div>
84 <a
85 href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
86 class="dark:text-white no-underline hover:underline">
87 {{ index $messageParts 0 }}
88 </a>
89 {{ if gt (len $messageParts) 1 }}
90 <button
91 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 rounded"
92 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">
93 {{ i "ellipsis" "w-3 h-3" }}
94 </button>
95 {{ end }}
96
97 {{ if index $.TagMap $commit.Hash.String }}
98 {{ range $tag := index $.TagMap $commit.Hash.String }}
99 <span
100 class="ml-2 text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 inline-flex items-center">
101 {{ $tag }}
102 </span>
103 {{ end }}
104 {{ end }}
105 </div>
106
107 {{ if gt (len $messageParts) 1 }}
108 <p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">
109 {{ nl2br (index $messageParts 1) }}
110 </p>
111 {{ end }}
112 </div>
113 <div class="align-top col-span-1">
114 <!-- ci status -->
115 {{ $pipeline := index $.Pipelines .Hash.String }}
116 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
117 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }}
118 {{ end }}
119 </div>
120 <div
121 class="align-top justify-self-end text-gray-500 dark:text-gray-400 col-span-2">
122 {{ template "repo/fragments/shortTimeAgo" $commit.Committer.When }}
123 </div>
124 </div>
125 {{ end }}
126 </div>
127
128 <!-- mobile view (visible only on small screens) -->
129 <div class="md:hidden">
130 {{ range $index, $commit := .Commits }}
131 <div
132 class="relative p-2 mb-2 {{ if ne $index (sub (len $.Commits) 1) }}
133 border-b border-gray-200 dark:border-gray-700
134 {{ end }}">
135 <div id="commit-message">
136 {{ $messageParts := splitN $commit.Message "\n\n" 2 }}
137 <div class="text-base cursor-pointer">
138 <div class="flex items-center justify-between">
139 <div class="flex-1">
140 <div>
141 <a
142 href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
143 class="inline no-underline hover:underline dark:text-white">
144 {{ index $messageParts 0 }}
145 </a>
146 {{ if gt (len $messageParts) 1 }}
147 <button
148 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
149 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">
150 {{ i "ellipsis" "w-3 h-3" }}
151 </button>
152 {{ end }}
153
154 {{ if index $.TagMap $commit.Hash.String }}
155 {{ range $tag := index $.TagMap $commit.Hash.String }}
156 <span
157 class="ml-2 text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 inline-flex items-center">
158 {{ $tag }}
159 </span>
160 {{ end }}
161 {{ end }}
162 </div>
163
164 {{ if gt (len $messageParts) 1 }}
165 <p
166 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300">
167 {{ nl2br (index $messageParts 1) }}
168 </p>
169 {{ end }}
170 </div>
171 <a
172 href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}"
173 class="p-1 mr-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"
174 title="Browse repository at this commit">
175 {{ i "folder-code" "w-4 h-4" }}
176 </a>
177 </div>
178 </div>
179 </div>
180
181 <div
182 class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center">
183 {{ $verified := $.VerifiedCommits.IsVerified $commit.Hash.String }}
184 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }}
185 {{ if $verified }}
186 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }}
187 {{ end }}
188 <span class="font-mono">
189 <a
190 href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
191 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1 rounded flex items-center gap-2">
192 {{ slice $commit.Hash.String 0 8 }}
193 {{ if $verified }}
194 {{ i "shield-check" "w-3 h-3" }}
195 {{ end }}
196 </a>
197 </span>
198 <span class="mx-2 before:content-['·'] before:select-none"></span>
199 <span>
200 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
201 <a
202 href="{{ if $didOrHandle }}
203 /{{ $didOrHandle }}
204 {{ else }}
205 mailto:{{ $commit.Author.Email }}
206 {{ end }}"
207 class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
208 {{ if $didOrHandle }}
209 {{ template "user/fragments/picHandleLink" $didOrHandle }}
210 {{ else }}
211 {{ $commit.Author.Name }}
212 {{ end }}
213 </a>
214 </span>
215 <div
216 class="inline-block px-1 select-none after:content-['·']"></div>
217 <span>
218 {{ template "repo/fragments/shortTime" $commit.Committer.When }}
219 </span>
220
221 <!-- ci status -->
222 {{ $pipeline := index $.Pipelines .Hash.String }}
223 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
224 <div
225 class="inline-block px-1 select-none after:content-['·']"></div>
226 <span class="text-sm">
227 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }}
228 </span>
229 {{ end }}
230 </div>
231 </div>
232 {{ end }}
233 </div>
234 </section>
235{{ end }}
236
237{{ define "repoAfter" }}
238 {{ $commits_len := len .Commits }}
239 <div class="flex justify-end mt-4 gap-2">
240 {{ if gt .Page 1 }}
241 <a
242 class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700"
243 hx-boost="true"
244 onclick="window.location.href = window.location.pathname + '?page={{ sub .Page 1 }}'">
245 {{ i "chevron-left" "w-4 h-4" }} previous
246 </a>
247 {{ else }}
248 <div></div>
249 {{ end }}
250 {{ if eq $commits_len 60 }}
251 <a
252 class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700"
253 hx-boost="true"
254 onclick="window.location.href = window.location.pathname + '?page={{ add .Page 1 }}'">
255 next
256 {{ i "chevron-right" "w-4 h-4" }}
257 </a>
258 {{ end }}
259 </div>
260{{ end }}