Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2

appview/pages: fix shrinking buttons in repo header

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

oppi.li eb3e2719 0ab3af52

verified
+80 -64
+80 -64
appview/pages/templates/layouts/repobase.html
··· 2 3 {{ define "content" }} 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 --> 7 <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> 49 </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> 71 </div> 72 </div> 73 </section> 74 ··· 62 {{ block "repoAfter" . }}{{ end }} 63 {{ end }} 64 </section> 65 {{ end }}
··· 2 3 {{ define "content" }} 4 <section id="repo-header" class="mb-2 py-2 px-4 dark:text-white"> 5 + <div class="flex flex-col sm:flex-row items-start gap-4 justify-between mb-2"> 6 <div class="flex flex-col gap-2"> 7 + {{ template "repoOwnerAndName" . }} 8 + {{ template "repoForkInfo" . }} 9 </div> 10 + <div class="hidden sm:block sm:flex-shrink-0"> 11 + {{ template "repoActions" . }} 12 </div> 13 + </div> 14 + {{ template "repoMetadata" . }} 15 + 16 + <div class="block sm:hidden mt-4"> 17 + {{ template "repoActions" . }} 18 </div> 19 </section> 20 ··· 116 {{ block "repoAfter" . }}{{ end }} 117 {{ end }} 118 </section> 119 + {{ end }} 120 + 121 + {{ define "repoOwnerAndName" }} 122 + <div class="flex items-center gap-2 flex-wrap text-lg"> 123 + {{ template "user/fragments/picHandleLink" .RepoInfo.OwnerDid }} 124 + <span class="select-none">/</span> 125 + <a href="/{{ .RepoInfo.FullName }}" class="font-bold">{{ .RepoInfo.Name }}</a> 126 + </div> 127 + {{ end }} 128 + 129 + {{ define "repoForkInfo" }} 130 + {{ if .RepoInfo.Source }} 131 + {{ $sourceOwner := resolve .RepoInfo.Source.Did }} 132 + <div class="flex items-center gap-1 text-sm text-gray-600 dark:text-gray-300 mb-2 flex-wrap"> 133 + {{ i "git-fork" "w-3 h-3 shrink-0" }} 134 + <span>forked from</span> 135 + <a class="underline" href="/{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}"> 136 + {{ $sourceOwner }}/{{ .RepoInfo.Source.Name }} 137 + </a> 138 + </div> 139 + {{ end }} 140 + {{ end }} 141 + 142 + {{ define "repoMetadata" }} 143 + <div class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-600 dark:text-gray-300"> 144 + {{ if .RepoInfo.Description }} 145 + {{ .RepoInfo.Description | description }} 146 + {{ else }} 147 + <span class="italic">this repo has no description</span> 148 + {{ end }} 149 + 150 + {{ with .RepoInfo.Website }} 151 + <span class="flex items-center gap-1"> 152 + <span class="flex-shrink-0">{{ i "globe" "size-4" }}</span> 153 + <a href="{{ . }}">{{ . | trimUriScheme }}</a> 154 + </span> 155 + {{ end }} 156 + 157 + {{ if .RepoInfo.Topics }} 158 + <div class="flex items-center gap-1"> 159 + {{ range .RepoInfo.Topics }} 160 + <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm">{{ . }}</span> 161 + {{ end }} 162 + </div> 163 + {{ end }} 164 + </div> 165 + {{ end }} 166 + 167 + {{ define "repoActions" }} 168 + <div class="w-full sm:w-fit grid grid-cols-3 gap-2 z-auto"> 169 + {{ template "fragments/starBtn" 170 + (dict "SubjectAt" .RepoInfo.RepoAt 171 + "IsStarred" .RepoInfo.IsStarred 172 + "StarCount" .RepoInfo.Stats.StarCount) }} 173 + <a 174 + class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 175 + hx-boost="true" 176 + href="/{{ .RepoInfo.FullName }}/fork" 177 + > 178 + {{ i "git-fork" "w-4 h-4" }} 179 + fork 180 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 181 + </a> 182 + <a 183 + class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 184 + href="/{{ .RepoInfo.FullName }}/feed.atom"> 185 + {{ i "rss" "size-4" }} 186 + <span class="md:hidden">atom</span> 187 + </a> 188 + </div> 189 {{ end }}