moviewyrm/bookwyrm/templates/snippets/follow_button.html

25 lines
1.1 KiB
HTML
Raw Normal View History

2020-03-27 17:11:32 +00:00
{% if request.user == user or not request.user.is_authenticated %}
{% elif request.user in user.follower_requests.all %}
<div>
Follow request already sent.
</div>
{% else %}
<form action="/follow/" method="POST" onsubmit="interact(event)" class="follow-{{ user.id }} {% if request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
2020-02-22 20:57:13 +00:00
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
{% if user.manually_approves_followers %}
2021-01-10 18:21:23 +00:00
<button class="button is-small is-link" type="submit">Send follow request</button>
{% else %}
2021-01-10 18:21:23 +00:00
<button class="button is-small is-link" type="submit">Follow</button>
{% endif %}
2020-02-22 20:57:13 +00:00
</form>
<form action="/unfollow/" method="POST" onsubmit="interact(event)" class="follow-{{ user.id }} {% if not request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
2020-02-22 20:57:13 +00:00
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
2020-11-09 20:10:37 +00:00
<button class="button is-small is-danger is-light" type="submit">Unfollow</button>
2020-02-22 20:57:13 +00:00
</form>
{% endif %}