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