<div *ngIf="user">
    <div class="user-details">
        <h3>User: {{user.userName}}</h3>
        <button type="button" class="btn btn-primary-outline" style="float:right;" [routerLink]="['/usermanagement/']">Back</button>


        <p-confirmDialog></p-confirmDialog>

        <div class="modal-body" style="margin-top: 45px;">
            <div class="col-md-6">
                <h4>User Details</h4>
            </div>
            <div class="col-md-6">
                <h4>Roles</h4>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="username" class="control-label">Username</label>
                    <div>
                        <input type="text" [(ngModel)]="user.userName" [readonly]="true" class="form-control form-control-custom " id="username" name="username" value="{{user?.userName}}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="alias" class="control-label">Alias</label>
                    <div>
                        <input type="text" [(ngModel)]="user.alias" class="form-control form-control-custom " id="alias" name="alias" value="{{user?.alias}}">
                    </div>
                </div>

                <div class="form-group">
                    <label for="emailAddress" class="control-label">Email Address</label>
                    <div>
                        <input type="text" [(ngModel)]="user.emailAddress" class="form-control form-control-custom " id="emailAddress" name="emailAddress" value="{{user?.emailAddress}}" [disabled]="user?.userType == 2">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div *ngFor="let c of user.claims">
                    <div class="form-group">
                        <div class="checkbox">
                            <input type="checkbox" [(ngModel)]="c.enabled" [value]="c.value" id="create{{c.value}}" [attr.name]="'create' + c.value" ng-checked="c.enabled">
                            <label for="create{{c.value}}">{{c.value | humanize}}</label>

                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="movieRequestLimit" class="control-label">Movie Request Limit</label>
                    <div>
                        <input type="text" [(ngModel)]="user.movieRequestLimit" class="form-control form-small form-control-custom " id="movieRequestLimit" name="movieRequestLimit" value="{{user?.movieRequestLimit}}">
                    </div>
                </div>

                <div class="form-group">
                    <label for="episodeRequestLimit" class="control-label">Episode Request Limit</label>
                    <div>
                        <input type="text" [(ngModel)]="user.episodeRequestLimit" class="form-control form-small form-control-custom " id="episodeRequestLimit" name="episodeRequestLimit" value="{{user?.episodeRequestLimit}}">
                    </div>
                </div>
            </div>
        </div>
        <div>
            <button type="button" class="btn btn-primary-outline" (click)="update()">Update</button>
            <button type="button" class="btn btn-danger-outline" (click)="delete()">Delete</button>
            <button type="button" style="float:right;" class="btn btn-info-outline" (click)="resetPassword()" pTooltip="You need your SMTP settings setup">Send Reset Password Link</button>

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