Skip to content

Commit 3f463d2

Browse files
authored
feat: sidebar collapse icon (#883)
1 parent 7a93154 commit 3f463d2

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/unfold/static/unfold/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unfold/templates/admin/nav_sidebar.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
{% load i18n %}
22

33
<div class="relative z-50">
4-
<div @click="sidebarDesktopOpen = !sidebarDesktopOpen"
5-
hx-get="{% url "admin:toggle_sidebar" %}"
6-
hx-swap="none"
7-
class="bg-white border cursor-pointer fixed h-6 hidden items-center justify-center rounded-full text-gray-500 top-5 -translate-x-1/2 w-6 z-50 xl:flex dark:bg-gray-800 dark:border-gray-700 dark:text-gray-200"
8-
:class="{'ml-6 rotate-180': !sidebarDesktopOpen, 'ml-72': sidebarDesktopOpen}">
9-
<span class="material-symbols-outlined md-16">
10-
first_page
11-
</span>
12-
</div>
13-
144
<div @click="sidebarMobileOpen = !sidebarMobileOpen"
155
class="fixed bottom-0 bg-gray-700 cursor-pointer flex items-center left-0 mb-2 ml-2 justify-center px-2 py-1 rounded-full shadow-sm text-xs text-white uppercase z-50 xl:hidden"
166
:class="{'ml-72 -translate-x-1/2': sidebarMobileOpen}">
177
{% trans "Menu" %}
188
</div>
199

10+
2011
<div :class="{'xl:block': sidebarDesktopOpen, 'xl:hidden': !sidebarDesktopOpen, 'max-xl:fixed': sidebarMobileOpen, 'hidden': !sidebarMobileOpen }">
2112
{% include "unfold/helpers/navigation.html" %}
2213
</div>

src/unfold/templates/unfold/helpers/welcomemsg.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{% load i18n %}
22

3-
<div class="flex-grow font-semibold min-w-0 mr-3">
3+
<div class="flex flex-row flex-grow font-semibold items-center min-w-0 mr-3">
4+
<span class="cursor-pointer hidden flex-row items-center text-sm xl:flex">
5+
<span class="material-symbols-outlined" hx-get="{% url "admin:toggle_sidebar" %}" hx-swap="none" x-on:click="sidebarDesktopOpen = !sidebarDesktopOpen">
6+
dock_to_right
7+
</span>
8+
</span>
9+
10+
<span class="hidden bg-gray-200 h-5 mx-3 w-px xl:block dark:bg-gray-700"></span>
11+
412
<h1 class="overflow-hidden text-ellipsis text-sm whitespace-nowrap xl:text-base text-font-important-light dark:text-font-important-dark">
513
{% if content_title %}
614
<span class="tracking-tight">

0 commit comments

Comments
 (0)