Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: use tabselectors to toggle issue/pull states

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

authored by

oppiliappan and committed by
Tangled
d892af88 0a57ea45

+101 -55
+12 -4
appview/pages/templates/fragments/tabSelector.html
··· 6 6 {{ $activeTab := "bg-white dark:bg-gray-700 shadow-sm" }} 7 7 {{ $inactiveTab := "bg-gray-100 dark:bg-gray-800 shadow-inner" }} 8 8 {{ range $index, $value := $all }} 9 - {{ $isActive := eq $value $active }} 10 - <a href="?{{ $name }}={{ $value }}" 11 - class="py-2 text-sm w-full block hover:no-underline text-center {{ if $isActive }} {{$activeTab }} {{ else }} {{ $inactiveTab }} {{ end }}"> 12 - {{ $value }} 9 + {{ $isActive := eq $value.Key $active }} 10 + <a href="?{{ $name }}={{ $value.Key }}" 11 + class="p-2 whitespace-nowrap flex justify-center items-center gap-2 text-sm w-full block hover:no-underline text-center {{ if $isActive }} {{$activeTab }} {{ else }} {{ $inactiveTab }} {{ end }}"> 12 + {{ if $value.Icon }} 13 + {{ i $value.Icon "size-4" }} 14 + {{ end }} 15 + 16 + {{ with $value.Meta }} 17 + {{ . }} 18 + {{ end }} 19 + 20 + {{ $value.Value }} 13 21 </a> 14 22 {{ end }} 15 23 </div>
+20 -2
appview/pages/templates/repo/fragments/diffOpts.html
··· 5 5 {{ if .Split }} 6 6 {{ $active = "split" }} 7 7 {{ end }} 8 - {{ $values := list "unified" "split" }} 9 - {{ template "fragments/tabSelector" (dict "Name" "diff" "Values" $values "Active" $active) }} 8 + 9 + {{ $unified := 10 + (dict 11 + "Key" "unified" 12 + "Value" "unified" 13 + "Icon" "square-split-vertical" 14 + "Meta" "") }} 15 + {{ $split := 16 + (dict 17 + "Key" "split" 18 + "Value" "split" 19 + "Icon" "square-split-horizontal" 20 + "Meta" "") }} 21 + {{ $values := list $unified $split }} 22 + 23 + {{ template "fragments/tabSelector" 24 + (dict 25 + "Name" "diff" 26 + "Values" $values 27 + "Active" $active) }} 10 28 </section> 11 29 {{ end }} 12 30
+32 -21
appview/pages/templates/repo/issues/issues.html
··· 8 8 {{ end }} 9 9 10 10 {{ define "repoContent" }} 11 + {{ $active := "closed" }} 12 + {{ if .FilteringByOpen }} 13 + {{ $active = "open" }} 14 + {{ end }} 15 + 16 + {{ $open := 17 + (dict 18 + "Key" "open" 19 + "Value" "open" 20 + "Icon" "circle-dot" 21 + "Meta" (string .RepoInfo.Stats.IssueCount.Open)) }} 22 + {{ $closed := 23 + (dict 24 + "Key" "closed" 25 + "Value" "closed" 26 + "Icon" "ban" 27 + "Meta" (string .RepoInfo.Stats.IssueCount.Closed)) }} 28 + {{ $values := list $open $closed }} 29 + 30 + <div class="flex flex-col gap-2"> 11 31 <div class="flex justify-between items-stretch gap-4"> 12 32 <form class="flex flex-1 relative" method="GET"> 13 33 <input type="hidden" name="state" value="{{ if .FilteringByOpen }}open{{ else }}closed{{ end }}"> ··· 42 22 {{ i "x" "w-4 h-4" }} 43 23 </a> 44 24 </form> 25 + <div class="hidden sm:block"> 26 + {{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active) }} 27 + </div> 45 28 <a 46 - href="/{{ .RepoInfo.FullName }}/issues/new" 47 - class="btn-create text-sm flex items-center justify-center gap-2 no-underline hover:no-underline hover:text-white" 48 - > 49 - {{ i "circle-plus" "w-4 h-4" }} 50 - <span>new</span> 29 + href="/{{ .RepoInfo.FullName }}/issues/new" 30 + class="btn-create text-sm flex items-center justify-center gap-2 no-underline hover:no-underline hover:text-white" 31 + > 32 + {{ i "circle-plus" "w-4 h-4" }} 33 + <span>new</span> 51 34 </a> 52 35 </div> 53 - <div class="mt-2 ml-2 flex gap-4 text-xs"> 54 - <a 55 - href="?state=open" 56 - class="flex items-center gap-2 {{ if .FilteringByOpen }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 57 - > 58 - {{ i "circle-dot" "w-4 h-4" }} 59 - <span>{{ .RepoInfo.Stats.IssueCount.Open }} open</span> 60 - </a> 61 - <a 62 - href="?state=closed" 63 - class="flex items-center gap-2 {{ if not .FilteringByOpen }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 64 - > 65 - {{ i "ban" "w-4 h-4" }} 66 - <span>{{ .RepoInfo.Stats.IssueCount.Closed }} closed</span> 67 - </a> 36 + <div class="sm:hidden"> 37 + {{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active) }} 68 38 </div> 69 - <div class="error" id="issues"></div> 39 + </div> 40 + <div class="error" id="issues"></div> 70 41 {{ end }} 71 42 72 43 {{ define "repoAfter" }}
+37 -28
appview/pages/templates/repo/pulls/pulls.html
··· 8 8 {{ end }} 9 9 10 10 {{ define "repoContent" }} 11 - <div class="flex justify-between items-stretch gap-4"> 11 + {{ $active := "closed" }} 12 + {{ if .FilteringBy.IsOpen }} 13 + {{ $active = "open" }} 14 + {{ else if .FilteringBy.IsMerged }} 15 + {{ $active = "merged" }} 16 + {{ end }} 17 + {{ $open := 18 + (dict 19 + "Key" "open" 20 + "Value" "open" 21 + "Icon" "git-pull-request" 22 + "Meta" (string .RepoInfo.Stats.PullCount.Open)) }} 23 + {{ $merged := 24 + (dict 25 + "Key" "merged" 26 + "Value" "merged" 27 + "Icon" "git-merge" 28 + "Meta" (string .RepoInfo.Stats.PullCount.Merged)) }} 29 + {{ $closed := 30 + (dict 31 + "Key" "closed" 32 + "Value" "closed" 33 + "Icon" "ban" 34 + "Meta" (string .RepoInfo.Stats.IssueCount.Closed)) }} 35 + {{ $values := list $open $merged $closed }} 36 + <div class="flex flex-col gap-2"> 37 + <div class="flex justify-between items-stretch gap-2"> 12 38 <form class="flex flex-1 relative" method="GET"> 13 39 <input type="hidden" name="state" value="{{ .FilteringBy.String }}"> 14 40 <div class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"> ··· 48 22 {{ i "x" "w-4 h-4" }} 49 23 </a> 50 24 </form> 51 - <a 52 - href="/{{ .RepoInfo.FullName }}/pulls/new" 25 + <div class="hidden sm:block"> 26 + {{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active) }} 27 + </div> 28 + <a href="/{{ .RepoInfo.FullName }}/pulls/new" 53 29 class="btn-create text-sm flex items-center gap-2 no-underline hover:no-underline hover:text-white" 54 30 > 55 - {{ i "git-pull-request-create" "w-4 h-4" }} 56 - <span>new</span> 31 + {{ i "git-pull-request-create" "w-4 h-4" }} 32 + <span>new</span> 57 33 </a> 58 34 </div> 59 - <div class="mt-2 ml-2 flex gap-4 text-xs"> 60 - <a 61 - href="?state=open" 62 - class="flex items-center gap-2 {{ if .FilteringBy.IsOpen }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 63 - > 64 - {{ i "git-pull-request" "w-4 h-4" }} 65 - <span>{{ .RepoInfo.Stats.PullCount.Open }} open</span> 66 - </a> 67 - <a 68 - href="?state=merged" 69 - class="flex items-center gap-2 {{ if .FilteringBy.IsMerged }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 70 - > 71 - {{ i "git-merge" "w-4 h-4" }} 72 - <span>{{ .RepoInfo.Stats.PullCount.Merged }} merged</span> 73 - </a> 74 - <a 75 - href="?state=closed" 76 - class="flex items-center gap-2 {{ if .FilteringBy.IsClosed }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 77 - > 78 - {{ i "ban" "w-4 h-4" }} 79 - <span>{{ .RepoInfo.Stats.PullCount.Closed }} closed</span> 80 - </a> 35 + <div class="sm:hidden"> 36 + {{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active) }} 81 37 </div> 82 - <div class="error" id="pulls"></div> 38 + </div> 39 + <div class="error" id="pulls"></div> 83 40 {{ end }} 84 41 85 42 {{ define "repoAfter" }}