
<div id="myModal" bsModal #modal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
 aria-labelledby="modal" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form *ngIf="active" #vehicleForm="ngForm" novalidate (ngSubmit)="save()">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{"CreatingNewVehicle" | localize}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label>{{"VehicleName" | localize}} *</label>
                        <input #vehicleName="ngModel" class="form-control" type="text" name="name" [(ngModel)]="vehicle.name" required maxlength="32">
                        <validation-messages [formCtrl]="vehicleName"></validation-messages>
                    </div>
                    <div class="form-group">
                        <label>{{"LicenseNumber" | localize}} *</label>
                        <input #licenseNumber="ngModel" class="form-control" type="text" name="licenseNumber" [(ngModel)]="vehicle.licenseNumber" required maxlength="32">
                        <validation-messages [formCtrl]="licenseNumber"></validation-messages>
                    </div>       
                 
                   <div class="form-group">
                        <label for="userInput">{{"DriverName" | localize}}</label>
                        <br>
                        <select id = "driver" class="form-control kt-select2" name="user" data-placeholder="Select.." [(ngModel)]="userInput">
                            <option value="null">None</option>
                            <option *ngFor="let user of users" value= {{user.id}}>
                                {{user.name +" "+ user.surname }}
                              </option>
                        </select>
                   </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-secondary btn-pill" (click)="close()">{{"Cancel" | localize}}</button>
                    <button type="submit" class="btn btn-primary btn-pill" [disabled]="!vehicleForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot' | localize)"><i class="fa fa-save"></i> <span>{{"Save" | localize}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>

