<div class="row">
    <div class="col-md-12">
        <h3>Profil</h3>
    </div>
</div>
<form id="form_player_edit" role="form" method="post">
    <input type="hidden" name="id" value="<%= data.profile.id %>" />
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label class="for-custom-radio" for="gender">Anrede</label>
                <label class="radiochecklabel radio-inline">
                    <div>
                        <input class="radiocheck"
                               type="radio"
                               name="gender"
                               value="male"
                               <% if ( "male" == data.profile.gender ) {    %>
                                checked="checked"
                                <% } %>
                        />
                        Herr
                        <div class="check">
                            <div class="inside"></div>
                        </div>
                    </div>
                </label>
                <label class="radiochecklabel radio-inline">
                    <div>
                        <input class="radiocheck"
                               type="radio"
                               name="gender"
                               value="female"
                        <% if ( "female" == data.profile.gender ) {    %>
                        checked="checked"
                        <% } %>
                        />
                        Frau
                        <div class="check">
                            <div class="inside"></div>
                        </div>
                    </div>
                </label>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="first_name">Vorname</label>
                <input type="text"
                       id="first_name"
                       name="first_name"
                       placeholder="Vorname"
                       value="<%= data.profile.first_name %>"
                       class="form-control"
                       data-validate="required"
                       data-validate-errormsg="Bitte den Vornamen angeben."
                    />
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="last_name">Nachname</label>
                <input type="text"
                       id="last_name"
                       name="last_name"
                       placeholder="Nachname"
                       value="<%= data.profile.last_name %>"
                       class="form-control"
                       data-validate="required"
                       data-validate-errormsg="Bitte den Nachnamen angeben."
                />
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <label for="status">Rolle</label>
        </div>
    </div>
    <% if ( TB.GUI.isTrainer( data.profile ) ) {    %>
        <div class="col-md-12">
            <div class="alert alert-warning">Um die Coach Rolle zu ändern, melde dich bitte beim Support (support@tbuddy.de).</div>
        </div>
    <% } else if ( TB.GUI.isOwnProfile( data.profile ) && ( TB.GUI.isPlayer( data.profile ) || TB.GUI.isFan( data.profile ) )  ) { %>
        <div class="col-md-12">
            <div class="alert alert-warning">Deine Rolle können nur Coaches ändern.</div>
        </div>
    <% } else {  %>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group btn-group btn-group-justified" data-toggle="buttons" id="btn-group-role">
                    <label class="btn btn-<%= (data.profile.role == 'fan' ) ? 'primary' : 'default' %> <%= (data.profile.role == 'fan' ) ? 'active' : '' %>">
                        <input type="radio" name="role" value="fan" id="role_player" autocomplete="off"
                        <%= (data.profile.role == 'fan' ) ? 'checked="checked"' : '' %> />Fan
                        <%= (data.profile.role == 'fan' ) ? '<span class="fa fa-check"></span>' : '' %>
                    </label>
                    <label class="btn btn-<%= (data.profile.role == 'player' ) ? 'primary' : 'default' %> <%= (data.profile.role == 'player' ) ? 'active' : '' %>">
                        <input type="radio" name="role" value="player" id="role_player" autocomplete="off"
                        <%= (data.profile.role == 'player' ) ? 'checked="checked"' : '' %> />Buddy
                        <%= (data.profile.role == 'player' ) ? '<span class="fa fa-check"></span>' : '' %>
                    </label>
                    <label class="btn btn-<%= (data.profile.role == 'cotrainer' ) ? 'primary' : 'default' %> <%= (data.profile.role == 'cotrainer' ) ? 'active' : '' %>">
                        <input type="radio" name="role" value="cotrainer" id="role_cotrainer" autocomplete="off"
                        <%= (data.profile.role == 'cotrainer' ) ? 'checked="checked"' : '' %>/>Co-Coach
                        <%= (data.profile.role == 'cotrainer' ) ? '<span class="fa fa-check"></span>' : '' %>
                    </label>
                    <label class="btn btn-disabled">
                        <input type="radio" name="role" value="trainer" id="status_trainer" autocomplete="off" disabled="disabled"
                        <%= (data.profile.status == 'trainer' ) ? 'checked="checked"' : '' %>/>Coach
                        <%= (data.profile.status == 'trainer' ) ? '<span class="fa fa-check"></span>' : '' %>
                    </label>
                </div>
            </div>
            <div class="col-md-12">
                    <dl class="dl-horizontal">
                        <dt>Fan</dt>
                        <dd>Fans dürfen chatten und lesend auf alle Bereiche zugreifen, aber nicht zu Terminen zu- oder absagen.</dd>
                        <dt>Buddy</dt>
                        <dd>Buddies dürfen chatten, Termine zu- und absagen und ihren Account verwalten.</dd>
                        <dt>Co-Coach</dt>
                        <dd>Co-Coaches dürfen alles was der Coach auch kann - bis auf das Team zu löschen.</dd>
                        <dt>Coach</dt>
                        <dd>Es kann nur einen geben. Zum Ändern dieser Rolle bitte mit dem Support in Verbindung setzen (support@tbuddy.de)</dd>
                    </dl>
            </div>
        </div>
    <% }    %>
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="player_pass_no">Passnummer</label>
                    <input type="text"
                           id="player_pass_no"
                           name="player_pass_no"
                           placeholder="Passnummer angeben"
                           value="<%= data.profile.player_pass_no %>"
                           class="form-control"
                        />
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="birthday">Geburtstag</label>
                <input type="text"
                       id="birthday"
                       name="birthday"
                       value="<%= ( data.profile.birthday ) ? TB.Utils.convertSQLDateToDatepickerDate( data.profile.birthday ) : '' %>"
                       class="form-control"
                       data-datepicker="true"
                    />
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="street">Straße</label>
                <input type="text"
                       name="street"
                       id="street"
                       placeholder="Straße und Hausnummer"
                       value="<%= data.profile.street %>"
                       class="form-control"
                    />
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4">
            <div class="form-group">
                <label for="zip_code">PLZ</label>
                <input type="text"
                       name="zip_code"
                       id="zip_code"
                       placeholder="PLZ"
                       value="<%= data.profile.zip_code %>"
                       class="form-control"
                    />
            </div>
        </div>
        <div class="col-md-8">
            <div class="form-group">
                <label for="city">Ort</label>
                <input type="text"
                       name="city"
                       id="city"
                       placeholder="Ort"
                       value="<%= data.profile.city %>"
                       class="form-control"
                    />
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
            <label for="phone">Telefon</label>
            <input type="text"
                   name="phone"
                   id="phone"
                   placeholder="Telefonnummer"
                   value="<%= data.profile.phone %>"
                   class="form-control"
                />
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="mobile">Handy</label>
                <input type="text"
                       name="mobile"
                       id="mobile"
                       placeholder="Handynummer"
                       value="<%= data.profile.mobile %>"
                       class="form-control"
                    />
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label for="misc">Sonstiges</label>
                <input type="text"
                       id="misc"
                       name="misc"
                       placeholder="Sonstige Info"
                       value="<%= data.profile.misc %>"
                       class="form-control"
                    />
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <label for="status">Status</label>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="form-group btn-group btn-group-justified" data-toggle="buttons" id="btn-group-status">
                <label class="btn btn-<%= (data.profile.status == 'fit' ) ? 'primary' : 'default' %> <%= (data.profile.status == 'fit' ) ? 'active' : '' %>">
                    <input type="radio" name="status" value="fit" id="status_fit" autocomplete="off"
                           <%= (data.profile.status == 'fit' ) ? 'checked="checked"' : '' %> />Fit
                    <%= (data.profile.status == 'fit' ) ? '<span class="fa fa-check"></span>' : '' %>
                </label>
                <label class="btn btn-<%= (data.profile.status == 'injured' ) ? 'primary' : 'default' %> <%= (data.profile.status == 'injured' ) ? 'active' : '' %>">
                    <input type="radio" name="status" value="injured" id="status_injured" autocomplete="off"
                           <%= (data.profile.status == 'injured' ) ? 'checked="checked"' : '' %>/>Verletzt
                    <%= (data.profile.status == 'injured' ) ? '<span class="fa fa-check"></span>' : '' %>
                </label>
                <label class="btn btn-<%= (data.profile.status == 'barred' ) ? 'primary' : 'default' %> <%= (data.profile.status == 'barred' ) ? 'active' : '' %>">
                    <input type="radio" name="status" value="barred" id="status_barred" autocomplete="off"
                            <%= (data.profile.status == 'barred' ) ? 'checked="checked"' : '' %>/>Gesperrt
                    <%= (data.profile.status == 'barred' ) ? '<span class="fa fa-check"></span>' : '' %>
                </label>
                <label class="btn btn-<%= (data.profile.status == 'inactive' ) ? 'primary' : 'default' %> <%= (data.profile.status == 'inactive' ) ? 'active' : '' %>">
                    <input type="radio" name="status" value="inactive" id="status_inactive" autocomplete="off"
                        <%= (data.profile.status == 'inactive' ) ? 'checked="checked"' : '' %>/>Inaktiv
                    <%= (data.profile.status == 'inactive' ) ? '<span class="fa fa-check"></span>' : '' %>
                </label>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-md-6 col-sm-12">
            <button type="button"
                    id="btn_player_update_cancel"
                    class="btn btn-primary btn-block">
                Abbrechen
            </button>
        </div>
        <div class="col-md-6 col-sm-12">
            <button type="submit"
                    id="btn_player_update"
                    data-style="zoom-in"
                    data-size="l"
                    class="btn btn-primary btn-block ladda-button">
                Änderungen speichern
            </button>
        </div>
    </div>
</form>
