diff --git a/app.py b/app.py index 69a2d57..2c5661f 100644 --- a/app.py +++ b/app.py @@ -5,14 +5,14 @@ # Enhanced Quart Application with Database and Authentication import asyncio -from quart import Quart, send_from_directory, session, g +from quart import Quart, send_from_directory, session, g, render_template from config import config from models.database import init_database, db_manager from utils.helpers import get_flash_messages from utils.auth import get_current_user # Import Blueprints -from routes.home import route_home +from routes.home import home_bp from routes.auth import auth_bp from routes.dashboard import dashboard_bp @@ -54,7 +54,7 @@ async def robots(): return await send_from_directory(app.static_folder, 'robots.txt') # Register Blueprints -app.register_blueprint(route_home) +app.register_blueprint(home_bp) app.register_blueprint(auth_bp) app.register_blueprint(dashboard_bp) diff --git a/routes/home.py b/routes/home.py index f69d595..e561896 100644 --- a/routes/home.py +++ b/routes/home.py @@ -2,11 +2,56 @@ # -*- coding: utf-8 -*- # Copyright Hersel Giannella +# Home Routes from quart import Blueprint, render_template +from models.project import Project +from models.settings import Settings -route_home = Blueprint('route_home', __name__) +# Blueprint with correct name +home_bp = Blueprint('home', __name__) -@route_home.route('/') -async def home(): - return await render_template('index.html') +@home_bp.route('/') +async def index(): + """Homepage with featured projects""" + # Get featured projects + featured_projects = await Project.get_featured(limit=6) + + # Get site settings + site_name = await Settings.get('site_name', 'Hersel.it') + site_description = await Settings.get('site_description', 'Portfolio personale di Hersel Giannella') + + return await render_template('home/index.html', + featured_projects=featured_projects, + site_name=site_name, + site_description=site_description) + +@home_bp.route('/progetti') +async def projects(): + """Projects page""" + # Get all published projects + projects = await Project.get_all(published_only=True, limit=50) + + return await render_template('home/projects.html', projects=projects) + +@home_bp.route('/progetto/') +async def project_detail(slug): + """Single project page""" + project = await Project.find_by_slug(slug) + if not project: + return await render_template('errors/404.html'), 404 + + return await render_template('home/project_detail.html', project=project) + +@home_bp.route('/about') +async def about(): + """About page""" + return await render_template('home/about.html') + +@home_bp.route('/contatti') +async def contact(): + """Contact page""" + return await render_template('home/contact.html') + +# Keep backward compatibility +route_home = home_bp diff --git a/templates/auth/profile.html b/templates/auth/profile.html new file mode 100644 index 0000000..71e1db5 --- /dev/null +++ b/templates/auth/profile.html @@ -0,0 +1,100 @@ +{% extends "base.html" %} + +{% block title %}Il Mio Profilo - Hersel.it{% endblock %} + +{% block content %} +
+
+
+
+
+
+ +
+

{{ user.full_name }}

+

@{{ user.username }}

+ {% if user.is_admin %} + Amministratore + {% else %} + Utente + {% endif %} +
+
+
+ +
+
+
+
Informazioni Profilo
+
+
+
+
+ Username: +
+
+ {{ user.username }} +
+
+ +
+
+ Email: +
+
+ {{ user.email }} +
+
+ +
+
+ Nome Completo: +
+
+ {{ user.full_name }} +
+
+ +
+
+ Ruolo: +
+
+ {% if user.is_admin %} + Amministratore + {% else %} + Utente + {% endif %} +
+
+ +
+
+ Registrato il: +
+
+ {{ user.created_at.strftime('%d/%m/%Y alle %H:%M') if user.created_at else 'N/D' }} +
+
+ +
+ +
+ {% if user.is_admin %} + + Dashboard + + {% endif %} + + + Logout + +
+
+
+
+
+
+{% endblock %} diff --git a/templates/errors/404.html b/templates/errors/404.html new file mode 100644 index 0000000..4bce03b --- /dev/null +++ b/templates/errors/404.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} + +{% block title %}Pagina Non Trovata - Hersel.it{% endblock %} + +{% block content %} +
+
+
+
+ +

404

+

Pagina Non Trovata

+

+ Spiacente, la pagina che stai cercando non esiste o è stata spostata. +

