Skip to content

Commit

Permalink
Fix removing team member (open invitations)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Feb 9, 2024
1 parent 68e24bf commit 8a38b58
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions templates/team/member.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,35 @@
<div id="content-team-admin">
{# Hide this section if keycloak groups are used to avoid confusing users #}
{% if not useKeycloakGroups %}
<h3>{% trans %}openInvitations{% endtrans %}</h3>
<ul class="stacked-list !mb-10">
{% for member in team.members |filter(member => member.registerId) %}
<li>
<div>
<p>{{ member.email }}</p>
</div>
<div>
{% if team in member.adminRoles %}
<a href="{{ path('team_mitglieder_admin', {'memberId':member.id}) }}" class="text-danger">
{% trans %}admin.remove{% endtrans %}
</a>
{% else %}
<a href="{{ path('team_mitglieder_admin', {'memberId':member.id}) }}">
{% trans %}admin.create{% endtrans %}
</a>
{% endif %}
<a href="{{ path('team_mitglieder_remove',{'memberId':member.id,'type':'odc'}) }}" class="text-danger">
{% trans from 'general' %}remove{% endtrans %}
</a>
</div>
</li>
{% endfor %}
</ul>
{% set openInvitations = team.members|filter(member => member.registerId) %}
{% if openInvitations|length %}
<h3>{% trans %}openInvitations{% endtrans %}</h3>
<ul class="stacked-list !mb-10">
{% for member in openInvitations %}
<li>
<div>
<p>{{ member.email }}</p>
</div>
<div>
{% if team in member.adminRoles %}
<a href="{{ path('team_mitglieder_admin', {'memberId':member.id, 'teamId':team.id}) }}" class="text-danger">
{% trans %}admin.remove{% endtrans %}
</a>
{% else %}
<a href="{{ path('team_mitglieder_admin', {'memberId':member.id, 'teamId':team.id}) }}">
{% trans %}admin.create{% endtrans %}
</a>
{% endif %}
{% if not useKeycloakGroups and team.isMemberRemovable(member, app.user) %}
<a href="{{ path('team_mitglieder_remove',{'memberId':member.id, 'teamId':team.id, 'type':'odc'}) }}" class="text-danger">
{% trans from 'general' %}remove{% endtrans %}
</a>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}

<h3>{% trans from 'base' %}users{% endtrans %}</h3>
Expand Down

0 comments on commit 8a38b58

Please sign in to comment.