bookwyrm-mastodon/fedireads/templates/feed.html

98 lines
3.7 KiB
HTML
Raw Normal View History

2020-01-25 18:25:19 -05:00
{% extends 'layout.html' %}
2020-01-29 18:10:32 -05:00
{% load fr_display %}
2020-01-25 18:25:19 -05:00
{% block content %}
<div id="sidebar">
2020-01-28 20:23:38 -05:00
<div>
<h2>Currently Reading</h2>
{# listing books currently on user's shelves #}
2020-01-29 03:05:58 -05:00
{% if not reading.books.all %}
2020-01-28 20:23:38 -05:00
<p>Start a book!</p>
2020-01-29 03:05:58 -05:00
{% for book in to_read.books.all %}
<div class="book-preview">
{% include 'snippets/book.html' with book=book size="small" %}
2020-02-15 17:38:46 -05:00
<form name="shelve" action="/shelve/{{ user.localname }}/reading/{{ book.id }}" method="post">
2020-01-29 15:53:12 -05:00
{% csrf_token %}
2020-01-29 03:22:48 -05:00
<input type="hidden" name="book" value="book.id"></input>
<button type="submit">Start reading</button>
</form>
2020-01-29 03:05:58 -05:00
</div>
{% endfor %}
2020-01-25 18:25:19 -05:00
{% endif %}
2020-01-29 03:05:58 -05:00
{% for book in reading.books.all %}
2020-01-28 20:23:38 -05:00
<div class="book-preview">
{% include 'snippets/book.html' with book=book size="small" %}
2020-02-15 17:38:46 -05:00
<form name="shelve" action="/shelve/{{ user.localname }}/read/{{ book.id }}" method="post">
2020-01-29 15:53:12 -05:00
{% csrf_token %}
2020-01-29 03:22:48 -05:00
<input type="hidden" name="book" value="book.id"></input>
<button type="submit">I'm done!</button>
</form>
2020-01-28 20:23:38 -05:00
</div>
{% endfor %}
2020-01-25 18:25:19 -05:00
</div>
2020-01-28 20:23:38 -05:00
<div>
<h2>Recently Added Books</h2>
2020-01-26 20:55:02 -05:00
{% for book in recent_books %}
<div class="book-preview">
{% include 'snippets/book.html' with book=book size="small" %}
2020-01-28 20:23:38 -05:00
{% if not book in user_books.all %}
2020-02-15 17:38:46 -05:00
<form name="shelve" action="/shelve/{{ user.localname }}/to-read/{{ book.id }}" method="post">
2020-01-29 15:53:12 -05:00
{% csrf_token %}
2020-01-26 20:55:02 -05:00
<input type="hidden" name="book" value="book.id"></input>
2020-01-28 18:23:49 -05:00
<button type="submit">Want to read</button>
2020-01-26 20:55:02 -05:00
</form>
{% endif %}
</div>
{% endfor %}
</div>
2020-01-28 20:23:38 -05:00
</div>
<div id="feed">
2020-01-27 21:47:54 -05:00
{% for activity in activities %}
2020-01-25 18:25:19 -05:00
<div class="update">
2020-01-28 20:23:38 -05:00
<h2>
{% include 'snippets/avatar.html' with user=activity.user %}
{% include 'snippets/username.html' with user=activity.user %}
{% if activity.status_type == 'Review' %}
2020-01-28 20:23:38 -05:00
{# display a review #}
reviewed {{ activity.book.data.title }}
</h2>
<div class="book-preview review">
{% include 'snippets/book.html' with book=activity.book size=large %}
2020-01-28 20:23:38 -05:00
<h3>{{ activity.name }}</h3>
<p>{{ activity.rating | stars }}</p>
<p>{{ activity.content | safe }}</p>
2020-01-28 20:23:38 -05:00
</div>
2020-02-18 00:39:08 -05:00
<div class="interaction">
2020-02-19 03:13:06 -05:00
<form name="favorite" action="/favorite/{{ activity.id }}" method="post">
{% csrf_token %}
<button>⭐️ Like</button>
</form>
2020-02-18 00:39:08 -05:00
<form name="comment" action="/comment" method="post">
{% csrf_token %}
<input type="hidden" name="review" value="{{ activity.id }}"></input>
{{ comment_form.content }}
<button type="submit">Comment</button>
</form>
</div>
{% elif activity.status_type == 'Note' %}
2020-02-15 16:07:57 -05:00
posted</h2>
{{ activity.content | safe }}
2020-02-16 21:45:25 -05:00
{% for book in activity.mention_books.all %}
<div class="book-preview review">
{% include 'snippets/book.html' with book=book size=large description=True %}
</div>
{% endfor %}
2020-01-28 20:23:38 -05:00
{% else %}
{# generic handling for a misc activity, which perhaps should not be displayed at all #}
did {{ activity.activity_type }}
</h2>
{% endif %}
2020-01-25 18:25:19 -05:00
</div>
2020-01-27 21:47:54 -05:00
{% endfor %}
2020-01-25 18:25:19 -05:00
</div>
{% endblock %}