<div class="row">
    <div class="col-md-12">
        <h3>Deine Teams</h3>
    </div>
</div>
<div class="row">
    <div class="col-md-12">


        <div class="specialContentBig">

            <div class="panel panel-default">
                <div class="panel-body">

                        <table id="table_player_list"
                           class="table table-striped">
                            <thead>
                            <tr>
                                <th>Team</th>
                                <th>Rolle</th>
                                <th>Name</th>
                                <th>&nbsp;</th>
                            </tr>
                            </thead>
                            <tbody>
                                <% for ( var i = 0; i < data.profiles.length; i++ ) { %>
                                <tr>
                                    <td>
                                        <%
                                            for ( var t = 0; t < data.teams.length; t++ ) {
                                                if ( data.teams[t].id == data.profiles[i].team_id ) {
                                                    teamName = data.teams[t].display_name;
                                                    break;
                                                }
                                            }
                                        %>
                                        <%= teamName %>
                                    </td>
                                    <td>
                                        <%= TB.GUI.getRole( data.profiles[ i ].role ) %>
                                    </td>
                                    <td>
                                        <%= TB.GUI.playerName( data.profiles[ i ] ) %>
                                    </td>
                                    <td>
                                        <% if ( data.profile.id == data.profiles[i].id ) { %>
                                            <span class="label label-success">aktiv</span>
                                        <% } else { %>
                                            <button class="btn btn-xs btn-primary"
                                                    data-action="change_profile"
                                                    data-profile_id="<%= data.profiles[i].id %>"
                                                ><i class="glyphicon glyphicon-transfer"></i>&nbsp;Wechseln</button>
                                        <% }    %>
                                    </td>
                                </tr>
                            <% } %>
                            </tbody>
                    </table>
                    </div>
                </div>
            </div>


        <div class="specialContentSmall">

            <div class="panel panel-default">
                <div class="panel-body">

                    <table id="table_player_list"
                           class="table table-striped">
                        <thead>
                        <tr>
                            <th>Team</th>
                            <th>&nbsp;</th>
                        </tr>
                        </thead>
                        <tbody>
                        <% for ( var i = 0; i < data.profiles.length; i++ ) { %>
                        <tr>
                            <td>
                                <%
                                for ( var t = 0; t < data.teams.length; t++ ) {
                                if ( data.teams[t].id == data.profiles[i].team_id ) {
                                teamName = data.teams[t].display_name;
                                break;
                                }
                                }
                                %>
                                <%= teamName %>
                            </td>
                            <td>
                                <% if ( data.profile.id == data.profiles[i].id ) { %>
                                <span class="label label-success">aktiv</span>
                                <% } else { %>
                                <button class="btn btn-xs btn-primary"
                                        data-action="change_profile"
                                        data-profile_id="<%= data.profiles[i].id %>"
                                    >
                                    <i class="glyphicon glyphicon-transfer"></i>&nbsp;Wechseln</button>
                                <% }    %>
                            </td>
                        </tr>
                        <% } %>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>


        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <button id="btn_profile_createteam"
                data-action="new-team"
                data-style="zoom-in"
                data-size="l"
                class="btn btn-primary btn-block ladda-button">
            Neues Team erstellen
        </button>
    </div>
</div>