mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-18 14:16:45 +00:00
Indicate reading status changes with comments
This commit is contained in:
parent
48c6a3923a
commit
5fcea99029
4 changed files with 14 additions and 9 deletions
|
@ -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 %}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Reference in a new issue