Indicate reading status changes with comments

This commit is contained in:
Mouse Reeve 2021-08-16 13:39:56 -07:00
parent 48c6a3923a
commit 5fcea99029
4 changed files with 14 additions and 9 deletions

View file

@ -1,7 +1,8 @@
{% spaceless %}
{% load i18n %}{% load utilities %}
{% load i18n %}
{% load utilities %}
{% load status_display %}
{% with book=status.mention_books.first %}
{% load_book status as book %}
{% blocktrans with book_path=book.remote_id book=book|book_title %}finished reading <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
{% endwith %}
{% endspaceless %}

View file

@ -1,9 +1,8 @@
{% spaceless %}
{% load i18n %}
{% load utilities %}
{% load status_display %}
{% with book=status.mention_books.first %}
{% load_book status as book %}
{% blocktrans with book_path=book.remote_id book=book|book_title %}started reading <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
{% endwith %}
{% endspaceless %}

View file

@ -1,8 +1,8 @@
{% spaceless %}
{% load i18n %}
{% load utilities %}
{% load status_display %}
{% with book=status.mention_books.first %}
{% load_book status as book %}
{% blocktrans with book_path=book.remote_id book=book|book_title %}<a href="{{ user_path }}">{{ username }}</a> wants to read <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
{% endwith %}
{% endspaceless %}

View file

@ -70,7 +70,12 @@ def get_header_template(status):
"""get the path for the status template"""
if isinstance(status, models.Boost):
status = status.boosted_status
header_type = status.reading_status or status.status_type.lower()
try:
header_type = status.reading_status
if not header_type:
raise AttributeError()
except AttributeError:
header_type = status.status_type.lower()
filename = f"snippets/status/headers/{header_type}.html"
header_template = select_template([filename, "snippets/status/headers/note.html"])
return header_template.render({"status": status})