"""Landing page route - product selection""" from flask import Blueprint, render_template, current_app from app.models.product import Product bp = Blueprint('landing', __name__) @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=[])