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