mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-24 00:50:35 +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 %}
|
{% 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 %}
|
{% blocktrans with book_path=book.remote_id book=book|book_title %}finished reading <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
||||||
{% endwith %}
|
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load utilities %}
|
{% 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 %}
|
{% blocktrans with book_path=book.remote_id book=book|book_title %}started reading <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
||||||
{% endwith %}
|
|
||||||
|
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load utilities %}
|
{% 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 %}
|
{% 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 %}
|
{% endspaceless %}
|
||||||
|
|
|
@ -70,7 +70,12 @@ def get_header_template(status):
|
||||||
"""get the path for the status template"""
|
"""get the path for the status template"""
|
||||||
if isinstance(status, models.Boost):
|
if isinstance(status, models.Boost):
|
||||||
status = status.boosted_status
|
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"
|
filename = f"snippets/status/headers/{header_type}.html"
|
||||||
header_template = select_template([filename, "snippets/status/headers/note.html"])
|
header_template = select_template([filename, "snippets/status/headers/note.html"])
|
||||||
return header_template.render({"status": status})
|
return header_template.render({"status": status})
|
||||||
|
|
Loading…
Reference in a new issue