]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
add ng-select for templatable select options
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / video-add-components / video-import-torrent.component.html
1 <div *ngIf="!hasImportedVideo" class="upload-video-container" dragDrop (fileDropped)="setTorrentFile($event)">
2 <div class="first-step-block">
3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
4
5 <div class="button-file form-control" [ngbTooltip]="'(extensions: .torrent)'">
6 <span i18n>Select the torrent to import</span>
7 <input #torrentfileInput type="file" name="torrentfile" id="torrentfile" accept=".torrent" (change)="fileChange()" />
8 </div>
9
10 <div class="torrent-or-magnet" i18n-data-content data-content="OR"></div>
11
12 <div class="form-group form-group-magnet-uri">
13 <label i18n for="magnetUri">Paste magnet URI</label>
14 <my-help>
15 <ng-template ptTemplate="customHtml">
16 <ng-container i18n>
17 You can import any torrent file that points to a mp4 file.
18 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.
19 </ng-container>
20 </ng-template>
21 </my-help>
22
23 <input type="text" id="magnetUri" [(ngModel)]="magnetUri" class="form-control" />
24 </div>
25
26 <div class="form-group">
27 <label i18n for="first-step-channel">Channel</label>
28 <my-select-channel
29 labelForId="first-step-channel" [items]="userVideoChannels" [(ngModel)]="firstStepChannelId"
30 ></my-select-channel>
31 </div>
32
33 <div class="form-group">
34 <label i18n for="first-step-privacy">Privacy</label>
35 <my-select-options
36 labelForId="first-step-privacy" [items]="videoPrivacies" [(ngModel)]="firstStepPrivacyId"
37 ></my-select-options>
38 </div>
39
40 <input
41 type="button" i18n-value value="Import"
42 [disabled]="!isMagnetUrlValid() || isImportingVideo" (click)="importVideo()"
43 />
44 </div>
45 </div>
46
47 <div *ngIf="error" class="alert alert-danger">
48 <div i18n>Sorry, but something went wrong</div>
49 {{ error }}
50 </div>
51
52 <div *ngIf="hasImportedVideo && !error" class="alert alert-info" i18n>
53 Congratulations, the video will be imported with BitTorrent! 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
59 [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false"
60 [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
61 ></my-video-edit>
62
63 <div class="submit-container">
64 <div class="submit-button"
65 (click)="updateSecondStep()"
66 [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }"
67 >
68 <my-global-icon iconName="circle-tick" aria-hidden="true"></my-global-icon>
69 <input type="button" i18n-value value="Update" />
70 </div>
71 </div>
72 </form>