feat: add frontend admin shortcut for staff
Let admin and editor open /admin in a new tab from the public header and profile, so they can jump to the backend without leaving the site. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
@auth
|
||||
@if(auth()->user()->canAccessAdmin())
|
||||
@if(! empty($asList))
|
||||
<li><a href="{{ url('/admin') }}" target="_blank" rel="noopener">管理</a></li>
|
||||
@else
|
||||
<a href="{{ url('/admin') }}" target="_blank" rel="noopener">管理</a>
|
||||
@endif
|
||||
@endif
|
||||
@endauth
|
||||
@@ -18,6 +18,7 @@
|
||||
</form>
|
||||
@auth
|
||||
<a href="{{ route('profile') }}">{{ auth()->user()->name }}</a>
|
||||
@include('partials.admin-link')
|
||||
<form action="{{ route('logout') }}" method="post" class="inline-form">
|
||||
@csrf
|
||||
<button type="submit" class="link-btn">退出</button>
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
<p><strong>角色:</strong>{{ $user->getRoleNames()->implode(', ') ?: '会员' }}</p>
|
||||
<p><strong>我的文章:</strong>{{ $user->posts()->count() }} 篇</p>
|
||||
<p><strong>我的评论:</strong>{{ $user->comments()->count() }} 条</p>
|
||||
@if($user->canAccessAdmin())
|
||||
<p><a href="{{ url('/admin') }}" target="_blank" rel="noopener">进入后台管理</a></p>
|
||||
@endif
|
||||
</div>
|
||||
<p><a href="{{ route('home') }}">« 返回首页</a></p>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user