重构:统一前台页面级导航栏
- 移除大厅和说明页多余的 nav-right 内容 - 统一在 layouts/app.blade.php 内展示 大厅/风云榜/留言板/后台/使用说明/个人资料/退出 等功能 - 去除重复的个人资料按钮,取消前台新建房间的功能(已转至后台),精简导航展示
This commit is contained in:
@@ -80,16 +80,44 @@
|
||||
<span class="mr-1">✉️</span> 留言板
|
||||
</a>
|
||||
|
||||
{{-- 通用快捷操作区 --}}
|
||||
@auth
|
||||
@if (Auth::user()->user_level >= 15)
|
||||
<a href="{{ route('admin.dashboard') }}"
|
||||
class="text-indigo-200 hover:text-white font-bold transition hidden sm:flex items-center">
|
||||
<span class="mr-1">⚙️</span> 后台
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('guide') }}"
|
||||
class="text-indigo-200 hover:text-white font-bold transition hidden sm:flex items-center">
|
||||
<span class="mr-1">📖</span> 说明
|
||||
</a>
|
||||
<button
|
||||
@click="typeof showProfileModal !== 'undefined' ? showProfileModal = true : window.location.href='{{ route('rooms.index') }}'"
|
||||
class="text-indigo-200 hover:text-white font-bold transition hidden sm:flex items-center">
|
||||
<span class="mr-1">👤</span> 资料
|
||||
</button>
|
||||
@endauth
|
||||
|
||||
@yield('nav-right')
|
||||
|
||||
{{-- 用户信息(通用) --}}
|
||||
{{-- 用户信息(通用)及退出 --}}
|
||||
@auth
|
||||
<div class="flex items-center space-x-2 ml-2 pl-2 border-l border-indigo-700">
|
||||
<img src="/images/headface/{{ Auth::user()->headface ?? '01.gif' }}"
|
||||
class="w-7 h-7 rounded border border-indigo-500 object-cover bg-white">
|
||||
<span class="font-bold hidden sm:inline">{{ Auth::user()->username }}</span>
|
||||
<span
|
||||
class="bg-white/20 px-1.5 py-0.5 rounded text-xs border border-white/10">LV.{{ Auth::user()->user_level }}</span>
|
||||
<div class="flex items-center space-x-3 ml-2 pl-2 border-l border-indigo-700">
|
||||
<div class="flex items-center space-x-2">
|
||||
<img src="/images/headface/{{ Auth::user()->headface ?? '01.gif' }}"
|
||||
class="w-7 h-7 rounded border border-indigo-500 object-cover bg-white">
|
||||
<span class="font-bold hidden sm:inline">{{ Auth::user()->username }}</span>
|
||||
<span
|
||||
class="bg-white/20 px-1.5 py-0.5 rounded text-xs border border-white/10">LV.{{ Auth::user()->user_level }}</span>
|
||||
</div>
|
||||
<form action="{{ route('logout') }}" method="POST" class="inline">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="text-xs border border-white/30 hover:bg-white/10 px-2 py-1.5 rounded transition font-medium text-white/80 hover:text-white">
|
||||
退出
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endauth
|
||||
</div>
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
@section('nav-icon', '📖')
|
||||
@section('nav-title', '使用说明')
|
||||
|
||||
@section('nav-right')
|
||||
{{-- admin 后台直达 --}}
|
||||
@if (Auth::user()->user_level >= 15)
|
||||
<a href="{{ route('admin.dashboard') }}" class="text-indigo-200 hover:text-white font-bold hidden sm:block">⚙️ 后台</a>
|
||||
@endif
|
||||
{{-- 退出登录 --}}
|
||||
<form action="{{ route('logout') }}" method="POST" class="inline">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="text-sm border border-white/30 hover:bg-white/10 px-4 py-2 rounded-md transition font-medium">退出登录</button>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@section('head')
|
||||
<style>
|
||||
|
||||
@@ -36,17 +36,10 @@
|
||||
@endif
|
||||
{{-- 使用说明 --}}
|
||||
<a href="{{ route('guide') }}" class="text-indigo-200 hover:text-white font-bold text-sm hidden sm:block">📖 使用说明</a>
|
||||
{{-- 个人资料 --}}
|
||||
<button @click="showProfileModal = true" class="font-medium text-sm hover:text-indigo-200 transition flex items-center">
|
||||
欢迎您,{{ Auth::user()->username }}
|
||||
{{-- 个人中心展示 --}}
|
||||
<button @click="showProfileModal = true" class="text-indigo-200 hover:text-white font-bold text-sm hidden sm:block">
|
||||
👤 个人资料
|
||||
</button>
|
||||
{{-- 新建房间 --}}
|
||||
@if (Auth::user()->user_level >= 10)
|
||||
<button @click="showCreateModal = true"
|
||||
class="bg-emerald-500 hover:bg-emerald-400 px-4 py-2 rounded-md font-bold text-sm transition shadow-sm">
|
||||
+ 新建房间
|
||||
</button>
|
||||
@endif
|
||||
{{-- 退出登录 --}}
|
||||
<form action="{{ route('logout') }}" method="POST" class="inline">
|
||||
@csrf
|
||||
|
||||
Reference in New Issue
Block a user