forked from tangled.org/core
this repo has no description

appview: repo/log: minor UI tweaks

Changed files
+17 -21
appview
pages
templates
repo
+17 -21
appview/pages/templates/repo/log.html
···
{{ define "title" }}commits · {{ .RepoInfo.FullName }}{{ end }}
{{ define "repoContent" }}
<section id="commit-table" class="overflow-x-auto">
<!-- desktop view (hidden on small screens) -->
<table class="w-full border-collapse hidden md:table">
-
<thead class="bg-gray-100 dark:bg-gray-700">
<tr>
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th>
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th>
···
</div>
</td>
<td class="px-4 py-3 align-top">
-
{{ if eq $index 0 }}
-
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">
-
<p>{{ index $messageParts 0 }}</p>
-
{{ 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 }}
-
</a>
-
{{ else }}
-
<div>
-
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">{{ index $messageParts 0 }}</a>
-
{{ if gt (len $messageParts) 1 }}
-
<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>
-
<p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (index $messageParts 1) }}</p>
-
{{ end }}
-
</div>
-
{{ end }}
</td>
<td class="px-4 py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Author.When }}</td>
</tr>
···
{{ i "folder-code" "w-4 h-4" }}
</a>
</div>
-
</div>
</div>
</div>
···
</div>
</section>
-
{{ $commits_len := len .Commits }}
-
<div class="flex justify-end mt-4 gap-2">
-
{{ 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 }}
-
{{ 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 }}
-
</div>
{{ end }}
···
{{ define "title" }}commits &middot; {{ .RepoInfo.FullName }}{{ end }}
+
{{ define "repoContent" }}
<section id="commit-table" class="overflow-x-auto">
<!-- desktop view (hidden on small screens) -->
<table class="w-full border-collapse hidden md:table">
+
<thead>
<tr>
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th>
<th class="px-4 py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th>
···
</div>
</td>
<td class="px-4 py-3 align-top">
+
<div>
+
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">{{ index $messageParts 0 }}</a>
+
{{ if gt (len $messageParts) 1 }}
+
<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>
+
<p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (index $messageParts 1) }}</p>
+
{{ end }}
+
</div>
</td>
<td class="px-4 py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Author.When }}</td>
</tr>
···
{{ i "folder-code" "w-4 h-4" }}
</a>
</div>
</div>
</div>
</div>
···
</div>
</section>
+
{{ end }}
+
+
{{ define "repoAfter" }}
+
{{ $commits_len := len .Commits }}
+
<div class="flex justify-end mt-4 gap-2">
+
{{ 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 }}
+
{{ 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 }}
+
</div>
{{ end }}