Saved your changes before starting work
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 5e584ab0-c340-4432-97ef-1972582b60e9 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 6d4dbe7c-69e4-4510-bd62-638ff9c78d5c
This commit is contained in:
168
templates/admin/base.html
Normal file
168
templates/admin/base.html
Normal file
@@ -0,0 +1,168 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Admin Panel{% endblock %} - Technical Turbulence</title>
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.admin-container {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.admin-sidebar {
|
||||
width: 250px;
|
||||
background: #1a1a1a;
|
||||
border-right: 1px solid #333;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
overflow-y: auto;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.admin-logo {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 32px 24px;
|
||||
border-bottom: 1px solid #333;
|
||||
}
|
||||
|
||||
.admin-nav {
|
||||
flex: 1;
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
.admin-nav a {
|
||||
display: block;
|
||||
padding: 12px 16px;
|
||||
margin-bottom: 4px;
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.admin-nav a:hover {
|
||||
background: #252525;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.admin-nav a.active {
|
||||
background: #3b82f6;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.admin-logout {
|
||||
padding: 16px;
|
||||
border-top: 1px solid #333;
|
||||
}
|
||||
|
||||
.admin-logout a {
|
||||
display: block;
|
||||
padding: 12px 16px;
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
border: 1px solid rgba(239, 68, 68, 0.2);
|
||||
color: #ef4444;
|
||||
text-decoration: none;
|
||||
border-radius: 6px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.admin-logout a:hover {
|
||||
background: rgba(239, 68, 68, 0.2);
|
||||
}
|
||||
|
||||
.admin-content {
|
||||
margin-left: 250px;
|
||||
flex: 1;
|
||||
padding: 40px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.admin-header {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.flash-message {
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 24px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.flash-message.success {
|
||||
background: rgba(34, 197, 94, 0.1);
|
||||
border: 1px solid rgba(34, 197, 94, 0.3);
|
||||
color: #22c55e;
|
||||
}
|
||||
|
||||
.flash-message.error {
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
border: 1px solid rgba(239, 68, 68, 0.3);
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.admin-sidebar {
|
||||
width: 200px;
|
||||
}
|
||||
.admin-content {
|
||||
margin-left: 200px;
|
||||
padding: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% block extra_styles %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-container">
|
||||
<div class="admin-sidebar">
|
||||
<div class="admin-logo">Admin Panel</div>
|
||||
<nav class="admin-nav">
|
||||
<a href="{{ url_for('admin_stats') }}" class="{% if request.endpoint == 'admin_stats' %}active{% endif %}">Stats</a>
|
||||
<a href="{{ url_for('admin_members') }}" class="{% if request.endpoint == 'admin_members' %}active{% endif %}">Members/Mentors</a>
|
||||
<a href="{{ url_for('admin_competitions') }}" class="{% if request.endpoint == 'admin_competitions' %}active{% endif %}">Competitions</a>
|
||||
<a href="{{ url_for('admin_sponsors') }}" class="{% if request.endpoint == 'admin_sponsors' %}active{% endif %}">Sponsors</a>
|
||||
</nav>
|
||||
<div class="admin-logout">
|
||||
<a href="{{ url_for('admin_logout') }}">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin-content">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="flash-message {{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
195
templates/admin/competitions.html
Normal file
195
templates/admin/competitions.html
Normal file
@@ -0,0 +1,195 @@
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block title %}Competitions Management{% endblock %}
|
||||
|
||||
{% block extra_styles %}
|
||||
<style>
|
||||
.section {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.section-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: 28px;
|
||||
color: var(--white);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.add-form {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-label {
|
||||
display: block;
|
||||
color: var(--gray-300);
|
||||
margin-bottom: 6px;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input, .form-select, .form-textarea {
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
background: #0d0d0d;
|
||||
border: 1px solid #333;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-textarea {
|
||||
min-height: 100px;
|
||||
resize: vertical;
|
||||
}
|
||||
.form-input:focus, .form-select:focus, .form-textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--blue);
|
||||
}
|
||||
.competitions-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
.comp-card {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
}
|
||||
.comp-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: start;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.comp-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: 22px;
|
||||
color: var(--white);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.comp-meta {
|
||||
color: var(--gray-400);
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
}
|
||||
.comp-description {
|
||||
color: var(--gray-300);
|
||||
font-family: var(--font-body);
|
||||
margin-bottom: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.comp-awards {
|
||||
color: var(--gray-400);
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
}
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn-primary {
|
||||
background: var(--blue);
|
||||
color: var(--white);
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background: var(--blue-light);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.btn-danger {
|
||||
background: rgba(239, 68, 68, 0.2);
|
||||
color: #ef4444;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background: rgba(239, 68, 68, 0.3);
|
||||
}
|
||||
.info-text {
|
||||
color: var(--gray-400);
|
||||
font-family: var(--font-body);
|
||||
font-size: 13px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="admin-header">Competitions Management</h1>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Add New Competition</h2>
|
||||
<div class="add-form">
|
||||
<form method="POST" action="{{ url_for('add_competition') }}" enctype="multipart/form-data">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Season</label>
|
||||
<input type="text" name="season" class="form-input" placeholder="e.g., Into The Deep" list="seasons" required>
|
||||
<datalist id="seasons">
|
||||
{% for season in seasons %}
|
||||
<option value="{{ season }}">
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Event Name</label>
|
||||
<input type="text" name="event_name" class="form-input" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Date</label>
|
||||
<input type="text" name="date" class="form-input" placeholder="e.g., 06/19/2025 or 11/11/23 - 01/06/24" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Description</label>
|
||||
<textarea name="description" class="form-textarea" required></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Awards (optional)</label>
|
||||
<textarea name="awards" class="form-textarea" placeholder="One award per line"></textarea>
|
||||
<p class="info-text">Enter each award on a new line</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Competition Image (optional)</label>
|
||||
<input type="file" name="image" class="form-input" accept="image/*">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Add Competition</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Existing Competitions</h2>
|
||||
<div class="competitions-list">
|
||||
{% for comp in competitions %}
|
||||
<div class="comp-card">
|
||||
<div class="comp-header">
|
||||
<div>
|
||||
<h3 class="comp-title">{{ comp.event_name }}</h3>
|
||||
<p class="comp-meta">{{ comp.season }} · {{ comp.date }}</p>
|
||||
</div>
|
||||
<form method="POST" action="{{ url_for('delete_competition') }}">
|
||||
<input type="hidden" name="id" value="{{ comp.id }}">
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
<p class="comp-description">{{ comp.description }}</p>
|
||||
{% if comp.awards %}
|
||||
<p class="comp-awards">🏆 {{ comp.awards|replace('|', ' · ') }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
110
templates/admin/login.html
Normal file
110
templates/admin/login.html
Normal file
@@ -0,0 +1,110 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Login - Technical Turbulence</title>
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
.login-container {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #000;
|
||||
}
|
||||
.login-box {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 20px;
|
||||
padding: 48px;
|
||||
width: 90%;
|
||||
max-width: 400px;
|
||||
}
|
||||
.login-title {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
margin-bottom: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.form-label {
|
||||
display: block;
|
||||
color: #999;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input {
|
||||
width: 100%;
|
||||
padding: 12px 16px;
|
||||
background: #0d0d0d;
|
||||
border: 1px solid #333;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
.form-input:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
.login-button {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
background: #3b82f6;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.login-button:hover {
|
||||
background: #60a5fa;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.error-message {
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
border: 1px solid rgba(239, 68, 68, 0.3);
|
||||
color: #ef4444;
|
||||
padding: 12px 16px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 24px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-container">
|
||||
<div class="login-box">
|
||||
<h1 class="login-title">Admin Login</h1>
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="error-message">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Password</label>
|
||||
<input type="password" name="password" class="form-input" required autofocus>
|
||||
</div>
|
||||
<button type="submit" class="login-button">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
259
templates/admin/members.html
Normal file
259
templates/admin/members.html
Normal file
@@ -0,0 +1,259 @@
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block title %}Members & Mentors Management{% endblock %}
|
||||
|
||||
{% block extra_styles %}
|
||||
<style>
|
||||
.section {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.section-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: 28px;
|
||||
color: var(--white);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.add-form {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-label {
|
||||
display: block;
|
||||
color: var(--gray-300);
|
||||
margin-bottom: 6px;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input, .form-select {
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
background: #0d0d0d;
|
||||
border: 1px solid #333;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input:focus, .form-select:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
.members-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
.member-card-admin {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 20px;
|
||||
}
|
||||
.member-image-admin {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.member-name-admin {
|
||||
font-family: var(--font-display);
|
||||
font-size: 20px;
|
||||
color: var(--white);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.member-role-admin {
|
||||
color: var(--gray-400);
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.btn-primary {
|
||||
background: var(--blue);
|
||||
color: var(--white);
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background: var(--blue-light);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.btn-danger {
|
||||
background: rgba(239, 68, 68, 0.2);
|
||||
color: #ef4444;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background: rgba(239, 68, 68, 0.3);
|
||||
}
|
||||
.btn-edit {
|
||||
background: rgba(59, 130, 246, 0.2);
|
||||
color: var(--blue);
|
||||
}
|
||||
.btn-edit:hover {
|
||||
background: rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
z-index: 1000;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.modal.active {
|
||||
display: flex;
|
||||
}
|
||||
.modal-content {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 32px;
|
||||
max-width: 500px;
|
||||
width: 90%;
|
||||
}
|
||||
.modal-close {
|
||||
float: right;
|
||||
font-size: 28px;
|
||||
cursor: pointer;
|
||||
color: var(--gray-400);
|
||||
}
|
||||
.modal-close:hover {
|
||||
color: var(--white);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="admin-header">Members & Mentors Management</h1>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Add New Member/Mentor</h2>
|
||||
<div class="add-form">
|
||||
<form method="POST" action="{{ url_for('add_member') }}" enctype="multipart/form-data">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" name="name" class="form-input" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Role</label>
|
||||
<input type="text" name="role" class="form-input" placeholder="e.g., SOFTWARE, HARDWARE" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Type</label>
|
||||
<select name="type" class="form-select" required>
|
||||
<option value="member">Team Member</option>
|
||||
<option value="mentor">Mentor</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Profile Image</label>
|
||||
<input type="file" name="image" class="form-input" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Mentors</h2>
|
||||
<div class="members-grid">
|
||||
{% for mentor in mentors %}
|
||||
<div class="member-card-admin">
|
||||
<img src="{{ url_for('static', filename=mentor.image_path) }}" class="member-image-admin" alt="{{ mentor.name }}">
|
||||
<h3 class="member-name-admin">{{ mentor.name }}</h3>
|
||||
<p class="member-role-admin">{{ mentor.role }}</p>
|
||||
<button onclick="openEditModal('mentor', {{ mentor.id }}, '{{ mentor.name }}', '{{ mentor.role }}')" class="btn btn-edit">Edit</button>
|
||||
<form method="POST" action="{{ url_for('delete_member') }}" style="display: inline;">
|
||||
<input type="hidden" name="id" value="{{ mentor.id }}">
|
||||
<input type="hidden" name="type" value="mentor">
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Team Members</h2>
|
||||
<div class="members-grid">
|
||||
{% for member in members %}
|
||||
<div class="member-card-admin">
|
||||
<img src="{{ url_for('static', filename=member.image_path) }}" class="member-image-admin" alt="{{ member.name }}">
|
||||
<h3 class="member-name-admin">{{ member.name }}</h3>
|
||||
<p class="member-role-admin">{{ member.role }}</p>
|
||||
<button onclick="openEditModal('member', {{ member.id }}, '{{ member.name }}', '{{ member.role }}')" class="btn btn-edit">Edit</button>
|
||||
<form method="POST" action="{{ url_for('delete_member') }}" style="display: inline;">
|
||||
<input type="hidden" name="id" value="{{ member.id }}">
|
||||
<input type="hidden" name="type" value="member">
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="editModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close" onclick="closeEditModal()">×</span>
|
||||
<h2 class="section-title">Edit Member</h2>
|
||||
<form method="POST" action="{{ url_for('update_member') }}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="id" id="edit-id">
|
||||
<input type="hidden" name="type" id="edit-type">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" name="name" id="edit-name" class="form-input" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Role</label>
|
||||
<input type="text" name="role" id="edit-role" class="form-input" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Profile Image (optional)</label>
|
||||
<input type="file" name="image" class="form-input" accept="image/*">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function openEditModal(type, id, name, role) {
|
||||
document.getElementById('edit-id').value = id;
|
||||
document.getElementById('edit-type').value = type;
|
||||
document.getElementById('edit-name').value = name;
|
||||
document.getElementById('edit-role').value = role;
|
||||
document.getElementById('editModal').classList.add('active');
|
||||
}
|
||||
|
||||
function closeEditModal() {
|
||||
document.getElementById('editModal').classList.remove('active');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
163
templates/admin/sponsors.html
Normal file
163
templates/admin/sponsors.html
Normal file
@@ -0,0 +1,163 @@
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block title %}Sponsors Management{% endblock %}
|
||||
|
||||
{% block extra_styles %}
|
||||
<style>
|
||||
.section {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.section-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: 28px;
|
||||
color: var(--white);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.add-form {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-label {
|
||||
display: block;
|
||||
color: var(--gray-300);
|
||||
margin-bottom: 6px;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input {
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
background: #0d0d0d;
|
||||
border: 1px solid #333;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
.sponsors-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
.sponsor-card-admin {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
}
|
||||
.sponsor-logo-admin {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
object-fit: contain;
|
||||
margin-bottom: 16px;
|
||||
background: #0d0d0d;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
}
|
||||
.sponsor-name-admin {
|
||||
font-family: var(--font-display);
|
||||
font-size: 20px;
|
||||
color: var(--white);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.sponsor-url-admin {
|
||||
color: var(--blue);
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
margin-bottom: 16px;
|
||||
word-break: break-all;
|
||||
text-decoration: none;
|
||||
}
|
||||
.sponsor-url-admin:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn-primary {
|
||||
background: var(--blue);
|
||||
color: var(--white);
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background: var(--blue-light);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.btn-danger {
|
||||
background: rgba(239, 68, 68, 0.2);
|
||||
color: #ef4444;
|
||||
width: 100%;
|
||||
}
|
||||
.btn-danger:hover {
|
||||
background: rgba(239, 68, 68, 0.3);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="admin-header">Sponsors Management</h1>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Add New Sponsor</h2>
|
||||
<div class="add-form">
|
||||
<form method="POST" action="{{ url_for('add_sponsor') }}" enctype="multipart/form-data">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Sponsor Name</label>
|
||||
<input type="text" name="name" class="form-input" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Website URL</label>
|
||||
<input type="url" name="website_url" class="form-input" placeholder="https://example.com" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Logo Image</label>
|
||||
<input type="file" name="logo" class="form-input" accept="image/*" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Add Sponsor</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2 class="section-title">Existing Sponsors</h2>
|
||||
<div class="sponsors-grid">
|
||||
{% for sponsor in sponsors %}
|
||||
<div class="sponsor-card-admin">
|
||||
{% if sponsor.logo_path %}
|
||||
<img src="{{ url_for('static', filename=sponsor.logo_path) }}" class="sponsor-logo-admin" alt="{{ sponsor.name }}">
|
||||
{% endif %}
|
||||
<h3 class="sponsor-name-admin">{{ sponsor.name }}</h3>
|
||||
{% if sponsor.website_url %}
|
||||
<a href="{{ sponsor.website_url }}" class="sponsor-url-admin" target="_blank">{{ sponsor.website_url }}</a>
|
||||
{% endif %}
|
||||
<form method="POST" action="{{ url_for('delete_sponsor') }}">
|
||||
<input type="hidden" name="id" value="{{ sponsor.id }}">
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
89
templates/admin/stats.html
Normal file
89
templates/admin/stats.html
Normal file
@@ -0,0 +1,89 @@
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block title %}Stats Management{% endblock %}
|
||||
|
||||
{% block extra_styles %}
|
||||
<style>
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
.stat-card {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #333;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
}
|
||||
.stat-card-header {
|
||||
font-family: var(--font-display);
|
||||
font-size: 20px;
|
||||
color: var(--white);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.form-label {
|
||||
display: block;
|
||||
color: var(--gray-300);
|
||||
margin-bottom: 6px;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input {
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
background: #0d0d0d;
|
||||
border: 1px solid #333;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-input:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
font-family: var(--font-body);
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn-primary {
|
||||
background: var(--blue);
|
||||
color: var(--white);
|
||||
}
|
||||
.btn-primary:hover {
|
||||
background: var(--blue-light);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="admin-header">Stats Management</h1>
|
||||
|
||||
<div class="stats-grid">
|
||||
{% for stat in stats %}
|
||||
<div class="stat-card">
|
||||
<h3 class="stat-card-header">{{ stat.key }}</h3>
|
||||
<form method="POST" action="{{ url_for('update_stat') }}">
|
||||
<input type="hidden" name="id" value="{{ stat.id }}">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Value</label>
|
||||
<input type="text" name="value" class="form-input" value="{{ stat.value }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Label</label>
|
||||
<input type="text" name="label" class="form-input" value="{{ stat.label }}" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user