<!-- Page Content -->
<div class="container">
    <div class="row col-sm-9 col-sm-offset-1" lu-busy="form">
        <form name="form" ng-submit="submit()" class="form-horizontal">
            <div class="form-group">
                <label for="email" class="col-sm-2 control-label">Email</label>
                <div class="col-sm-9">
                    <input id="email" class="form-control" ng-model="user.Email" lu-enable-permission="LU_USER_EDIT_ME"/>
                </div>
            </div>

            <div class="form-group">
                <label for="firstname" class="col-sm-2 control-label">Firstname</label>
                <div class="col-sm-9">
                    <input id="firstname" class="form-control" ng-model="user.Firstname" lu-enable-permission="LU_USER_EDIT_ME"/>
                </div>
            </div>

            <div class="form-group">
                <label for="lastname" class="col-sm-2 control-label">Lastname</label>
                <div class="col-sm-9">
                    <input id="lastname" class="form-control" ng-model="user.Lastname" lu-enable-permission="LU_USER_EDIT_ME"/>
                </div>
            </div>

            <div lu-show-permission="LU_USER_SET_PASSWORD_ME">

                <div class="form-group">
                    <label for="oldPassword" class="col-sm-2 control-label">Old Password</label>
                    <div class="col-sm-9">
                        <input id="oldPassword" class="form-control" type="password" ng-model="userPassword.old"
                               name="oldPassword"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="password" class="col-sm-2 control-label">New Password</label>
                    <div class="col-sm-9">
                        <input id="password" class="form-control" type="password" ng-model="userPassword.value"
                               name="password" ui-validate="passwordValidation"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="password2" class="col-sm-2 control-label">Confirmation</label>
                    <div class="col-sm-9">
                        <input id="password2" class="form-control" type="password" ng-model="userPassword.confirm"
                               name="password2" ui-validate="password2Validation" ui-validate-watch="'userPassword.value'"/>
                    </div>
                </div>

                <div class="col-sm-offset-2 col-sm-9">
                    <p class="error" ng-show="form.password.$error.length">Passwords is too short</p>
                    <p class="error" ng-show="form.password2.$error.same_passwords">Passwords do not match</p>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-9 col-sm-offset-2">
                    <button class="btn btn-primary btn-block">Edit</button>
                </div>
            </div>
        </form>
    </div>
</div>
