<h4>
    <a href="#/configuration/privacy"><i class="fas fa-chevron-left"></i></a>&nbsp;<%= _lc( 'CONFIGURATION_EDIT_PRIVACY' ) %>
    <%=raw app.core.View.getTemplate( 'gui-header-help-button' ) %>
</h4>
<div class="row">
    <div class="col-sm-12">
        <div class="card">
            <div class="card-body no-padding">
                <div class="table-responsive">
                    <table class="table table-borderless table-configuration-profile-privacy">
                        <thead>
                        <tr>
                            <th><%= _lc( 'GROUP' ) %></th>
                            <th><%= _lc( 'ROLE' ) %></th>
                            <th><%= _lc( 'VISIBILITY' ) %></th>
                        </tr>
                        </thead>
                        <tbody>
                        <% for ( var gi = 0; gi < groups.length; gi++ ) { %>
                        <tr class="">
                            <td>
                                <%= groups[ gi ].getName() %>
                            </td>
                            <td>
                                <%= p.getRolenameInGroup( groups[ gi ].getId() ) %>
                            </td>
                            <td>
                                <select class="form-control form-control-sm"
                                        <%= p.isAdminOfGroup( groups[ gi ].getId() ) ? 'disabled="disabled"' : '' %>
                                        data-type="select-profile-visibility"
                                        data-team-id="<%= groups[ gi ].getId() %>">
                                    <option value="0">
                                        <%= _lc( 'VISIBLE_FOR_ALL_GROUP_MEMBERS' ) %>
                                    </option>
                                    <option value="1"
                                        <%= p.isAnonymousInGroup( groups[ gi ].getId() ) ? 'selected="selected"' : '' %> >
                                        <%= _lc( 'ONLY_VISIBLE_FOR_ADMINS' ) %>
                                    </option>
                                </select>
                            </td>
                        </tr>
                        <% }    %>
                        </tbody>
                    </table>
                </div>
                <%=raw app.core.View.getTemplate( 'gui-form-help', { help : _lc( 'FORMHELP_PROFILE_PRIVACY' ) } ) %>
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col">
                        <a href="#/configuration/privacy"
                           class="btn btn-sm btn-secondary">
                            <%= _lc( 'BTN_CANCEL' ) %>
                        </a>
                        <button type="button"
                                data-id="btn-save"
                                class="btn btn-sm btn-primary">
                            <%= _lc( 'BTN_SAVE' ) %>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>