<div class="table-responsive">
    <table class="table table-striped table-bordered table-hover datatable" >
        <thead>
        <tr>
            <th>ID</th>
            <th>Rolle</th>
            <th>Name</th>
            <th>Straße</th>
            <th>Postleitzahl</th>
            <th>Stadt</th>
            <th>Telefon/Mobile</th>
            <th>Manager Zugriff</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <% for ( let mi = 0; mi < members.length; mi++ )    {   %>
        <tr>
            <td><%= members[ mi ].id %></td>
            <td><%= members[ mi ].getRoleName() %></td>
            <td><%= members[ mi ].getName() %></td>
            <td><%= members[ mi ].street ? members[ mi ].street : '' %></td>
            <td><%= members[ mi ].zip ? members[ mi ].zip : '' %></td>
            <td><%= members[ mi ].city ? members[ mi ].city : '' %></td>
            <td><%= members[ mi ].phone ? members[ mi ].phone : '---' %> / <%= members[ mi ].mobile ? members[ mi ].mobile : '---' %></td>
            <td class="text-center">
                <% if ( members[ mi ].hasManagerAccess() ) {    %>

                    <span class="badge badge-primary">
                        Zugriff gewährt
                    </span>

                <% } else { %>

                    <span class="badge badge-danger">
                        Kein Zugriff
                    </span>

                <% }    %>
            </td>
            <td class="text-center">
                <% if ( false === members[ mi ].isGroupOwner() )    {   %>

                    <% if ( members[ mi ].hasManagerAccess() ) {    %>

                        <button type="button"
                                data-type="btnRemoveManagerAccess"
                                data-member-id="<%= members[ mi ].id %>"
                                class="btn btn-sm btn-primary">
                            <i class="fa fa-minus-square"></i>
                        </button>

                    <% } else { %>

                        <button type="button"
                                data-type="btnGrantManagerAccess"
                                data-member-id="<%= members[ mi ].id %>"
                                class="btn btn-sm btn-primary">
                            <i class="fa fa-plus-square"></i>
                        </button>

                    <% }    %>

                <% }    %>
            </td>
        </tr>
        <% }    %>
        </tbody>
    </table>
</div>