pl / index.html
Ivanovivan0's picture
Add 2 files
9848bce verified
Raw History Blame Contribute Delete
55.3 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Premier League Admin Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.snow.css" rel="stylesheet">
<style>
.gradient-bg {
background: linear-gradient(135deg, #38003c 0%, #00ff85 100%);
}
.sidebar {
transition: all 0.3s ease;
}
.active-tab {
background-color: #f3f4f6;
border-left: 4px solid #00ff85;
}
.image-preview {
max-height: 200px;
object-fit: contain;
}
#editor {
height: 300px;
}
.ql-toolbar.ql-snow {
border-radius: 6px 6px 0 0;
}
.ql-container.ql-snow {
border-radius: 0 0 6px 6px;
}
.dropdown-menu {
display: none;
position: absolute;
right: 0;
background-color: white;
min-width: 200px;
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
border-radius: 0.5rem;
z-index: 1;
margin-top: 0.5rem;
}
.dropdown-menu.show {
display: block;
}
.notification-badge {
position: absolute;
top: -5px;
right: -5px;
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #ef4444;
color: white;
font-size: 10px;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<!-- Admin Dashboard Layout -->
<div class="flex h-screen">
<!-- Sidebar -->
<div class="sidebar bg-gray-800 text-white w-64 flex-shrink-0">
<div class="p-4 flex items-center space-x-2">
<i class="fas fa-futbol text-2xl"></i>
<span class="text-xl font-bold">Premier League</span>
<span class="bg-purple-600 text-xs px-2 py-1 rounded-full">Admin</span>
</div>
<nav class="mt-6">
<div>
<p class="px-4 py-2 text-gray-400 uppercase text-xs font-bold">Management</p>
<a href="#team-management" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700 active-tab">
<i class="fas fa-users mr-3"></i>
<span>Team Management</span>
</a>
<a href="#player-management" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700">
<i class="fas fa-user mr-3"></i>
<span>Player Assignment</span>
</a>
<a href="#match-management" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700">
<i class="fas fa-calendar-alt mr-3"></i>
<span>Match Management</span>
</a>
<a href="#news-management" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700">
<i class="fas fa-newspaper mr-3"></i>
<span>News Management</span>
</a>
</div>
<div class="mt-6">
<p class="px-4 py-2 text-gray-400 uppercase text-xs font-bold">Tools</p>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700">
<i class="fas fa-cog mr-3"></i>
<span>Settings</span>
</a>
<a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-700">
<i class="fas fa-sign-out-alt mr-3"></i>
<span>Logout</span>
</a>
</div>
</nav>
</div>
<!-- Main Content -->
<div class="flex-1 overflow-auto">
<!-- Header -->
<header class="bg-white shadow-sm">
<div class="flex justify-between items-center px-6 py-4">
<h1 class="text-2xl font-bold text-gray-800">Admin Dashboard</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<div class="flex items-center space-x-2">
<!-- Notification Dropdown -->
<div class="relative">
<button id="notification-btn" class="relative p-2 text-gray-600 hover:text-gray-900">
<i class="fas fa-bell text-xl"></i>
<span class="notification-badge">3</span>
</button>
<div id="notification-dropdown" class="dropdown-menu">
<div class="p-4 border-b">
<h4 class="font-semibold">Notifications (3)</h4>
</div>
<div class="max-h-80 overflow-y-auto">
<a href="#" class="flex items-center px-4 py-3 hover:bg-gray-50 border-b">
<div class="bg-blue-100 p-2 rounded-full mr-3">
<i class="fas fa-info-circle text-blue-500"></i>
</div>
<div>
<p class="text-sm font-medium">New match scheduled</p>
<p class="text-xs text-gray-500">2 hours ago</p>
</div>
</a>
<a href="#" class="flex items-center px-4 py-3 hover:bg-gray-50 border-b">
<div class="bg-green-100 p-2 rounded-full mr-3">
<i class="fas fa-check-circle text-green-500"></i>
</div>
<div>
<p class="text-sm font-medium">Player transfer approved</p>
<p class="text-xs text-gray-500">5 hours ago</p>
</div>
</a>
<a href="#" class="flex items-center px-4 py-3 hover:bg-gray-50">
<div class="bg-red-100 p-2 rounded-full mr-3">
<i class="fas fa-exclamation-circle text-red-500"></i>
</div>
<div>
<p class="text-sm font-medium">System maintenance</p>
<p class="text-xs text-gray-500">Yesterday</p>
</div>
</a>
</div>
<div class="p-2 border-t text-center">
<a href="#" class="text-sm text-purple-600 hover:text-purple-800">View all notifications</a>
</div>
</div>
</div>
<!-- User Profile Dropdown -->
<div class="relative">
<button id="user-menu-btn" class="flex items-center space-x-2 focus:outline-none">
<img src="https://via.placeholder.com/40" alt="Admin" class="h-8 w-8 rounded-full">
<span class="hidden md:inline-block">Admin</span>
</button>
<div id="user-dropdown" class="dropdown-menu">
<div class="p-4 border-b">
<div class="flex items-center space-x-3">
<img src="https://via.placeholder.com/40" alt="Admin" class="h-10 w-10 rounded-full">
<div>
<p class="font-medium">Admin User</p>
<p class="text-sm text-gray-500">admin@example.com</p>
</div>
</div>
</div>
<div class="py-1">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-user mr-2"></i> Your Profile
</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-cog mr-2"></i> Settings
</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-envelope mr-2"></i> Messages
</a>
</div>
<div class="py-1 border-t">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-sign-out-alt mr-2"></i> Sign out
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Team Management Section -->
<section id="team-management" class="p-6">
<div class="bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Team Management</h2>
<button id="add-team-btn" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Team
</button>
</div>
<!-- Team List -->
<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">Logo</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Team</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Stadium</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Founded</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Players</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">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<img src="https://via.placeholder.com/40?text=MCI" alt="Man City" class="h-10 w-10 rounded-full">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="font-medium">Manchester City</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
Etihad Stadium
</td>
<td class="px-6 py-4 whitespace-nowrap">
1880
</td>
<td class="px-6 py-4 whitespace-nowrap">
25
</td>
<td class="px-6 py-4 whitespace-nowrap">
<button class="text-purple-600 hover:text-purple-900 mr-3 edit-team-btn">
<i class="fas fa-edit"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
<!-- More team rows would go here -->
</tbody>
</table>
</div>
</div>
</section>
<!-- Team Form Modal -->
<div id="team-modal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
<div class="flex justify-between items-center border-b px-6 py-4">
<h3 class="text-lg font-semibold">Add New Team</h3>
<button id="close-team-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="team-form" class="p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-gray-700 mb-2" for="team-name">Team Name*</label>
<input type="text" id="team-name" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
</div>
<div>
<label class="block text-gray-700 mb-2" for="short-name">Short Name*</label>
<input type="text" id="short-name" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
</div>
<div>
<label class="block text-gray-700 mb-2" for="stadium">Stadium*</label>
<input type="text" id="stadium" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
</div>
<div>
<label class="block text-gray-700 mb-2" for="founded">Founded Year*</label>
<input type="number" id="founded" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
</div>
<div>
<label class="block text-gray-700 mb-2" for="manager">Manager</label>
<input type="text" id="manager" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-gray-700 mb-2" for="website">Website</label>
<input type="url" id="website" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div class="md:col-span-2">
<label class="block text-gray-700 mb-2" for="team-description">Description</label>
<textarea id="team-description" rows="3" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"></textarea>
</div>
<div class="md:col-span-2">
<label class="block text-gray-700 mb-2">Team Logo*</label>
<div class="flex items-center space-x-4">
<div class="border-2 border-dashed border-gray-300 rounded-lg p-4 text-center w-48">
<img id="logo-preview" src="https://via.placeholder.com/150?text=Upload+Logo" alt="Logo Preview" class="image-preview mb-2">
<input type="file" id="team-logo" class="hidden" accept="image/*">
<button type="button" id="upload-logo-btn" class="bg-gray-200 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-300">
Choose Image
</button>
</div>
<div class="text-sm text-gray-500">
<p>Upload team logo (max 2MB)</p>
<p>Recommended size: 300x300px</p>
</div>
</div>
</div>
</div>
<div class="flex justify-end space-x-3 mt-6">
<button type="button" id="cancel-team-btn" class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50">
Cancel
</button>
<button type="submit" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700">
Save Team
</button>
</div>
</form>
</div>
</div>
<!-- Player Assignment Section -->
<section id="player-management" class="p-6 hidden">
<div class="bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Player Assignment</h2>
<div class="flex space-x-3">
<select class="border rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option>All Teams</option>
<option>Manchester City</option>
<option>Liverpool</option>
<option>Arsenal</option>
</select>
<button class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Player
</button>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- Player Card -->
<div class="border rounded-lg p-4 hover:shadow-lg transition-shadow">
<div class="flex items-center space-x-4 mb-4">
<img src="https://via.placeholder.com/60?text=EH" alt="Erling Haaland" class="h-16 w-16 rounded-full">
<div>
<h3 class="font-bold">Erling Haaland</h3>
<p class="text-sm text-gray-600">Manchester City</p>
<div class="flex space-x-2 mt-1">
<span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">ST</span>
<span class="bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded">#9</span>
</div>
</div>
</div>
<div class="grid grid-cols-2 gap-2 text-sm">
<div>
<p class="text-gray-500">Nationality</p>
<p>Norway</p>
</div>
<div>
<p class="text-gray-500">Age</p>
<p>23</p>
</div>
<div>
<p class="text-gray-500">Height</p>
<p>1.94m</p>
</div>
<div>
<p class="text-gray-500">Weight</p>
<p>88kg</p>
</div>
</div>
<div class="flex justify-end space-x-2 mt-4">
<button class="text-purple-600 hover:text-purple-900">
<i class="fas fa-edit"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i class="fas fa-trash"></i>
</button>
<button class="text-blue-600 hover:text-blue-900">
<i class="fas fa-exchange-alt"></i>
</button>
</div>
</div>
<!-- More player cards would go here -->
</div>
</div>
</section>
<!-- Match Management Section -->
<section id="match-management" class="p-6 hidden">
<div class="bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">Match Management</h2>
<div class="flex space-x-3">
<button id="generate-fixtures-btn" class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 flex items-center">
<i class="fas fa-random mr-2"></i> Generate Fixtures
</button>
<button id="add-match-btn" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Match
</button>
</div>
</div>
<!-- Match Tabs -->
<div class="border-b border-gray-200 mb-6">
<nav class="-mb-px flex space-x-8">
<a href="#" class="border-purple-500 text-purple-600 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm">
Upcoming Matches
</a>
<a href="#" class="border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm">
Completed Matches
</a>
<a href="#" class="border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 py-4 px-1 border-b-2 font-medium text-sm">
All Matches
</a>
</nav>
</div>
<!-- Match List -->
<div class="space-y-4">
<!-- Match Item -->
<div class="border rounded-lg p-4 hover:shadow-md transition-shadow">
<div class="flex justify-between items-center mb-4">
<div class="text-sm text-gray-500">
<i class="fas fa-calendar-alt mr-2"></i> Sat, 10 Feb 2024 | 15:00
<span class="ml-4"><i class="fas fa-map-marker-alt mr-2"></i> Etihad Stadium</span>
</div>
<div class="flex space-x-2">
<button class="text-green-600 hover:text-green-900 px-3 py-1 border border-green-200 rounded-lg">
<i class="fas fa-edit mr-1"></i> Enter Result
</button>
<button class="text-gray-600 hover:text-gray-900 px-3 py-1 border border-gray-200 rounded-lg">
<i class="fas fa-trash mr-1"></i>
</button>
</div>
</div>
<div class="flex items-center justify-center space-x-6">
<div class="text-center">
<img src="https://via.placeholder.com/60?text=MCI" alt="Man City" class="h-12 w-12 mx-auto mb-2">
<p class="font-medium">Manchester City</p>
</div>
<div class="text-2xl font-bold px-4 py-2 bg-gray-100 rounded-lg">
vs
</div>
<div class="text-center">
<img src="https://via.placeholder.com/60?text=LIV" alt="Liverpool" class="h-12 w-12 mx-auto mb-2">
<p class="font-medium">Liverpool</p>
</div>
</div>
</div>
<!-- More match items would go here -->
</div>
</div>
</section>
<!-- Match Result Modal -->
<div id="match-result-modal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-3xl">
<div class="flex justify-between items-center border-b px-6 py-4">
<h3 class="text-lg font-semibold">Enter Match Result</h3>
<button id="close-match-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="match-result-form" class="p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 items-center mb-6">
<div class="text-center">
<img src="https://via.placeholder.com/80?text=MCI" alt="Man City" class="h-16 w-16 mx-auto mb-2">
<p class="font-medium">Manchester City</p>
</div>
<div class="flex items-center justify-center space-x-4">
<input type="number" min="0" class="w-16 text-center text-2xl font-bold border rounded-lg py-2" value="0">
<span class="text-xl">-</span>
<input type="number" min="0" class="w-16 text-center text-2xl font-bold border rounded-lg py-2" value="0">
</div>
<div class="text-center">
<img src="https://via.placeholder.com/80?text=LIV" alt="Liverpool" class="h-16 w-16 mx-auto mb-2">
<p class="font-medium">Liverpool</p>
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2">Match Events</label>
<div class="space-y-3">
<div class="flex items-center space-x-3">
<select class="border rounded-lg px-3 py-2 flex-1">
<option>Goal</option>
<option>Yellow Card</option>
<option>Red Card</option>
<option>Substitution</option>
<option>Penalty</option>
<option>Own Goal</option>
</select>
<select class="border rounded-lg px-3 py-2 flex-1">
<option>Manchester City</option>
<option>Liverpool</option>
</select>
<select class="border rounded-lg px-3 py-2 flex-1">
<option>Erling Haaland</option>
<option>Kevin De Bruyne</option>
<option>Mohamed Salah</option>
</select>
<input type="number" min="1" max="120" placeholder="Min" class="border rounded-lg px-3 py-2 w-20">
<button type="button" class="bg-gray-200 text-gray-700 px-3 py-2 rounded-lg hover:bg-gray-300">
<i class="fas fa-plus"></i>
</button>
</div>
<!-- Event items would be added here dynamically -->
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2">Match Statistics</label>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="border rounded-lg p-3">
<p class="font-medium mb-2">Possession</p>
<div class="flex items-center space-x-2">
<input type="number" min="0" max="100" class="border rounded-lg px-3 py-1 w-16 text-center" value="60">
<span>%</span>
<span>-</span>
<input type="number" min="0" max="100" class="border rounded-lg px-3 py-1 w-16 text-center" value="40">
<span>%</span>
</div>
</div>
<div class="border rounded-lg p-3">
<p class="font-medium mb-2">Shots</p>
<div class="flex items-center space-x-2">
<input type="number" min="0" class="border rounded-lg px-3 py-1 w-16 text-center" value="18">
<span>-</span>
<input type="number" min="0" class="border rounded-lg px-3 py-1 w-16 text-center" value="12">
</div>
</div>
<div class="border rounded-lg p-3">
<p class="font-medium mb-2">Corners</p>
<div class="flex items-center space-x-2">
<input type="number" min="0" class="border rounded-lg px-3 py-1 w-16 text-center" value="7">
<span>-</span>
<input type="number" min="0" class="border rounded-lg px-3 py-1 w-16 text-center" value="4">
</div>
</div>
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2">Match Summary</label>
<textarea rows="3" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"></textarea>
</div>
<div class="flex justify-end space-x-3">
<button type="button" id="cancel-match-btn" class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50">
Cancel
</button>
<button type="submit" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700">
Save Result
</button>
</div>
</form>
</div>
</div>
<!-- News Management Section -->
<section id="news-management" class="p-6 hidden">
<div class="bg-white rounded-lg shadow-md p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">News Management</h2>
<button id="add-news-btn" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add News
</button>
</div>
<!-- News List -->
<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">Title</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Author</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Category</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Publish Date</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">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="font-medium">Haaland scores hat-trick in derby</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
John Smith
</td>
<td class="px-6 py-4 whitespace-nowrap">
Match Report
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Published</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
10 Feb 2024
</td>
<td class="px-6 py-4 whitespace-nowrap">
<button class="text-purple-600 hover:text-purple-900 mr-3">
<i class="fas fa-edit"></i>
</button>
<button class="text-red-600 hover:text-red-900">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
<!-- More news rows would go here -->
</tbody>
</table>
</div>
</div>
</section>
<!-- News Form Modal -->
<div id="news-modal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-4xl">
<div class="flex justify-between items-center border-b px-6 py-4">
<h3 class="text-lg font-semibold">Add News Article</h3>
<button id="close-news-modal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<form id="news-form" class="p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div>
<label class="block text-gray-700 mb-2" for="news-title">Title*</label>
<input type="text" id="news-title" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
</div>
<div>
<label class="block text-gray-700 mb-2" for="news-category">Category*</label>
<select id="news-category" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
<option value="">Select Category</option>
<option>Match Report</option>
<option>Transfer News</option>
<option>Injury Update</option>
<option>Team News</option>
<option>Interview</option>
</select>
</div>
<div>
<label class="block text-gray-700 mb-2" for="news-author">Author*</label>
<input type="text" id="news-author" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
</div>
<div>
<label class="block text-gray-700 mb-2" for="news-status">Status*</label>
<select id="news-status" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" required>
<option value="draft">Draft</option>
<option value="published">Published</option>
<option value="scheduled">Scheduled</option>
</select>
</div>
<div id="publish-date-container" class="hidden">
<label class="block text-gray-700 mb-2" for="news-publish-date">Publish Date*</label>
<input type="datetime-local" id="news-publish-date" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2">Featured Image</label>
<div class="flex items-center space-x-4">
<div class="border-2 border-dashed border-gray-300 rounded-lg p-4 text-center w-48">
<img id="news-image-p preview" src="https://via.placeholder.com/300x200?text=Featured+Image" alt="Image Preview" class="image-preview mb-2">
<input type="file" id="news-image" class="hidden" accept="image/*">
<button type="button" id="upload-news-image-btn" class="bg-gray-200 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-300">
Choose Image
</button>
</div>
<div class="text-sm text-gray-500">
<p>Upload featured image (max 5MB)</p>
<p>Recommended size: 1200x800px</p>
<button type="button" id="crop-image-btn" class="mt-2 text-purple-600 hover:text-purple-800 text-sm hidden">
<i class="fas fa-crop mr-1"></i> Crop Image
</button>
</div>
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2">Content*</label>
<div id="editor"></div>
</div>
<div class="mb-6">
<label class="block text-gray-700 mb-2" for="news-tags">Tags</label>
<input type="text" id="news-tags" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Add tags separated by commas">
</div>
<div class="flex justify-end space-x-3">
<button type="button" id="cancel-news-btn" class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50">
Cancel
</button>
<button type="submit" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700">
Publish News
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"></script>
<script>
// Initialize Quill editor
const quill = new Quill('#editor', {
theme: 'snow',
modules: {
toolbar: [
[{ 'header': [1, 2, 3, false] }],
['bold', 'italic', 'underline', 'strike'],
[{ 'color': [] }, { 'background': [] }],
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
['link', 'image', 'video'],
['clean']
]
},
placeholder: 'Write your news content here...'
});
// Tab switching functionality
document.addEventListener('DOMContentLoaded', function() {
const tabs = document.querySelectorAll('.sidebar a');
const sections = {
'team-management': document.getElementById('team-management'),
'player-management': document.getElementById('player-management'),
'match-management': document.getElementById('match-management'),
'news-management': document.getElementById('news-management')
};
tabs.forEach(tab => {
tab.addEventListener('click', function(e) {
e.preventDefault();
const target = this.getAttribute('href').substring(1);
// Hide all sections
Object.values(sections).forEach(section => {
section.classList.add('hidden');
});
// Show target section
if (sections[target]) {
sections[target].classList.remove('hidden');
}
// Update active tab
tabs.forEach(t => t.classList.remove('active-tab'));
this.classList.add('active-tab');
});
});
// Team form modal
const teamModal = document.getElementById('team-modal');
const addTeamBtn = document.getElementById('add-team-btn');
const closeTeamModal = document.getElementById('close-team-modal');
const cancelTeamBtn = document.getElementById('cancel-team-btn');
const teamForm = document.getElementById('team-form');
const uploadLogoBtn = document.getElementById('upload-logo-btn');
const teamLogoInput = document.getElementById('team-logo');
const logoPreview = document.getElementById('logo-preview');
addTeamBtn.addEventListener('click', () => {
teamModal.classList.remove('hidden');
});
closeTeamModal.addEventListener('click', () => {
teamModal.classList.add('hidden');
});
cancelTeamBtn.addEventListener('click', () => {
teamModal.classList.add('hidden');
});
teamForm.addEventListener('submit', (e) => {
e.preventDefault();
// Form submission logic would go here
alert('Team saved successfully!');
teamModal.classList.add('hidden');
});
uploadLogoBtn.addEventListener('click', () => {
teamLogoInput.click();
});
teamLogoInput.addEventListener('change', (e) => {
const file = e.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = (event) => {
logoPreview.src = event.target.result;
};
reader.readAsDataURL(file);
}
});
// Edit team buttons
const editTeamBtns = document.querySelectorAll('.edit-team-btn');
editTeamBtns.forEach(btn => {
btn.addEventListener('click', () => {
// In a real app, this would populate the form with team data
document.querySelector('#team-modal h3').textContent = 'Edit Team';
teamModal.classList.remove('hidden');
});
});
// News form modal
const newsModal = document.getElementById('news-modal');
const addNewsBtn = document.getElementById('add-news-btn');
const closeNewsModal = document.getElementById('close-news-modal');
const cancelNewsBtn = document.getElementById('cancel-news-btn');
const newsForm = document.getElementById('news-form');
const uploadNewsImageBtn = document.getElementById('upload-news-image-btn');
const newsImageInput = document.getElementById('news-image');
const newsImagePreview = document.getElementById('news-image-preview');
const cropImageBtn = document.getElementById('crop-image-btn');
const newsStatus = document.getElementById('news-status');
const publishDateContainer = document.getElementById('publish-date-container');
addNewsBtn.addEventListener('click', () => {
newsModal.classList.remove('hidden');
});
closeNewsModal.addEventListener('click', () => {
newsModal.classList.add('hidden');
});
cancelNewsBtn.addEventListener('click', () => {
newsModal.classList.add('hidden');
});
newsForm.addEventListener('submit', (e) => {
e.preventDefault();
// Form submission logic would go here
alert('News article saved successfully!');
newsModal.classList.add('hidden');
});
uploadNewsImageBtn.addEventListener('click', () => {
newsImageInput.click();
});
newsImageInput.addEventListener('change', (e) => {
const file = e.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = (event) => {
newsImagePreview.src = event.target.result;
cropImageBtn.classList.remove('hidden');
};
reader.readAsDataURL(file);
}
});
cropImageBtn.addEventListener('click', () => {
// In a real app, this would open an image cropper
alert('Image cropping functionality would be implemented here');
});
newsStatus.addEventListener('change', (e) => {
if (e.target.value === 'scheduled') {
publishDateContainer.classList.remove('hidden');
} else {
publishDateContainer.classList.add('hidden');
}
});
// Match result modal
const matchResultModal = document.getElementById('match-result-modal');
const addMatchBtn = document.getElementById('add-match-btn');
const generateFixturesBtn = document.getElementById('generate-fixtures-btn');
const closeMatchModal = document.getElementById('close-match-modal');
const cancelMatchBtn = document.getElementById('cancel-match-btn');
const matchResultForm = document.getElementById('match-result-form');
addMatchBtn.addEventListener('click', () => {
// In a real app, this would open a form to add a new match
alert('Add match form would open here');
});
generateFixturesBtn.addEventListener('click', () => {
// In a real app, this would generate fixtures
if (confirm('Generate fixtures for the season? This cannot be undone.')) {
alert('Fixtures generated successfully!');
}
});
// This would be triggered by clicking "Enter Result" on a match
const enterResultBtns = document.querySelectorAll('.text-green-600');
enterResultBtns.forEach(btn => {
btn.addEventListener('click', () => {
matchResultModal.classList.remove('hidden');
});
});
closeMatchModal.addEventListener('click', () => {
matchResultModal.classList.add('hidden');
});
cancelMatchBtn.addEventListener('click', () => {
matchResultModal.classList.add('hidden');
});
matchResultForm.addEventListener('submit', (e) => {
e.preventDefault();
// Form submission logic would go here
alert('Match result saved successfully! Standings will be updated.');
matchResultModal.classList.add('hidden');
});
// Notification dropdown functionality
const notificationBtn = document.getElementById('notification-btn');
const notificationDropdown = document.getElementById('notification-dropdown');
notificationBtn.addEventListener('click', (e) => {
e.stopPropagation();
notificationDropdown.classList.toggle('show');
userDropdown.classList.remove('show');
});
// User dropdown functionality
const userMenuBtn = document.getElementById('user-menu-btn');
const userDropdown = document.getElementById('user-dropdown');
userMenuBtn.addEventListener('click', (e) => {
e.stopPropagation();
userDropdown.classList.toggle('show');
notificationDropdown.classList.remove('show');
});
// Close dropdowns when clicking outside
document.addEventListener('click', (e) => {
if (!e.target.closest('.relative')) {
notificationDropdown.classList.remove('show');
userDropdown.classList.remove('show');
}
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Ivanovivan0/pl" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>