appview: pulls: make stack component collapsible #224

merged
opened by oppi.li targeting master from push-xwxnuorpzwsu

useful for bigger stacks to reduce the amount of vertical space occupied.

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

Changed files
+31 -4
appview
pages
templates
repo
pulls
fragments
+31 -4
appview/pages/templates/repo/pulls/fragments/pullStack.html
···
{{ define "repo/pulls/fragments/pullStack" }}
-
<p class="text-sm font-bold p-2 dark:text-white">STACK</p>
-
{{ block "pullList" (list .Stack $) }} {{ end }}
+
+
<details class="bg-white dark:bg-gray-800 group" open>
+
<summary class="p-2 text-sm font-bold list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
+
<span class="flex items-center gap-2">
+
<span class="group-open:hidden">
+
{{ i "chevrons-up-down" "w-4 h-4" }}
+
</span>
+
<span class="hidden group-open:flex">
+
{{ i "chevrons-down-up" "w-4 h-4" }}
+
</span>
+
STACK
+
<span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm ml-1">{{ len .Stack }}</span>
+
</span>
+
</summary>
+
{{ block "pullList" (list .Stack $) }} {{ end }}
+
</details>
{{ if gt (len .AbandonedPulls) 0 }}
-
<p class="text-sm font-bold p-2 dark:text-white">ABANDONED PULLS</p>
-
{{ block "pullList" (list .AbandonedPulls $) }} {{ end }}
+
<details class="mt-4 bg-white dark:bg-gray-800 group" open>
+
<summary class="p-2 text-sm font-bold list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
+
<span class="flex items-center gap-2">
+
<span class="group-open:hidden">
+
{{ i "chevrons-up-down" "w-4 h-4" }}
+
</span>
+
<span class="hidden group-open:flex">
+
{{ i "chevrons-down-up" "w-4 h-4" }}
+
</span>
+
ABANDONED PULLS
+
<span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm ml-1">{{ len .AbandonedPulls }}</span>
+
</span>
+
</summary>
+
{{ block "pullList" (list .AbandonedPulls $) }} {{ end }}
+
</details>
{{ end }}
{{ end }}