Monorepo for Tangled

appview/pages: fix shrinking buttons in repo header

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

+80 -64
+80 -64
appview/pages/templates/layouts/repobase.html
··· 2 2 3 3 {{ define "content" }} 4 4 <section id="repo-header" class="mb-2 py-2 px-4 dark:text-white"> 5 - <div class="text-lg flex flex-col sm:flex-row items-start gap-4 justify-between"> 6 - <!-- left items --> 5 + <div class="flex flex-col sm:flex-row items-start gap-4 justify-between mb-2"> 7 6 <div class="flex flex-col gap-2"> 8 - <!-- repo owner / repo name --> 9 - <div class="flex items-center gap-2 flex-wrap"> 10 - {{ template "user/fragments/picHandleLink" .RepoInfo.OwnerDid }} 11 - <span class="select-none">/</span> 12 - <a href="/{{ .RepoInfo.FullName }}" class="font-bold">{{ .RepoInfo.Name }}</a> 13 - </div> 14 - 15 - {{ if .RepoInfo.Source }} 16 - {{ $sourceOwner := resolve .RepoInfo.Source.Did }} 17 - <div class="flex items-center gap-1 text-sm flex-wrap"> 18 - {{ i "git-fork" "w-3 h-3 shrink-0" }} 19 - <span>forked from</span> 20 - <a class="underline" href="/{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}"> 21 - {{ $sourceOwner }}/{{ .RepoInfo.Source.Name }} 22 - </a> 23 - </div> 24 - {{ end }} 25 - 26 - <span class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-600 dark:text-gray-300"> 27 - {{ if .RepoInfo.Description }} 28 - {{ .RepoInfo.Description | description }} 29 - {{ else }} 30 - <span class="italic">this repo has no description</span> 31 - {{ end }} 32 - 33 - {{ with .RepoInfo.Website }} 34 - <span class="flex items-center gap-1"> 35 - <span class="flex-shrink-0">{{ i "globe" "size-4" }}</span> 36 - <a href="{{ . }}">{{ . | trimUriScheme }}</a> 37 - </span> 38 - {{ end }} 39 - 40 - {{ if .RepoInfo.Topics }} 41 - <div class="flex items-center gap-1 text-sm text-gray-600 dark:text-gray-300"> 42 - {{ range .RepoInfo.Topics }} 43 - <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm">{{ . }}</span> 44 - {{ end }} 45 - </div> 46 - {{ end }} 47 - 48 - </span> 7 + {{ template "repoOwnerAndName" . }} 8 + {{ template "repoForkInfo" . }} 49 9 </div> 50 - 51 - <div class="w-full sm:w-fit grid grid-cols-3 gap-2 z-auto"> 52 - {{ template "fragments/starBtn" 53 - (dict "SubjectAt" .RepoInfo.RepoAt 54 - "IsStarred" .RepoInfo.IsStarred 55 - "StarCount" .RepoInfo.Stats.StarCount) }} 56 - <a 57 - class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 58 - hx-boost="true" 59 - href="/{{ .RepoInfo.FullName }}/fork" 60 - > 61 - {{ i "git-fork" "w-4 h-4" }} 62 - fork 63 - {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 64 - </a> 65 - <a 66 - class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 67 - href="/{{ .RepoInfo.FullName }}/feed.atom"> 68 - {{ i "rss" "size-4" }} 69 - <span class="md:hidden">atom</span> 70 - </a> 10 + <div class="hidden sm:block sm:flex-shrink-0"> 11 + {{ template "repoActions" . }} 71 12 </div> 72 13 </div> 14 + {{ template "repoMetadata" . }} 15 + 16 + <div class="block sm:hidden mt-4"> 17 + {{ template "repoActions" . }} 18 + </div> 73 19 </section> 74 20 75 21 <section class="w-full flex flex-col" > ··· 117 63 {{ end }} 118 64 </section> 119 65 {{ end }} 66 + 67 + {{ define "repoOwnerAndName" }} 68 + <div class="flex items-center gap-2 flex-wrap text-lg"> 69 + {{ template "user/fragments/picHandleLink" .RepoInfo.OwnerDid }} 70 + <span class="select-none">/</span> 71 + <a href="/{{ .RepoInfo.FullName }}" class="font-bold">{{ .RepoInfo.Name }}</a> 72 + </div> 73 + {{ end }} 74 + 75 + {{ define "repoForkInfo" }} 76 + {{ if .RepoInfo.Source }} 77 + {{ $sourceOwner := resolve .RepoInfo.Source.Did }} 78 + <div class="flex items-center gap-1 text-sm text-gray-600 dark:text-gray-300 mb-2 flex-wrap"> 79 + {{ i "git-fork" "w-3 h-3 shrink-0" }} 80 + <span>forked from</span> 81 + <a class="underline" href="/{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}"> 82 + {{ $sourceOwner }}/{{ .RepoInfo.Source.Name }} 83 + </a> 84 + </div> 85 + {{ end }} 86 + {{ end }} 87 + 88 + {{ define "repoMetadata" }} 89 + <div class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-600 dark:text-gray-300"> 90 + {{ if .RepoInfo.Description }} 91 + {{ .RepoInfo.Description | description }} 92 + {{ else }} 93 + <span class="italic">this repo has no description</span> 94 + {{ end }} 95 + 96 + {{ with .RepoInfo.Website }} 97 + <span class="flex items-center gap-1"> 98 + <span class="flex-shrink-0">{{ i "globe" "size-4" }}</span> 99 + <a href="{{ . }}">{{ . | trimUriScheme }}</a> 100 + </span> 101 + {{ end }} 102 + 103 + {{ if .RepoInfo.Topics }} 104 + <div class="flex items-center gap-1"> 105 + {{ range .RepoInfo.Topics }} 106 + <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm">{{ . }}</span> 107 + {{ end }} 108 + </div> 109 + {{ end }} 110 + </div> 111 + {{ end }} 112 + 113 + {{ define "repoActions" }} 114 + <div class="w-full sm:w-fit grid grid-cols-3 gap-2 z-auto"> 115 + {{ template "fragments/starBtn" 116 + (dict "SubjectAt" .RepoInfo.RepoAt 117 + "IsStarred" .RepoInfo.IsStarred 118 + "StarCount" .RepoInfo.Stats.StarCount) }} 119 + <a 120 + class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 121 + hx-boost="true" 122 + href="/{{ .RepoInfo.FullName }}/fork" 123 + > 124 + {{ i "git-fork" "w-4 h-4" }} 125 + fork 126 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 127 + </a> 128 + <a 129 + class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 130 + href="/{{ .RepoInfo.FullName }}/feed.atom"> 131 + {{ i "rss" "size-4" }} 132 + <span class="md:hidden">atom</span> 133 + </a> 134 + </div> 135 + {{ end }}