From e9575cae6c295ccbe4175ca04e5fc90acf6701cc Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 13 Mar 2021 14:48:15 -0800 Subject: [PATCH] Buttons for undoing follow requests --- bookwyrm/templates/snippets/follow_button.html | 14 ++++++-------- bookwyrm/urls.py | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bookwyrm/templates/snippets/follow_button.html b/bookwyrm/templates/snippets/follow_button.html index 419aa211..eddf61cb 100644 --- a/bookwyrm/templates/snippets/follow_button.html +++ b/bookwyrm/templates/snippets/follow_button.html @@ -1,18 +1,12 @@ {% load i18n %} {% if request.user == user or not request.user.is_authenticated %} -{% elif request.user in user.follower_requests.all %} - -
- {% trans "Follow request already sent." %} -
- {% elif user in request.user.blocks.all %} {% include 'snippets/block_button.html' %} {% else %}
- -
diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index b645e943..3ef2a79b 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -188,8 +188,8 @@ urlpatterns = [ re_path(r"^start-reading/(?P\d+)/?$", views.start_reading), re_path(r"^finish-reading/(?P\d+)/?$", views.finish_reading), # following - re_path(r"^follow/?$", views.follow), - re_path(r"^unfollow/?$", views.unfollow), + re_path(r"^follow/?$", views.follow, name="follow"), + re_path(r"^unfollow/?$", views.unfollow, name="unfollow"), re_path(r"^accept-follow-request/?$", views.accept_follow_request), re_path(r"^delete-follow-request/?$", views.delete_follow_request), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)