+ +
+
+
+
+{% endblock %} diff --git a/templates/errors/500.html b/templates/errors/500.html new file mode 100644 index 0000000..72ac12b --- /dev/null +++ b/templates/errors/500.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} + +{% block title %}Errore del Server - Hersel.it{% endblock %} + +{% block content %} +
+
+
+
+ +

500

+

Errore del Server

+

+ Si è verificato un errore interno del server. + Il problema è stato segnalato e verrà risolto al più presto. +

+ +
+
+
+
+{% endblock %} diff --git a/templates/home/index.html b/templates/home/index.html new file mode 100644 index 0000000..d8446ce --- /dev/null +++ b/templates/home/index.html @@ -0,0 +1,213 @@ +{% extends "base.html" %} + +{% block title %}{{ site_name }} - {{ site_description }}{% endblock %} + +{% block content %} + +
+
+
+
+

Ciao, sono Hersel Giannella

+

{{ site_description }}

+ +
+
+
+ +
+
+
+
+
+ + +
+
+
+

Progetti in Evidenza

+

Alcuni dei miei lavori più interessanti

+
+ + {% if featured_projects %} +
+ {% for project in featured_projects %} +
+
+ {% if project.image_url %} + {{ project.title }} + {% else %} +
+ +
+ {% endif %} + +
+
{{ project.title }}
+

{{ project.description[:100] }}{% if project.description|length > 100 %}...{% endif %}

+ + {% if project.technologies %} +
+ {% for tech in project.technologies[:3] %} + {{ tech }} + {% endfor %} + {% if project.technologies|length > 3 %} + +{{ project.technologies|length - 3 }} + {% endif %} +
+ {% endif %} + +
+
+ + Dettagli + + {% if project.github_url %} + + GitHub + + {% endif %} +
+ {% if project.demo_url %} + + Demo + + {% endif %} +
+
+
+
+ {% endfor %} +
+ + + {% else %} +
+ +

Progetti in arrivo

+

Sto lavorando su alcuni progetti interessanti!

+
+ {% endif %} +
+
+ + +
+
+
+

Le Mie Competenze

+

Tecnologie e strumenti che utilizzo

+
+ +
+
+
+
+ +
+
Backend Development
+

Python, Quart, Flask, FastAPI

+
+
+ +
+
+
+ +
+
Frontend Development
+

HTML, CSS, JavaScript, Bootstrap

+
+
+ +
+
+
+ +
+
Database
+

MySQL, PostgreSQL, MongoDB

+
+
+ +
+
+
+ +
+
DevOps & Tools
+

Docker, Git, Linux, CI/CD

+
+
+
+
+
+ + +
+
+
+

Parliamo del Tuo Progetto

+

Sono sempre interessato a nuove opportunità e collaborazioni

+
+ +
+
+
+
+
+ +
+
Email
+ info@hersel.it +
+ +
+
+ +
+
GitHub
+ BluLupo +
+ +
+
+ +
+
LinkedIn
+ Hersel Giannella +
+
+ + +
+
+
+
+{% endblock %} + +{% block extra_head %} + +{% endblock %} diff --git a/templates/home/projects.html b/templates/home/projects.html new file mode 100644 index 0000000..6f3454b --- /dev/null +++ b/templates/home/projects.html @@ -0,0 +1,75 @@ +{% extends "base.html" %} + +{% block title %}Progetti - Hersel.it{% endblock %} + +{% block content %} +
+
+

I Miei Progetti

+

Una raccolta dei lavori che ho realizzato

+
+ + {% if projects %} +
+ {% for project in projects %} +
+
+ {% if project.image_url %} + {{ project.title }} + {% else %} +
+ +
+ {% endif %} + +
+
+
{{ project.title }}
+

{{ project.description[:150] }}{% if project.description|length > 150 %}...{% endif %}

+ + {% if project.technologies %} +
+ {% for tech in project.technologies[:4] %} + {{ tech }} + {% endfor %} + {% if project.technologies|length > 4 %} + +{{ project.technologies|length - 4 }} + {% endif %} +
+ {% endif %} +
+ +
+
+ + Dettagli + + {% if project.github_url %} + + Codice + + {% endif %} +
+ {% if project.demo_url %} + + Demo Live + + {% endif %} +
+
+
+
+ {% endfor %} +
+ {% else %} +
+ +

Nessun progetto disponibile

+

Sto lavorando su alcuni progetti interessanti!

+ + Torna alla Home + +
+ {% endif %} +
+{% endblock %}