{% extends "base.html" %} {% block content %}

Welcome back, {{ current_user.username }}!

Discover new books tailored just for you

{{ user_ratings|length }}

Books Rated

{{ reading_history|length }}

Reading History

{{ "%.1f"|format(current_user.get_average_rating()) }}

Avg Rating

Recommended for You

{% if recommendations %}
{% for book, score, reasons in recommendations %}
{{ book.title }}
{{ "%.0f"|format(score * 100) }}% match

by {{ book.author }}

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

{% for reason in reasons[:2] %} {{ reason }} {% endfor %}
{% set rating = book.get_average_rating() %} {% for i in range(1, 6) %} {% endfor %} ({{ book.get_rating_count() }})
{% endfor %}
{% else %}

No Recommendations Yet

Rate some books to get personalized recommendations!

Browse Books
{% endif %}

Recent Activity

{% if reading_history %}
{% for history in reading_history[:5] %}
{{ history.book.title }}

by {{ history.book.author }}

{{ history.status.replace('_', ' ').title() }}
{{ history.book.genre }}
{% endfor %}
{% else %}

No reading activity yet

{% endif %}

New Arrivals

{% if recent_books %}
{% for book in recent_books %}
{{ book.title }}

by {{ book.author }}

{% set rating = book.get_average_rating() %} {% for i in range(1, 6) %} {% endfor %}
{{ book.genre }}
{% endfor %}
{% else %}

No new books

{% endif %}
{% endblock %} {% block scripts %} {% endblock %}