forked from tangled.org/core
Monorepo for Tangled

appview: repo/index: optimize for mobile

Changed files
+51 -46
appview
pages
templates
repo
+51 -46
appview/pages/templates/repo/index.html
··· 29 29 30 30 {{ define "repoContent" }} 31 31 <main> 32 - {{ block "branchSelector" . }}{{ end }} 32 + <div class="flex items-center justify-between pb-5"> 33 + {{ block "branchSelector" . }}{{ end }} 34 + <div class="flex md:hidden items-center gap-4"> 35 + <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1"> 36 + {{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }} 37 + </a> 38 + <a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1"> 39 + {{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }} 40 + </a> 41 + <a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1"> 42 + {{ i "tags" "w-4" "h-4" }} {{ len .Tags }} 43 + </a> 44 + </div> 45 + </div> 33 46 <div class="grid grid-cols-1 md:grid-cols-2 gap-2"> 34 47 {{ block "fileTree" . }}{{ end }} 35 48 {{ block "rightInfo" . }}{{ end }} ··· 38 51 {{ end }} 39 52 40 53 {{ define "branchSelector" }} 41 - <div class="flex justify-between pb-5"> 42 - <select 43 - onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)" 44 - class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700" 45 - > 46 - <optgroup label="branches ({{len .Branches}})" class="bold text-sm"> 47 - {{ range .Branches }} 48 - <option 49 - value="{{ .Reference.Name }}" 50 - class="py-1" 51 - {{ if eq .Reference.Name $.Ref }} 52 - selected 53 - {{ end }} 54 - > 55 - {{ .Reference.Name }} 56 - </option> 57 - {{ end }} 58 - </optgroup> 59 - <optgroup label="tags ({{len .Tags}})" class="bold text-sm"> 60 - {{ range .Tags }} 61 - <option 62 - value="{{ .Reference.Name }}" 63 - class="py-1" 64 - {{ if eq .Reference.Name $.Ref }} 65 - selected 66 - {{ end }} 67 - > 68 - {{ .Reference.Name }} 69 - </option> 70 - {{ else }} 71 - <option class="py-1" disabled>no tags found</option> 72 - {{ end }} 73 - </optgroup> 74 - </select> 75 - </div> 54 + <select 55 + onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)" 56 + class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700" 57 + > 58 + <optgroup label="branches ({{len .Branches}})" class="bold text-sm"> 59 + {{ range .Branches }} 60 + <option 61 + value="{{ .Reference.Name }}" 62 + class="py-1" 63 + {{ if eq .Reference.Name $.Ref }} 64 + selected 65 + {{ end }} 66 + > 67 + {{ .Reference.Name }} 68 + </option> 69 + {{ end }} 70 + </optgroup> 71 + <optgroup label="tags ({{len .Tags}})" class="bold text-sm"> 72 + {{ range .Tags }} 73 + <option 74 + value="{{ .Reference.Name }}" 75 + class="py-1" 76 + {{ if eq .Reference.Name $.Ref }} 77 + selected 78 + {{ end }} 79 + > 80 + {{ .Reference.Name }} 81 + </option> 82 + {{ else }} 83 + <option class="py-1" disabled>no tags found</option> 84 + {{ end }} 85 + </optgroup> 86 + </select> 76 87 {{ end }} 77 88 78 89 {{ define "fileTree" }} ··· 129 140 {{ end }} 130 141 131 142 {{ define "rightInfo" }} 132 - <div id="right-info" class="col-span-1"> 143 + <div id="right-info" class="hidden md:block col-span-1"> 133 144 {{ block "commitLog" . }} {{ end }} 134 145 {{ block "branchList" . }} {{ end }} 135 146 {{ block "tagList" . }} {{ end }} ··· 143 154 <div class="flex gap-2 items-center"> 144 155 {{ i "git-commit-horizontal" "w-4 h-4" }} commits 145 156 </div> 146 - {{ if lt (len .CommitsTrunc) .TotalCommits }} 147 - <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 148 - view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }} 149 - </span> 150 - {{ end }} 157 + <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 158 + view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }} 159 + </span> 151 160 </a> 152 161 </div> 153 162 <div class="flex flex-col gap-6"> ··· 243 252 <!-- git-branch icon is seemingly bigger than others at 4x4 --> 244 253 {{ i "git-branch" "w-3 h-3" }} branches 245 254 </div> 246 - {{ if lt (len .BranchesTrunc) (len .Branches) }} 247 255 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 248 256 view {{ len .Branches }} branches {{ i "chevron-right" "w-4 h-4" }} 249 257 </span> 250 - {{ end }} 251 258 </a> 252 259 <div class="flex flex-col gap-1"> 253 260 {{ range .BranchesTrunc }} ··· 279 286 <div class="flex gap-2 items-center"> 280 287 {{ i "tags" "w-4 h-4" }} tags 281 288 </div> 282 - {{ if lt (len .TagsTrunc) (len .Tags) }} 283 289 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 "> 284 290 view {{ len .Tags }} tags {{ i "chevron-right" "w-4 h-4" }} 285 291 </span> 286 - {{ end }} 287 292 </a> 288 293 </div> 289 294 <div class="flex flex-col gap-1">