- Add profile_image field to Profile model with default value - Update profile edit route to handle profile image file uploads - Add password change route with validation in auth module - Create change password template with form - Update profile template to include image upload with preview - Add password change link to admin sidebar - Update homepage to use dynamic profile image from database
144 lines
5.4 KiB
HTML
144 lines
5.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}Admin Dashboard{% endblock %} - Portfolio</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<style>
|
|
:root {
|
|
--sidebar-width: 250px;
|
|
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
}
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
}
|
|
.sidebar {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
height: 100vh;
|
|
width: var(--sidebar-width);
|
|
background: var(--primary-gradient);
|
|
color: white;
|
|
padding: 0;
|
|
overflow-y: auto;
|
|
}
|
|
.sidebar-header {
|
|
padding: 1.5rem;
|
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
}
|
|
.sidebar-menu {
|
|
padding: 1rem 0;
|
|
}
|
|
.sidebar-menu a {
|
|
color: rgba(255,255,255,0.8);
|
|
text-decoration: none;
|
|
padding: 0.75rem 1.5rem;
|
|
display: block;
|
|
transition: all 0.3s;
|
|
}
|
|
.sidebar-menu a:hover,
|
|
.sidebar-menu a.active {
|
|
background: rgba(255,255,255,0.1);
|
|
color: white;
|
|
}
|
|
.main-content {
|
|
margin-left: var(--sidebar-width);
|
|
padding: 2rem;
|
|
}
|
|
.top-bar {
|
|
background: white;
|
|
padding: 1rem 2rem;
|
|
margin: -2rem -2rem 2rem -2rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
|
}
|
|
.stat-card {
|
|
background: white;
|
|
border-radius: 10px;
|
|
padding: 1.5rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
|
transition: transform 0.3s;
|
|
}
|
|
.stat-card:hover {
|
|
transform: translateY(-5px);
|
|
}
|
|
.btn-gradient {
|
|
background: var(--primary-gradient);
|
|
border: none;
|
|
color: white;
|
|
}
|
|
.btn-gradient:hover {
|
|
opacity: 0.9;
|
|
color: white;
|
|
}
|
|
</style>
|
|
{% block extra_css %}{% endblock %}
|
|
</head>
|
|
<body>
|
|
<!-- Sidebar -->
|
|
<div class="sidebar">
|
|
<div class="sidebar-header">
|
|
<h4 class="mb-0"><i class="fas fa-briefcase me-2"></i>Portfolio Admin</h4>
|
|
<small class="text-white-50">Ciao, {{ current_user.username }}</small>
|
|
</div>
|
|
<nav class="sidebar-menu">
|
|
<a href="{{ url_for('admin.dashboard') }}" class="{% if request.endpoint == 'admin.dashboard' %}active{% endif %}">
|
|
<i class="fas fa-th-large me-2"></i>Dashboard
|
|
</a>
|
|
<a href="{{ url_for('admin.profile_manage') }}" class="{% if 'profile' in request.endpoint %}active{% endif %}">
|
|
<i class="fas fa-user me-2"></i>Profilo
|
|
</a>
|
|
<a href="{{ url_for('admin.skills_manage') }}" class="{% if 'skills' in request.endpoint %}active{% endif %}">
|
|
<i class="fas fa-code me-2"></i>Competenze
|
|
</a>
|
|
<a href="{{ url_for('admin.projects_manage') }}" class="{% if 'projects' in request.endpoint %}active{% endif %}">
|
|
<i class="fas fa-folder-open me-2"></i>Progetti
|
|
</a>
|
|
<a href="{{ url_for('admin.social_links_manage') }}" class="{% if 'social' in request.endpoint %}active{% endif %}">
|
|
<i class="fas fa-share-alt me-2"></i>Link Social
|
|
</a>
|
|
<hr class="border-white my-3 mx-3">
|
|
<a href="{{ url_for('auth.change_password') }}" class="{% if request.endpoint == 'auth.change_password' %}active{% endif %}">
|
|
<i class="fas fa-key me-2"></i>Cambia Password
|
|
</a>
|
|
<a href="{{ url_for('route_home.home') }}" target="_blank">
|
|
<i class="fas fa-external-link-alt me-2"></i>Visualizza Sito
|
|
</a>
|
|
<a href="{{ url_for('auth.logout') }}">
|
|
<i class="fas fa-sign-out-alt me-2"></i>Logout
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
|
|
<!-- Main Content -->
|
|
<div class="main-content">
|
|
<div class="top-bar">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<h3 class="mb-0">{% block page_title %}Dashboard{% endblock %}</h3>
|
|
<div>
|
|
<span class="badge bg-success"><i class="fas fa-check-circle me-1"></i>Online</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html>
|