Files
iptvnator/src/app/settings/settings.component.html
T

218 lines
10 KiB
HTML

<app-header
[title]="'SETTINGS.TITLE' | translate"
[subtitle]="
('SETTINGS.SUBTITLE' | translate) +
'. ' +
('SETTINGS.DESCRIPTION' | translate)
"
></app-header>
<div class="settings-container">
<form [formGroup]="settingsForm" (ngSubmit)="onSubmit()" novalidate>
<mat-card>
<mat-card-content>
<mat-list>
<ng-container formArrayName="epgUrl" *ngIf="isElectron">
<mat-list-item
*ngFor="let _ of epgUrl.controls; index as i"
>
<div matLine fxLayout="row">
<p fxFlex>
{{ 'SETTINGS.EPG_URL_LABEL' | translate }}
</p>
<p
fxFlex
fxLayoutAlign="start center"
fxLayout="row"
>
<mat-form-field class="full-width">
<input
matInput
[placeholder]="
'SETTINGS.EPG_URL_PLACEHOLDER'
| translate
"
type="url"
[formControlName]="i"
/>
<mat-error
>The value is not a valid
URL</mat-error
>
</mat-form-field>
<button
matLine
mat-icon-button
color="accent"
[matTooltip]="
'SETTINGS.REFRESH_EPG' | translate
"
type="button"
(click)="fetchEpg(epgUrl.value)"
>
<mat-icon>refresh</mat-icon>
</button>
<button
mat-icon-button
matLine
color="accent"
[matTooltip]="
'SETTINGS.REFRESH_EPG' | translate
"
type="button"
(click)="removeEpgSource(i)"
>
<mat-icon>remove</mat-icon>
</button>
</p>
</div>
</mat-list-item>
</ng-container>
<mat-list-item *ngIf="isElectron">
<div matLine fxLayout="row">
<p fxFlex></p>
<p fxFlex fxLayoutAlign="start center">
<button
mat-button
color="accent"
type="button"
(click)="addEpgSource()"
>
Add another epg source
</button>
</p>
</div>
</mat-list-item>
<mat-list-item>
<div matLine fxLayout="row">
<p fxFlex>
{{ 'SETTINGS.VIDEO_PLAYER_LABEL' | translate }}
</p>
<p fxFlex fxLayoutAlign="start center">
<mat-form-field appearance="fill">
<mat-label>{{
'SETTINGS.VIDEO_PLAYER_PLACEHOLDER'
| translate
}}</mat-label>
<mat-select formControlName="player">
<mat-option
*ngFor="let player of players"
[value]="player.id"
>{{ player.label }}
</mat-option>
</mat-select>
</mat-form-field>
</p>
</div>
</mat-list-item>
<mat-list-item>
<div matLine fxLayout="row">
<p fxFlex>
{{ 'SETTINGS.LANGUAGE' | translate }}
</p>
<p fxFlex fxLayoutAlign="start center">
<mat-form-field appearance="fill">
<mat-label>{{
'SETTINGS.VIDEO_PLAYER_PLACEHOLDER'
| translate
}}</mat-label>
<mat-select formControlName="language">
<mat-option
*ngFor="
let language of languageEnum
| keyvalue
"
[value]="language.value"
>{{
'LANGUAGES.' + language.key
| translate
}}</mat-option
>
</mat-select>
</mat-form-field>
</p>
</div>
</mat-list-item>
<mat-list-item>
<div matLine fxLayout="row">
<p fxFlex>{{ 'SETTINGS.THEME' | translate }}</p>
<p fxFlex>
<mat-form-field appearance="fill">
<mat-label>{{
'SETTINGS.VIDEO_PLAYER_PLACEHOLDER'
| translate
}}</mat-label>
<mat-select formControlName="theme">
<mat-option
*ngFor="
let theme of themeEnum
| keyvalue
"
[value]="theme.value"
>{{
'THEMES.' + theme.value
| translate
}}</mat-option
>
</mat-select>
</mat-form-field>
</p>
</div>
</mat-list-item>
<mat-list-item>
<div matLine fxLayout="row">
<p fxFlex>
{{ 'SETTINGS.SHOW_CAPTIONS' | translate }}
</p>
<p fxFlex>
<mat-checkbox
formControlName="showCaptions"
></mat-checkbox>
</p>
</div>
</mat-list-item>
<mat-list-item>
<div matLine fxLayout="row">
<p fxFlex>
{{ 'SETTINGS.VERSION' | translate }}
</p>
<p fxFlex>
{{ version }} <br />
{{ updateMessage }}
</p>
</div>
</mat-list-item>
<mat-list-item *ngIf="!isElectron"
>EPG is available in electron-based version of
IPTVnator. Check it&nbsp;<a
href="https://github.com/4gray/iptvnator/releases"
>here</a
></mat-list-item
>
</mat-list>
</mat-card-content>
<mat-divider></mat-divider>
<mat-card-actions align="end">
<button
mat-button
color="accent"
type="reset"
(click)="backToHome()"
>
<mat-icon>chevron_left</mat-icon>
{{ 'SETTINGS.BACK_TO_HOME' | translate }}
</button>
<button
mat-button
color="accent"
type="submit"
[disabled]="settingsForm.pristine || !settingsForm.valid"
>
<mat-icon>save</mat-icon>
{{ 'SETTINGS.SAVE_CHANGES' | translate }}
</button>
</mat-card-actions>
</mat-card>
</form>
</div>