video-import -> video-import-url
[oweals/peertube.git] / client / src / app / videos / +video-edit / video-import-url.component.html
1 <div *ngIf="!hasImportedVideo" class="upload-video-container">
2   <div class="import-video">
3     <div class="icon icon-upload"></div>
4
5     <div class="form-group">
6       <label i18n for="targetUrl">URL</label>
7       <my-help
8         helpType="custom" i18n-customHtml
9         customHtml="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> or URL that points to a raw MP4 file. 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."
10       ></my-help>
11
12       <input type="text" id="targetUrl" [(ngModel)]="targetUrl" />
13     </div>
14
15     <div class="form-group">
16       <label i18n for="first-step-channel">Channel</label>
17       <div class="peertube-select-container">
18         <select id="first-step-channel" [(ngModel)]="firstStepChannelId">
19           <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
20         </select>
21       </div>
22     </div>
23
24     <div class="form-group">
25       <label i18n for="first-step-privacy">Privacy</label>
26       <div class="peertube-select-container">
27         <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId">
28           <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
29         </select>
30       </div>
31     </div>
32
33     <input
34       type="button" i18n-value value="Import"
35       [disabled]="!isTargetUrlValid() || isImportingVideo" (click)="importVideo()"
36     />
37   </div>
38 </div>
39
40 <div *ngIf="hasImportedVideo" class="alert alert-info" i18n>
41   Congratulations, the video behind {{ targetUrl }} will be imported! You can already add information about this video.
42 </div>
43
44 <!-- Hidden because we want to load the component -->
45 <form [hidden]="!hasImportedVideo" novalidate [formGroup]="form">
46   <my-video-edit
47     [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false"
48     [validationMessages]="validationMessages" [videoPrivacies]="videoPrivacies" [userVideoChannels]="userVideoChannels"
49   ></my-video-edit>
50
51   <div class="submit-container">
52     <div class="submit-button"
53        (click)="updateSecondStep()"
54        [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }"
55     >
56       <span class="icon icon-validate"></span>
57       <input type="button" i18n-value value="Update" />
58     </div>
59   </div>
60 </form>