From b5467f7d6d166e2b32adcde896496a80098b46b4 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 2 Nov 2020 11:46:23 -0800 Subject: [PATCH] Refactor status display --- bookwyrm/templates/book_results.html | 27 ------- .../templates/snippets/book_description.html | 10 ++- bookwyrm/templates/snippets/book_preview.html | 12 +++ bookwyrm/templates/snippets/interaction.html | 12 +-- bookwyrm/templates/snippets/status.html | 19 ++++- .../templates/snippets/status_content.html | 79 ++++++------------- .../templates/snippets/status_header.html | 45 ++++++----- bookwyrm/templates/user_results.html | 18 ----- bookwyrm/templatetags/fr_display.py | 7 +- bookwyrm/views.py | 2 +- 10 files changed, 93 insertions(+), 138 deletions(-) delete mode 100644 bookwyrm/templates/book_results.html create mode 100644 bookwyrm/templates/snippets/book_preview.html delete mode 100644 bookwyrm/templates/user_results.html diff --git a/bookwyrm/templates/book_results.html b/bookwyrm/templates/book_results.html deleted file mode 100644 index 71d3a637c..000000000 --- a/bookwyrm/templates/book_results.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends 'layout.html' %} -{% block content %} -
-

Search results

- {% for result_set in results %} - {% if result_set.results %} -
- {% if not result_set.connector.local %} -

- Results from {% if result_set.connector.name %}{{ result_set.connector.name }}{% else %}{{ result_set.connector.identifier }}{% endif %} -

- {% endif %} - - {% for result in result_set.results %} -
-
- {% csrf_token %} - - -
-
- {% endfor %} -
- {% endif %} - {% endfor %} -
-{% endblock %} diff --git a/bookwyrm/templates/snippets/book_description.html b/bookwyrm/templates/snippets/book_description.html index 21ed73aa4..82f8db37c 100644 --- a/bookwyrm/templates/snippets/book_description.html +++ b/bookwyrm/templates/snippets/book_description.html @@ -1,17 +1,18 @@ {% 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 %}
- + +
- + +
{% else %}
{{ full }} @@ -20,3 +21,4 @@ {% endwith %} {% endif %} {% endwith %} +{% endwith %} diff --git a/bookwyrm/templates/snippets/book_preview.html b/bookwyrm/templates/snippets/book_preview.html new file mode 100644 index 000000000..65a9ae4b8 --- /dev/null +++ b/bookwyrm/templates/snippets/book_preview.html @@ -0,0 +1,12 @@ +
+
+
+ {% include 'snippets/book_cover.html' with book=book %} + {% include 'snippets/shelve_button.html' with book=book %} +
+
+
+

{% include 'snippets/book_titleby.html' with book=book %}

+ {% include 'snippets/book_description.html' with book=book %} +
+
diff --git a/bookwyrm/templates/snippets/interaction.html b/bookwyrm/templates/snippets/interaction.html index a48d8a7ca..97e7d0684 100644 --- a/bookwyrm/templates/snippets/interaction.html +++ b/bookwyrm/templates/snippets/interaction.html @@ -1,4 +1,5 @@ {% load fr_display %} +{% with activity.id|uuid as uuid %} -
+ {% csrf_token %}
-
+ {% csrf_token %}
-
+ {% csrf_token %}
-
+ {% csrf_token %}