Skip to content

Commit 03dcce6

Browse files
author
nejc
committed
feat: Add logout button and go home navigation to admin layout
- Added logout button in sidebar bottom navigation with red styling - Added 'Go Home' button in sidebar bottom navigation - Improved sidebar layout with flex column structure - Removed old logout button from top navigation - Added user status indicator in top navigation - Enhanced navigation with proper icons and hover effects - Added transition effects for better UX
1 parent 8081696 commit 03dcce6

File tree

1 file changed

+58
-36
lines changed

1 file changed

+58
-36
lines changed

resources/views/layouts/admin.blade.php

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,43 +45,69 @@
4545
<body class="font-sans antialiased bg-gray-50">
4646
<div class="min-h-screen">
4747
<!-- Sidebar -->
48-
<div class="fixed inset-y-0 left-0 z-50 w-64 bg-white shadow-lg">
48+
<div class="fixed inset-y-0 left-0 z-50 w-64 bg-white shadow-lg flex flex-col">
49+
<!-- Header -->
4950
<div class="flex items-center justify-center h-16 px-4 border-b border-gray-200">
5051
<h1 class="text-xl font-bold text-gray-900">Platform Manager</h1>
5152
</div>
5253

53-
<nav class="mt-8 px-4">
54+
<!-- Navigation -->
55+
<nav class="flex-1 mt-8 px-4">
5456
<div class="space-y-2">
55-
<a href="{{ route('version-manager.dashboard') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.dashboard') ? 'bg-blue-50 text-blue-700' : '' }}">
56-
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
57-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z" />
58-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5a2 2 0 012-2h4a2 2 0 012 2v6H8V5z" />
59-
</svg>
60-
Dashboard
61-
</a>
62-
63-
<a href="{{ route('version-manager.versions.index') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.versions.*') ? 'bg-blue-50 text-blue-700' : '' }}">
64-
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
65-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
66-
</svg>
67-
Versions
68-
</a>
69-
70-
<a href="{{ route('version-manager.users.index') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.users.*') ? 'bg-blue-50 text-blue-700' : '' }}">
71-
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
72-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" />
73-
</svg>
74-
Users
75-
</a>
76-
77-
<a href="{{ route('version-manager.analytics.index') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.analytics.*') ? 'bg-blue-50 text-blue-700' : '' }}">
78-
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
79-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
80-
</svg>
81-
Analytics
82-
</a>
57+
<a href="{{ route('version-manager.dashboard') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.dashboard') ? 'bg-blue-50 text-blue-700' : '' }}">
58+
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
59+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z" />
60+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5a2 2 0 012-2h4a2 2 0 012 2v6H8V5z" />
61+
</svg>
62+
Dashboard
63+
</a>
64+
65+
<a href="{{ route('version-manager.versions.index') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.versions.*') ? 'bg-blue-50 text-blue-700' : '' }}">
66+
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
67+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
68+
</svg>
69+
Versions
70+
</a>
71+
72+
<a href="{{ route('version-manager.users.index') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.users.*') ? 'bg-blue-50 text-blue-700' : '' }}">
73+
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
74+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z" />
75+
</svg>
76+
Users
77+
</a>
78+
79+
<a href="{{ route('version-manager.analytics.index') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 {{ request()->routeIs('version-manager.analytics.*') ? 'bg-blue-50 text-blue-700' : '' }}">
80+
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
81+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
82+
</svg>
83+
Analytics
84+
</a>
8385
</div>
8486
</nav>
87+
88+
<!-- Bottom Navigation -->
89+
<div class="border-t border-gray-200 p-4 space-y-3">
90+
<!-- Go Home/Back Button -->
91+
<a href="{{ route('home') }}" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-colors duration-200">
92+
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
93+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
94+
</svg>
95+
Go Home
96+
</a>
97+
98+
<!-- Logout Button -->
99+
@auth
100+
<form method="POST" action="{{ route('logout') }}" class="w-full">
101+
@csrf
102+
<button type="submit" class="flex items-center w-full px-4 py-2 text-sm font-medium text-red-600 rounded-md hover:bg-red-50 hover:text-red-700 transition-colors duration-200">
103+
<svg class="w-5 h-5 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
104+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
105+
</svg>
106+
Logout
107+
</button>
108+
</form>
109+
@endauth
110+
</div>
85111
</div>
86112

87113
<!-- Main content -->
@@ -97,12 +123,8 @@
97123
@auth
98124
<div class="flex items-center space-x-3">
99125
<span class="text-sm text-gray-700">{{ Auth::user()->name }}</span>
100-
<form method="POST" action="{{ route('logout') }}" class="inline">
101-
@csrf
102-
<button type="submit" class="text-sm text-gray-500 hover:text-gray-700">
103-
Logout
104-
</button>
105-
</form>
126+
<span class="text-xs text-gray-500">•</span>
127+
<span class="text-sm text-gray-500">Admin</span>
106128
</div>
107129
@endauth
108130
</div>

0 commit comments

Comments
 (0)