{% extends 'layout.html' %} {% block content %}
{# a display of books in your local db, so you have somewhere to start #} {% for book in recent_books %}

{{ book.data.title }} by {# TODO: there should be a helper function for listing authors #} {{ book.authors.first.data.name }}

{% if not book.user_shelves %}
{% endif %}
{% endfor %}
{% for activity in activities %}
{# TODO: a helper function for displaying a username #} {% if activity.user.localname %}{{ activity.user.localname }}{% else %}{{ activity.user.username }}{% endif %} {% if activity.fedireads_type == 'Shelve' %} {# display a reading/shelving activity #} {% if activity.shelf.shelf_type == 'to-read' %} wants to read {% elif activity.shelf.shelf_type == 'read' %} finished reading {% elif activity.shelf.shelf_type == 'reading' %} started reading {% else %} shelved in "{{ activity.shelf.name }}" {% endif %} {# TODO: wouldn't it rule if this was a reusable piece of markup? #} {% elif activity.fedireads_type == 'Review' %} {# display a review #} reviewed {{ activity.book.data.title }}

{{ activity.book.data.title }} by {{ activity.book.authors.first.data.name }}

{{ activity.name }}

{{ activity.rating }} stars

{{ activity.review_content }}

{% elif activity.activity_type == 'Follow' %} started following someone {% else %} {# generic handling for a misc activity, which perhaps should not be displayed at all #} did {{ activity.activity_type }}
{% endif %}
{% endfor %}
{% endblock %}