From 5237e88abab9cce0f0120cfb3d67ebbb29c5ff30 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 2 Oct 2021 13:48:53 +1000 Subject: [PATCH] remove user button for groups --- bookwyrm/templates/groups/members.html | 20 ++-------------- .../snippets/remove_from_group_button.html | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 bookwyrm/templates/snippets/remove_from_group_button.html diff --git a/bookwyrm/templates/groups/members.html b/bookwyrm/templates/groups/members.html index 3ee27db6..bd91b418 100644 --- a/bookwyrm/templates/groups/members.html +++ b/bookwyrm/templates/groups/members.html @@ -20,24 +20,8 @@ Manager {% endif %} - - {% include 'snippets/add_to_group_button.html' with user=member group=group minimal=True %} - {% if member.mutuals %} -

- {% blocktrans trimmed with mutuals=member.mutuals|intcomma count counter=member.mutuals %} - {{ mutuals }} follower you follow - {% plural %} - {{ mutuals }} followers you follow{% endblocktrans %} -

- {% elif member.shared_books %} -

- {% blocktrans trimmed with shared_books=member.shared_books|intcomma count counter=member.shared_books %} - {{ shared_books }} book on your shelves - {% plural %} - {{ shared_books }} books on your shelves - {% endblocktrans %} -

- {% elif request.user in member.following.all %} + {% include 'snippets/remove_from_group_button.html' with user=member group=group minimal=True %} + {% if request.user in member.following.all %}

{% trans "Follows you" %}

diff --git a/bookwyrm/templates/snippets/remove_from_group_button.html b/bookwyrm/templates/snippets/remove_from_group_button.html new file mode 100644 index 00000000..938f48b2 --- /dev/null +++ b/bookwyrm/templates/snippets/remove_from_group_button.html @@ -0,0 +1,23 @@ +{% load i18n %} +{% load bookwyrm_group_tags %} +{% if request.user == user or not request.user == group.user or not request.user.is_authenticated %} +{% elif user in request.user.blocks.all %} +{% include 'snippets/block_button.html' with blocks=True %} +{% else %} +
+
+
+ {% csrf_token %} + + + +
+
+
+{% endif %}