aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.html
blob: 6a07dafa7b626871eafd3b4bc0e96f5d886f158e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<ng-template #modal>
  <ng-container [formGroup]="form">

    <div class="modal-header">
      <h4 i18n class="modal-title">Add caption</h4>
      <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
    </div>

    <div class="modal-body">
      <label i18n for="language">Language</label>
      <div class="peertube-ng-select-container">
        <ng-select
          labelForId="language" [items]="videoCaptionLanguages" formControlName="language"
          bindLabel="label" bindValue="id"
        ></ng-select>
      </div>

      <div *ngIf="formErrors.language" class="form-error">
        {{ formErrors.language }}
      </div>

      <div class="caption-file">
        <my-reactive-file
          formControlName="captionfile" inputName="captionfile" i18n-inputLabel inputLabel="Select the caption file"
          [extensions]="videoCaptionExtensions" [maxFileSize]="videoCaptionMaxSize" [displayFilename]="true"
          i18n-ngbTooltip [ngbTooltip]="'(extensions: ' + videoCaptionExtensions.join(', ') + ')'"
        ></my-reactive-file>
      </div>

      <div *ngIf="isReplacingExistingCaption()" class="warning-replace-caption" i18n>
        This will replace an existing caption!
      </div>
    </div>

    <div class="modal-footer inputs">
      <input
        type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel"
        (click)="hide()" (key.enter)="hide()"
      >

      <input
        type="submit" i18n-value value="Add this caption" class="action-button-submit"
        [disabled]="!form.valid" (click)="addCaption()"
      >
    </div>
  </ng-container>
</ng-template>