Files
Reklamator/app/routes/landing.py
T

30 lines
950 B
Python
Raw Normal View History

"""Landing page route - product selection"""
from flask import Blueprint, render_template, current_app
from app.models.product import Product
2025-10-17 15:09:38 +02:00
bp = Blueprint('landing', __name__)
2025-10-17 15:09:38 +02:00
@bp.route('/')
def index():
"""Landing page showing all active products for feedback submission
Returns:
Rendered HTML template with:
- List of active products (if any)
- Empty state message (if no active products)
"""
try:
products = Product.load_active()
current_app.logger.info(
f'Landing page accessed: {len(products)} active products available'
)
return render_template('landing/index.html', products=products)
except Exception as e:
current_app.logger.error(
f'Error loading landing page: {e}',
exc_info=True
)
# Graceful degradation - show empty product list
return render_template('landing/index.html', products=[])