2021-09-25 01:11:58 +00:00
{% load i18n %}
2021-09-27 05:36:41 +00:00
{% if request.user == user or not request.user == group.user or not request.user.is_authenticated %}
2021-09-25 01:11:58 +00:00
{% elif user in request.user.blocks.all %}
{% include 'snippets/block_button.html' with blocks=True %}
{% else %}
< div class = "field{% if not minimal %} has-addons{% else %} mb-0{% endif %}" >
< div class = "control" >
2021-09-25 07:34:44 +00:00
< form action = "{% url 'add-group-member' %}" method = "POST" class = "interaction add_{{ user.id }} {% if user in group.members.all %}is-hidden{%endif %}" data-id = "add_{{ user.id }}" >
2021-09-25 01:11:58 +00:00
{% csrf_token %}
2021-09-25 07:34:44 +00:00
< input type = "hidden" name = "group" value = "{{ group.id }}" >
2021-09-25 01:11:58 +00:00
< input type = "hidden" name = "user" value = "{{ user.username }}" >
2021-09-27 11:48:40 +00:00
{% if user.local %}
2021-09-25 01:11:58 +00:00
< button class = "button is-small{% if not minimal %} is-link{% endif %}" type = "submit" >
{% if show_username %}
2021-09-25 07:34:44 +00:00
{% blocktrans with username=user.localname %}Add @{{ username }}{% endblocktrans %}
2021-09-25 01:11:58 +00:00
{% else %}
2021-09-25 07:34:44 +00:00
{% trans "Add" %}
2021-09-25 01:11:58 +00:00
{% endif %}
< / button >
2021-09-27 11:48:40 +00:00
{% else %}
<!-- TODO: This is an incredibly ugly hack until group are AP enabled -->
< span > < em > Remote User< / em > < / span >
{% endif %}
2021-09-25 01:11:58 +00:00
< / form >
2021-09-25 07:34:44 +00:00
< form action = "{% url 'remove-group-member' %}" method = "POST" class = "interaction add_{{ user.id }} {% if user not in group.members.all %}is-hidden{%endif %}" data-id = "add_{{ user.id }}" >
2021-09-25 01:11:58 +00:00
{% csrf_token %}
2021-09-25 07:34:44 +00:00
< input type = "hidden" name = "group" value = "{{ group.id }}" >
2021-09-25 01:11:58 +00:00
< input type = "hidden" name = "user" value = "{{ user.username }}" >
{% if user.manually_approves_followers and request.user not in user.followers.all %}
< button class = "button is-small is-danger is-light" type = "submit" >
{% trans "Undo follow request" %}
< / button >
{% else %}
< button class = "button is-small is-danger is-light" type = "submit" >
{% if show_username %}
2021-09-25 07:34:44 +00:00
{% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %}
2021-09-25 01:11:58 +00:00
{% else %}
2021-09-25 07:34:44 +00:00
{% trans "Remove" %}
2021-09-25 01:11:58 +00:00
{% endif %}
< / button >
{% endif %}
< / form >
< / div >
{% if not minimal %}
< div class = "control" >
{% include 'snippets/user_options.html' with user=user class="is-small" %}
< / div >
{% endif %}
< / div >
{% endif %}