<form class="ml-3 mr-3" name="jobs" #jobs="ngForm">
    <p-card class="m-5">
        <ng-template pTemplate="title">
            {{ 'dashboard.jobs.heading' | translate }}
        </ng-template>
        <ng-template pTemplate="subtitle">
            {{ 'dashboard.jobs.subtitle' | translate }}
        </ng-template>
        <ng-template pTemplate="content">
            <div class="grid">
                <div class="mb-4 w-full">

                    <div class="form-group field">
                        <label for="CommercialSkipMethod" class="label block">{{ 'dashboard.jobs.method_label' |
                            translate }}</label>
                        <p-dropdown appendTo="body" [options]="methodList" [(ngModel)]="CommercialSkipMethod"
                            class="w-full mb-2" name="CommercialSkipMethod" aria-describedby="CommercialSkipMethod-help"
                            optionLabel="Label" optionValue="Value">
                        </p-dropdown>
                        <small class="block mt-2" id="CommercialSkipMethod-help">
                            {{ 'dashboard.jobs.method_desc' | translate }}
                        </small>
                    </div>

                    <div class="form-group field">
                        <p-checkbox inputId="CommFlagFast" [(ngModel)]="CommFlagFast" name="CommFlagFast"
                            class="mb-2 w-full label" [binary]="true"
                            label="{{ 'dashboard.jobs.speedup_label' | translate }}">
                        </p-checkbox>
                        <small class="block">
                            {{ 'dashboard.jobs.speedup_desc' | translate }}
                        </small>
                    </div>

                    <div class="form-group field">
                        <p-checkbox inputId="AggressiveCommDetect" [(ngModel)]="AggressiveCommDetect"
                            name="AggressiveCommDetect" class="mb-2 w-full label" [binary]="true"
                            label="{{ 'dashboard.jobs.strict_label' | translate }}">
                        </p-checkbox>
                        <small class="block">
                            {{ 'dashboard.jobs.strict_desc' | translate }}
                        </small>
                    </div>

                    <div class="form-group field">
                        <label for="DeferAutoTranscodeDays" class="label block">{{ 'dashboard.jobs.deferral_label' |
                            translate }}</label>
                        <p-inputNumber [(ngModel)]="DeferAutoTranscodeDays" name="DeferAutoTranscodeDays"
                            id="DeferAutoTranscodeDays" [showButtons]="true" [min]="0" [max]="365"
                            [step]="1"></p-inputNumber>
                        <small class="block">
                            {{ 'dashboard.jobs.deferral_desc' | translate }}
                        </small>
                    </div>
                </div>
            </div>
        </ng-template>

        <ng-template pTemplate="footer">
            <div class="grid nogutter">
                <div class="col-12">
                    <p-message *ngIf="successCount > 0 && errorCount == 0 && !jobs.dirty" severity="success"
                        text="{{ 'common.savesuccess' | translate }}"></p-message>
                    <p-message *ngIf="this.errorCount > 0" severity="error"
                        text="{{ 'common.networkfail' | translate }}"></p-message>
                </div>
                <p-button class="col pr-1" label="{{'common.save' | translate}}" icon="pi pi-save" iconPos="left"
                    (onClick)="saveForm(); jobs.form.markAsPristine()" [disabled]="!jobs.dirty"></p-button>
            </div>
        </ng-template>
    </p-card>
</form>