repman-io/repman

View on GitHub
templates/organization/member/members.html.twig

Summary

Maintainability
Test Coverage
{% extends "base.html.twig" %}

{% block header_btn %}
    {% if is_granted('ROLE_ORGANIZATION_OWNER', organization) %}
        {% if invitations > 0 %}
            <a href="{{ path('organization_invitations', {"organization":organization.alias}) }}" class="mr-5">
                Pending invitations: {{ invitations }}
            </a>
        {% endif %}
        <a href="{{ path('organization_invite_member', {"organization":organization.alias}) }}" class="btn btn-success">
            {% include 'svg/user.svg' %} Invite new member
        </a>
    {% endif %}
{% endblock %}
{% block header %} {{ organization.name }} members:{% endblock %}

{% block content %}

<div class="markdown">
    <table class="table">
        <thead>
            <tr>
                <th>E-mail</th>
                <th>Role</th>
                {% if is_granted('ROLE_ORGANIZATION_OWNER', organization) %}
                    <th>Options</th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% for member in members %}
                <tr>
                    <td>{{ member.email }}</td>
                    <td>{{ member.role }}</td>
                    {% if is_granted('ROLE_ORGANIZATION_OWNER', organization) %}
                        <td>
                            <a class="btn btn-warning btn-sm" href="{{ path('organization_change_member_role', {organization: organization.alias, member: member.userId}) }}">
                                Change role
                            </a>
                            <button
                                    class="btn btn-danger btn-sm"
                                    type="submit"
                                    data-target="confirmation"
                                    data-action="{{ path('organization_remove_member', {organization: organization.alias, member: member.userId}) }}"
                                    data-method="DELETE"
                            >
                                Remove
                            </button>
                        </td>
                    {% endif %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
    {% include 'component/pagination.html.twig' with {'path_name': 'organization_members', 'path_params': {'organization': organization.alias}} %}
</div>
{% endblock %}