2021-09-25 01:11:58 +00:00
{% load i18n %}
2022-01-18 20:30:46 +00:00
{% load group_tags %}
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 %}
2021-10-16 05:43:09 +00:00
< div class = "field mb-0" >
2021-09-25 01:11:58 +00:00
< div class = "control" >
2021-10-02 00:47:42 +00:00
< form action = "{% url 'invite-group-member' %}" method = "POST" class = "interaction add_{{ user.id }} {% if group|is_member:user or group|is_invited:user %}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-10-16 05:43:09 +00:00
< button class = "button is-small" type = "submit" >
2021-10-02 00:47:42 +00:00
{% trans "Invite" %}
2021-09-25 01:11:58 +00:00
< / button >
< / form >
2021-10-02 02:30:48 +00:00
< form action = "{% url 'remove-group-member' %}" method = "POST" class = "interaction add_{{ user.id }} {% if not group|is_member:user and not group|is_invited:user %}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-10-02 02:30:48 +00:00
{% if not group|is_member:user %}
2021-09-25 01:11:58 +00:00
< button class = "button is-small is-danger is-light" type = "submit" >
2021-10-16 05:43:09 +00:00
{% trans "Uninvite" %}
2021-09-25 01:11:58 +00:00
< / button >
{% else %}
< button class = "button is-small is-danger is-light" type = "submit" >
2021-10-16 05:43:09 +00:00
{% blocktrans with username=user.localname %}Remove @{{ username }}{% endblocktrans %}
2021-10-04 11:20:02 +00:00
< / button >
2021-10-16 05:43:09 +00:00
{% endif %}
2021-09-25 01:11:58 +00:00
< / form >
< / div >
< / div >
{% endif %}