]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html
Refactor form reactive
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / video-add-components / video-import-url.component.html
CommitLineData
fbad87b0 1<div *ngIf="!hasImportedVideo" class="upload-video-container">
457bb213 2 <div class="first-step-block">
adcf9212 3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
fbad87b0
C
4
5 <div class="form-group">
6 <label i18n for="targetUrl">URL</label>
421d935d
C
7
8 <my-help>
9 <ng-template ptTemplate="customHtml">
10 <ng-container i18n>
11 You can import any URL <a href='https://rg3.github.io/youtube-dl/supportedsites.html' target='_blank' rel='noopener noreferrer'>supported by youtube-dl</a>
ce4e63c1 12 or URL that points to a media file.
421d935d
C
13 You should make sure you have diffusion rights over the content it points to, otherwise it could cause legal trouble to yourself and your instance.
14 </ng-container>
15 </ng-template>
16 </my-help>
299474e8 17
c9ff8a08 18 <input type="text" id="targetUrl" [(ngModel)]="targetUrl" class="form-control" />
97eba003
C
19
20 <div *ngIf="isChannelSyncEnabled()" class="form-group-description" i18n>
21 You can also synchronize a remote channel in <a routerLink="/my-library/video-channel-syncs">your library</a>
22 </div>
fbad87b0
C
23 </div>
24
25 <div class="form-group">
26 <label i18n for="first-step-channel">Channel</label>
02c01341
RK
27 <my-select-channel
28 labelForId="first-step-channel" [items]="userVideoChannels" [(ngModel)]="firstStepChannelId"
29 ></my-select-channel>
fbad87b0
C
30 </div>
31
32 <div class="form-group">
33 <label i18n for="first-step-privacy">Privacy</label>
02c01341
RK
34 <my-select-options
35 labelForId="first-step-privacy" [items]="videoPrivacies" [(ngModel)]="firstStepPrivacyId"
36 ></my-select-options>
fbad87b0
C
37 </div>
38
39 <input
40 type="button" i18n-value value="Import"
41 [disabled]="!isTargetUrlValid() || isImportingVideo" (click)="importVideo()"
42 />
43 </div>
44</div>
45
7373507f
C
46
47<div *ngIf="error" class="alert alert-danger">
48 <div i18n>Sorry, but something went wrong</div>
49 {{ error }}
50</div>
51
b13a0a48 52<div *ngIf="!error && hasImportedVideo" class="alert pt-alert-primary" i18n>
fbad87b0
C
53 Congratulations, the video behind {{ targetUrl }} will be imported! You can already add information about this video.
54</div>
55
56<!-- Hidden because we want to load the component -->
57<form [hidden]="!hasImportedVideo" novalidate [formGroup]="form">
58 <my-video-edit
4afec735 59 [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [forbidScheduledPublication]="true"
851f5daa 60 [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
7294aab0 61 type="import-url"
fbad87b0
C
62 ></my-video-edit>
63
64 <div class="submit-container">
1ef7f323
C
65 <my-button className="orange-button" i18n-label label="Update" icon="circle-tick"
66 (click)="updateSecondStep()"
67 [disabled]="!form.valid || isUpdatingVideo === true"
68 ></my-button>
fbad87b0
C
69 </div>
70</form>