110 lines
6.0 KiB
PHP
110 lines
6.0 KiB
PHP
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="en">
|
||
|
|
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>{{ $title }}</title>
|
||
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
||
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||
|
|
<script>
|
||
|
|
tailwind.config = {
|
||
|
|
theme: {
|
||
|
|
extend: {
|
||
|
|
fontFamily: {
|
||
|
|
'sans': ['Inter', 'system-ui', 'sans-serif'],
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
|
||
|
|
<body class="font-sans bg-gray-50 min-h-screen">
|
||
|
|
<!-- Header -->
|
||
|
|
<header class="bg-white shadow-sm border-b border-gray-200">
|
||
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||
|
|
<div class="flex justify-between items-center h-16">
|
||
|
|
<div class="flex items-center">
|
||
|
|
<div class="text-2xl mr-3">⚡</div>
|
||
|
|
<h1 class="text-xl font-bold text-gray-900">Woles Framework</h1>
|
||
|
|
</div>
|
||
|
|
<nav class="flex space-x-4">
|
||
|
|
<a href="/dashboard" class="text-gray-600 hover:text-gray-900 px-3 py-2 rounded-md text-sm font-medium transition-colors">Dashboard</a>
|
||
|
|
<a href="/users" class="text-blue-600 hover:text-blue-700 px-3 py-2 rounded-md text-sm font-medium transition-colors">Users</a>
|
||
|
|
<a href="/logout" class="text-red-600 hover:text-red-700 px-3 py-2 rounded-md text-sm font-medium transition-colors">Logout</a>
|
||
|
|
</nav>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</header>
|
||
|
|
|
||
|
|
<!-- Main Content -->
|
||
|
|
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||
|
|
<!-- Page Header -->
|
||
|
|
<div class="flex justify-between items-center mb-8">
|
||
|
|
<h2 class="text-3xl font-bold text-gray-900">Users Management</h2>
|
||
|
|
<a href="/users/create" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg font-medium transition-colors">
|
||
|
|
Add New User
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Users Table -->
|
||
|
|
<div class="bg-white shadow-sm rounded-xl border border-gray-200 overflow-hidden">
|
||
|
|
@if (empty($users))
|
||
|
|
<div class="text-center py-12">
|
||
|
|
<div class="text-6xl mb-4">👥</div>
|
||
|
|
<h3 class="text-xl font-semibold text-gray-900 mb-2">No users found</h3>
|
||
|
|
<p class="text-gray-600 mb-6">Get started by creating your first user.</p>
|
||
|
|
<a href="/users/create" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg font-medium transition-colors">
|
||
|
|
Create User
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
@else
|
||
|
|
<div class="overflow-x-auto">
|
||
|
|
<table class="min-w-full divide-y divide-gray-200">
|
||
|
|
<thead class="bg-gray-50">
|
||
|
|
<tr>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Created At</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
||
|
|
@foreach ($users as $user)
|
||
|
|
<tr class="hover:bg-gray-50 transition-colors">
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ $user['id'] }}</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $user['name'] }}</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ $user['email'] }}</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ date('M j, Y', strtotime($user['created_at'])) }}</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||
|
|
<div class="flex space-x-2">
|
||
|
|
<a href="/users/{{ $user['id'] }}" class="text-blue-600 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 px-3 py-1 rounded-md text-xs font-medium transition-colors">
|
||
|
|
View
|
||
|
|
</a>
|
||
|
|
<a href="/users/{{ $user['id'] }}/edit" class="text-green-600 hover:text-green-700 bg-green-50 hover:bg-green-100 px-3 py-1 rounded-md text-xs font-medium transition-colors">
|
||
|
|
Edit
|
||
|
|
</a>
|
||
|
|
<form method="POST" action="/users/{{ $user['id'] }}" class="inline">
|
||
|
|
@csrf
|
||
|
|
@method('DELETE')
|
||
|
|
<button type="submit"
|
||
|
|
class="text-red-600 hover:text-red-700 bg-red-50 hover:bg-red-100 px-3 py-1 rounded-md text-xs font-medium transition-colors"
|
||
|
|
onclick="return confirm('Are you sure you want to delete this user?')">
|
||
|
|
Delete
|
||
|
|
</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endforeach
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
</main>
|
||
|
|
</body>
|
||
|
|
|
||
|
|
</html>
|