{% extends "base.html" %} {% block title %}Profile - {{ current_user.username }}{% endblock %} {% block content %}

Welcome, {{ current_user.username }}!

Manage your ratings and discover personalized recommendations

{{ user_ratings|length }}

Products Rated

{{ browsing_history|length }}

Products Viewed

{% if user_ratings %}{{ "%.1f"|format(current_user.get_average_rating()) }}{% else %}0.0{% endif %}

Average Rating

Your Personalized Recommendations

{% if recommendations %}
{% for product in recommendations %}
{% if product.image_url %} {{ product.name }} {% else %}
{% endif %}
{{ product.name }}

{{ product.description[:80] }}{% if product.description|length > 80 %}...{% endif %}

{{ product.category }}
{% set avg_rating = product.get_average_rating() %} {% if avg_rating > 0 %} {% for i in range(5) %} {% if i < avg_rating %}★{% else %}☆{% endif %} {% endfor %} ({{ product.get_rating_count() }}) {% else %} No ratings yet {% endif %}
${{ "%.2f"|format(product.price) }} View Details
{% endfor %}
{% else %}
Start rating products to get personalized recommendations!

Rate a few products to help our AI understand your preferences and provide better recommendations.

Browse Products
{% endif %}

Your Ratings & Reviews

{% if user_ratings %}
{% for rating in user_ratings %}
{% if rating.product.image_url %} {{ rating.product.name }} {% else %}
{% endif %}
{{ rating.product.name }}

{{ rating.product.category }}

{% if rating.review %}

"{{ rating.review }}"

{% endif %}
{% for i in range(5) %} {% if i < rating.rating %}★{% else %}☆{% endif %} {% endfor %}
{{ rating.rating }}/5
{{ rating.created_at.strftime('%b %d, %Y') }}
Update Rating
{% endfor %}
{% else %}
You haven't rated any products yet!

Start rating products to track your preferences and improve your recommendations.

Browse Products
{% endif %}

Recently Viewed Products

{% if browsing_history %}
{% for history in browsing_history %}
{% if history.product.image_url %} {{ history.product.name }} {% else %}
{% endif %}
{{ history.product.name }}

${{ "%.2f"|format(history.product.price) }}

{{ history.viewed_at.strftime('%b %d') }}
{% endfor %}
{% else %}
No browsing history yet!

Products you view will appear here for easy access.

{% endif %}
{% endblock %}