{% extends 'layout.html' %} {% block content %}
{% 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 }}

{{ book.data.description }}

{{ 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 %}