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

appview/pages: fix clone-instructions in mobile

and fix empty-repo rendering.

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 3ee002a1 801c1427

verified
Changed files
+10 -13
appview
pages
templates
-4
appview/pages/templates/repo/empty.html
···
{{ end }}
</main>
{{ end }}
-
-
{{ define "repoAfter" }}
-
{{ template "repo/fragments/cloneInstructions" . }}
-
{{ end }}
+3 -3
appview/pages/templates/repo/fragments/cloneDropdown.html
···
<details id="clone-dropdown" class="relative inline-block text-left group">
<summary class="btn-create cursor-pointer list-none flex items-center gap-2">
{{ i "download" "w-4 h-4" }}
-
<span>code</span>
+
<span class="hidden md:inline">code</span>
<span class="group-open:hidden">
{{ i "chevron-down" "w-4 h-4" }}
</span>
···
</span>
</summary>
-
<div class="absolute right-0 mt-2 w-96 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 drop-shadow dark:text-white z-[9999]">
+
<div class="absolute right-0 mt-2 w-96 bg-white dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 drop-shadow-sm dark:text-white z-[9999]">
<div class="p-4">
<div class="mb-3">
<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-2">Clone this repository</h3>
···
function copyToClipboard(button, text) {
navigator.clipboard.writeText(text).then(() => {
const originalContent = button.innerHTML;
-
button.innerHTML = `{{ i "copy-check" "w-4 h-4" }}`;
+
button.innerHTML = `{{ i "check" "w-4 h-4" }}`;
setTimeout(() => {
button.innerHTML = originalContent;
}, 2000);
+7 -6
appview/pages/templates/repo/index.html
···
{{ end }}
<div class="flex items-center justify-between pb-5">
{{ block "branchSelector" . }}{{ end }}
-
<div class="flex md:hidden items-center gap-4">
-
<a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1">
+
<div class="flex md:hidden items-center gap-2">
+
<a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1 font-bold">
{{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }}
</a>
-
<a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1">
+
<a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1 font-bold">
{{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }}
</a>
-
<a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1">
+
<a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1 font-bold">
{{ i "tags" "w-4" "h-4" }} {{ len .Tags }}
</a>
+
{{ template "repo/fragments/cloneDropdown" . }}
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
···
</a>
</div>
</div>
-
+
<!-- Clone dropdown in top right -->
-
<div class="flex items-center">
+
<div class="hidden md:flex items-center ">
{{ template "repo/fragments/cloneDropdown" . }}
</div>
</div>