diff --git a/bookwyrm/templates/book.html b/bookwyrm/templates/book.html index a0d2fa2e..b0064e1f 100644 --- a/bookwyrm/templates/book.html +++ b/bookwyrm/templates/book.html @@ -55,7 +55,7 @@
{{ book.parent_work.edition_set.count }} editions
diff --git a/bookwyrm/templates/snippets/book_description.html b/bookwyrm/templates/snippets/book_description.html deleted file mode 100644 index 1352f6f5..00000000 --- a/bookwyrm/templates/snippets/book_description.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load fr_display %} -{% with book.id|uuid as uuid %} -{% with book|book_description as full %} -{% if full %} - {% with full|text_overflow as trimmed %} - {% if trimmed != full %} -{{ full }} -- {% endif %} - {% endwith %} -{% endif %} -{% endwith %} -{% endwith %} diff --git a/bookwyrm/templates/snippets/book_preview.html b/bookwyrm/templates/snippets/book_preview.html index ab41d41e..c675c45f 100644 --- a/bookwyrm/templates/snippets/book_preview.html +++ b/bookwyrm/templates/snippets/book_preview.html @@ -1,3 +1,4 @@ +{% load fr_display %}
{{ status.content | safe }}+ {% include 'snippets/trimmed_text.html' with full=status.content|safe %} {% endif %}
{{ full }}+{% endif %} +{% endwith %} + +{% endif %} +{% endwith %} + diff --git a/bookwyrm/views.py b/bookwyrm/views.py index b40a75a7..38e882cd 100644 --- a/bookwyrm/views.py +++ b/bookwyrm/views.py @@ -515,7 +515,11 @@ def book_page(request, book_id): except ValueError: page = 1 - book = models.Book.objects.select_subclasses().get(id=book_id) + try: + book = models.Book.objects.select_subclasses().get(id=book_id) + except models.Book.DoesNotExist: + return HttpResponseNotFound() + if is_api_request(request): return JsonResponse(book.to_activity(), encoder=ActivityEncoder)