diff --git a/bookwyrm/templates/discover/card-header.html b/bookwyrm/templates/discover/card-header.html new file mode 100644 index 000000000..0eb9a678c --- /dev/null +++ b/bookwyrm/templates/discover/card-header.html @@ -0,0 +1,26 @@ +{% load i18n %} +{% load utilities %} + +{% with user_path=status.user.local_path username=status.user.display_name book_path=status.book.local_poth book_title=book|book_title %} + +{% if status.status_type == 'GeneratedNote' %} + {{ status.content|safe }} +{% elif status.status_type == 'Rating' %} + {% blocktrans trimmed %} + {{ username }} rated {{ book_title }} + {% endblocktrans %} +{% elif status.status_type == 'Review' %} + {% blocktrans trimmed %} + {{ username }} reviewed {{ book_title }} + {% endblocktrans %} +{% elif status.status_type == 'Comment' %} + {% blocktrans trimmed %} + {{ username }} commented on {{ book_title }} + {% endblocktrans %} +{% elif status.status_type == 'Quotation' %} + {% blocktrans trimmed %} + {{ username }} quoted {{ book_title }} + {% endblocktrans %} +{% endif %} + +{% endwith %} diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/discover/large-book.html index 6d80c3daf..1fa0afb92 100644 --- a/bookwyrm/templates/discover/large-book.html +++ b/bookwyrm/templates/discover/large-book.html @@ -36,23 +36,7 @@

- - {{ status.user.display_name }} - - - {% if status.status_type == 'GeneratedNote' %} - {{ status.content|safe }} - {% elif status.status_type == 'Rating' %} - {% trans "rated" %} - {% elif status.status_type == 'Review' %} - {% trans "reviewed" %} - {% elif status.status_type == 'Comment' %} - {% trans "commented on" %} - {% elif status.status_type == 'Quotation' %} - {% trans "quoted" %} - {% endif %} - - {{ book.title }} + {% include "discover/card-header.html" %}

diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/discover/small-book.html index 5b2070188..76732ca14 100644 --- a/bookwyrm/templates/discover/small-book.html +++ b/bookwyrm/templates/discover/small-book.html @@ -22,23 +22,7 @@

- - {{ status.user.display_name }} - - - {% if status.status_type == 'GeneratedNote' %} - {{ status.content|safe }} - {% elif status.status_type == 'Rating' %} - {% trans "rated" %} - {% elif status.status_type == 'Review' %} - {% trans "reviewed" %} - {% elif status.status_type == 'Comment' %} - {% trans "commented on" %} - {% elif status.status_type == 'Quotation' %} - {% trans "quoted" %} - {% endif %} - - {{ book.title }} + {% include "discover/card-header.html" %}

{% if status.rating %}