+17
-21
appview/pages/templates/repo/log.html
+17
-21
appview/pages/templates/repo/log.html
···
1
1
{{ define "title" }}commits · {{ .RepoInfo.FullName }}{{ end }}
2
+
2
3
{{ define "repoContent" }}
3
4
<section id="commit-table" class="overflow-x-auto">
4
5
<!-- desktop view (hidden on small screens) -->
5
6
<table class="w-full border-collapse hidden md:table">
6
-
<thead class="bg-gray-100 dark:bg-gray-700">
7
+
<thead>
7
8
<tr>
8
9
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th>
9
10
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th>
···
37
38
</div>
38
39
</td>
39
40
<td class="px-4 py-3 align-top">
40
-
{{ if eq $index 0 }}
41
-
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">
42
-
<p>{{ index $messageParts 0 }}</p>
43
-
{{ 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 }}
44
-
</a>
45
-
{{ else }}
46
-
<div>
47
-
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">{{ index $messageParts 0 }}</a>
48
-
{{ if gt (len $messageParts) 1 }}
49
-
<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>
50
-
<p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (index $messageParts 1) }}</p>
51
-
{{ end }}
52
-
</div>
53
-
{{ end }}
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>
54
48
</td>
55
49
<td class="px-4 py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Author.When }}</td>
56
50
</tr>
···
92
86
{{ i "folder-code" "w-4 h-4" }}
93
87
</a>
94
88
</div>
95
-
96
89
</div>
97
90
</div>
98
91
</div>
···
120
113
</div>
121
114
</section>
122
115
123
-
{{ $commits_len := len .Commits }}
124
-
<div class="flex justify-end mt-4 gap-2">
125
-
{{ 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 }}
126
-
{{ 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 }}
127
-
</div>
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>
128
124
{{ end }}