diff --git a/bookwyrm/templates/book.html b/bookwyrm/templates/book.html index 47b994830..f0d488276 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 1352f6f59..000000000 --- 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 ab41d41ea..c675c45f0 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 771e6a85c..d3ed1bc39 100644 --- a/bookwyrm/views.py +++ b/bookwyrm/views.py @@ -511,7 +511,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)