Skip to content

Commit 6364486

Browse files
committed
fix(account): 修复用户中心布局和模板继承问题
调整抽屉菜单布局方向,修复移动端标题显示顺序,并添加base_template上下文以支持模板继承
1 parent 78b0329 commit 6364486

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/apps/account/templates/account/_account_shell.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
{% block main_padding %}p-0{% endblock %}
77

88
{% block content %}
9-
<div class="drawer lg:drawer-open h-[calc(100vh-4rem)] overflow-hidden bg-base-200/30">
9+
<div class="drawer lg:drawer-open lg:drawer-end h-[calc(100vh-4rem)] overflow-hidden bg-base-200/30">
1010
<input id="account-drawer" type="checkbox" class="drawer-toggle" />
1111

1212
<div class="drawer-content flex flex-col h-full overflow-hidden">
1313
<!-- Mobile Header for Drawer Toggle -->
1414
<div class="w-full navbar bg-base-100 lg:hidden border-b border-base-200 flex-none z-20">
15+
<div class="flex-1 px-2 mx-2 font-bold text-lg">用户中心</div>
1516
<div class="flex-none">
1617
<label for="account-drawer" aria-label="open sidebar" class="btn btn-square btn-ghost">
1718
<i class="fa-solid fa-bars"></i>
1819
</label>
1920
</div>
20-
<div class="flex-1 px-2 mx-2 font-bold text-lg">用户中心</div>
2121
</div>
2222

2323
<!-- Main Content Container -->
@@ -38,7 +38,7 @@
3838

3939
<div class="drawer-side z-40 h-full">
4040
<label for="account-drawer" aria-label="close sidebar" class="drawer-overlay"></label>
41-
<aside class="bg-base-100 h-full w-80 p-4 border-r border-base-200 flex flex-col overflow-y-auto custom-scrollbar">
41+
<aside class="bg-base-100 h-full w-80 p-4 border-l border-base-200 flex flex-col overflow-y-auto custom-scrollbar">
4242
<!-- Sidebar Header / User Info -->
4343
<div class="flex flex-col items-center justify-center py-6 border-b border-base-200/50 mb-4">
4444
<div class="avatar placeholder mb-3">

src/apps/account/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def _get_user_sessions(user: User) -> list[dict]:
161161

162162
ctx = {
163163
'title': '设置',
164+
'base_template': get_template_base(request),
164165
'breadcrumbs': [
165166
{'text': '主页', 'url': reverse('home:index'), 'icon': 'fa-solid fa-home'},
166167
{'text': '用户中心', 'url': reverse('account:index'), 'icon': 'fa-solid fa-user'},

0 commit comments

Comments
 (0)