2020-03-27 17:11:32 +00:00
{% if request.user == user or not request.user.is_authenticated %}
2020-03-13 17:21:00 +00:00
{% elif request.user in user.follower_requests.all %}
2020-03-21 21:29:39 +00:00
2020-03-13 14:56:50 +00:00
< div >
Follow request already sent.
< / div >
2020-03-21 21:29:39 +00:00
{% 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 %}
2020-04-21 17:47:55 +00:00
< input type = "hidden" name = "user" value = "{{ user.username }}" >
2020-03-14 14:09:10 +00:00
{% if user.manually_approves_followers %}
2020-11-06 23:20:11 +00:00
< button class = "button is-small is-primary" type = "submit" > Send follow request< / button >
2020-03-14 14:09:10 +00:00
{% else %}
2020-11-06 23:20:11 +00:00
< button class = "button is-small is-primary" type = "submit" > Follow< / button >
2020-03-14 14:09:10 +00:00
{% endif %}
2020-02-22 20:57:13 +00:00
< / form >
2020-03-21 21:29:39 +00:00
< 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 %}
2020-04-21 17:47:55 +00:00
< 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 %}