From cb6c0035d7ee97ee531894e6227df22fffbb7700 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 30 Apr 2021 19:19:10 -0700 Subject: [PATCH] List and user previews --- bookwyrm/templates/directory/directory.html | 56 +-------------- bookwyrm/templates/directory/user_card.html | 57 +++++++++++++++ bookwyrm/templates/search/layout.html | 3 + bookwyrm/templates/search/user.html | 9 ++- bookwyrm/views/search.py | 80 ++++++++++----------- 5 files changed, 105 insertions(+), 100 deletions(-) create mode 100644 bookwyrm/templates/directory/user_card.html diff --git a/bookwyrm/templates/directory/directory.html b/bookwyrm/templates/directory/directory.html index 2fa8a5aea..f97a84814 100644 --- a/bookwyrm/templates/directory/directory.html +++ b/bookwyrm/templates/directory/directory.html @@ -1,7 +1,5 @@ {% extends 'layout.html' %} {% load i18n %} -{% load bookwyrm_tags %} -{% load humanize %} {% block title %}{% trans "Directory" %}{% endblock %} @@ -41,59 +39,7 @@
{% for user in users %}
-
-
- - -
- {% if user.summary %} - {{ user.summary | to_markdown | safe | truncatechars_html:40 }} - {% else %} {% endif %} -
-
-
- {% if user != request.user %} - {% if user.mutuals %} - - {% elif user.shared_books %} - - {% endif %} - {% endif %} - - -
-
+ {% include 'directory/user_card.html' %}
{% endfor %}
diff --git a/bookwyrm/templates/directory/user_card.html b/bookwyrm/templates/directory/user_card.html new file mode 100644 index 000000000..8e7538c89 --- /dev/null +++ b/bookwyrm/templates/directory/user_card.html @@ -0,0 +1,57 @@ +{% load i18n %} +{% load bookwyrm_tags %} +{% load humanize %} + +
+
+ + +
+ {% if user.summary %} + {{ user.summary | to_markdown | safe | truncatechars_html:40 }} + {% else %} {% endif %} +
+
+
+ {% if user != request.user %} + {% if user.mutuals %} + + {% elif user.shared_books %} + + {% endif %} + {% endif %} + + +
+
diff --git a/bookwyrm/templates/search/layout.html b/bookwyrm/templates/search/layout.html index da0f651af..b122d7e25 100644 --- a/bookwyrm/templates/search/layout.html +++ b/bookwyrm/templates/search/layout.html @@ -33,6 +33,7 @@ +{% if query %}