mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-11 02:36:37 +00:00
b072bd50d5
Fixes #92
24 lines
999 B
HTML
24 lines
999 B
HTML
{% 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 }}">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="user" value="{{ user.username }}"></input>
|
|
{% if user.manually_approves_followers %}
|
|
<button type="submit">Send follow request</button>
|
|
{% else %}
|
|
<button type="submit">Follow</button>
|
|
{% endif %}
|
|
</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 }}">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="user" value="{{ user.username }}"></input>
|
|
<button type="submit">Unfollow</button>
|
|
</form>
|
|
{% endif %}
|