2021-02-27 21:48:10 -05:00
{% load i18n %}
2022-01-08 15:05:42 -05:00
{% load interaction %}
2022-01-05 15:55:19 -05:00
2020-03-27 13:11:32 -04:00
{% if request.user == user or not request.user.is_authenticated %}
2022-01-08 15:05:42 -05:00
{# nothing to see here -- either it's yourself or your logged out #}
{% else %}
{% get_relationship user as relationship %}
{% if relationship.is_blocked %}
2021-05-22 23:36:30 -04:00
{% include 'snippets/block_button.html' with blocks=True %}
2020-03-21 17:29:39 -04:00
{% else %}
2021-03-26 13:32:42 -04:00
< div class = "field{% if not minimal %} has-addons{% else %} mb-0{% endif %}" >
2021-02-23 15:10:54 -05:00
< div class = "control" >
2022-01-08 15:05:42 -05:00
< form action = "{% url 'follow' %}" method = "POST" class = "interaction follow_{{ user.id }} {% if relationship.is_following or relationship.is_follow_pending %}is-hidden{%endif %}" data-id = "follow_{{ user.id }}" >
2021-02-23 15:10:54 -05:00
{% csrf_token %}
< input type = "hidden" name = "user" value = "{{ user.username }}" >
2021-08-07 17:38:19 -04:00
< button class = "button is-small{% if not minimal %} is-link{% endif %}" type = "submit" >
{% if show_username %}
{% blocktrans with username=user.localname %}Follow @{{ username }}{% endblocktrans %}
{% else %}
{% trans "Follow" %}
{% endif %}
< / button >
2021-02-23 15:10:54 -05:00
< / form >
2022-01-08 15:05:42 -05:00
< form action = "{% url 'unfollow' %}" method = "POST" class = "interaction follow_{{ user.id }} {% if not relationship.is_following and not relationship.is_follow_pending %}is-hidden{%endif %}" data-id = "follow_{{ user.id }}" >
2021-02-23 15:10:54 -05:00
{% csrf_token %}
< input type = "hidden" name = "user" value = "{{ user.username }}" >
2022-01-08 15:05:42 -05:00
{% if user.manually_approves_followers and not relationship.is_following %}
2021-08-07 17:38:19 -04:00
< button class = "button is-small is-danger is-light" type = "submit" >
{% trans "Undo follow request" %}
< / button >
2021-03-13 17:48:15 -05:00
{% else %}
2021-08-07 17:38:19 -04:00
< button class = "button is-small is-danger is-light" type = "submit" >
{% if show_username %}
{% blocktrans with username=user.localname %}Unfollow @{{ username }}{% endblocktrans %}
{% else %}
{% trans "Unfollow" %}
{% endif %}
< / button >
2021-03-13 17:48:15 -05:00
{% endif %}
2021-02-23 15:10:54 -05:00
< / form >
< / div >
2021-03-26 13:32:42 -04:00
{% if not minimal %}
2021-02-23 15:10:54 -05:00
< div class = "control" >
{% include 'snippets/user_options.html' with user=user class="is-small" %}
< / div >
2021-03-26 13:32:42 -04:00
{% endif %}
2021-02-23 15:10:54 -05:00
< / div >
2022-01-08 15:05:42 -05:00
{% endif %}
2020-02-22 15:57:13 -05:00
{% endif %}