]>
Commit | Line | Data |
---|---|---|
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 | |
8 | aria-label="Select the torrent to import" i18n-aria-label | |
9 | #torrentfileInput type="file" name="torrentfile" id="torrentfile" accept=".torrent" (change)="fileChange()" | |
10 | /> | |
11 | </div> | |
12 | ||
13 | <div class="torrent-or-magnet" i18n-data-content data-content="OR"></div> | |
14 | ||
15 | <div class="form-group form-group-magnet-uri"> | |
16 | <label i18n for="magnetUri">Paste magnet URI</label> | |
17 | <my-help> | |
18 | <ng-template ptTemplate="customHtml"> | |
19 | <ng-container i18n> | |
20 | You can import any torrent file that points to a media file. | |
21 | 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. | |
22 | </ng-container> | |
23 | </ng-template> | |
24 | </my-help> | |
25 | ||
26 | <input type="text" id="magnetUri" [(ngModel)]="magnetUri" class="form-control" /> | |
27 | </div> | |
28 | ||
29 | <div class="form-group"> | |
30 | <label i18n for="first-step-channel">Channel</label> | |
31 | <my-select-channel | |
32 | labelForId="first-step-channel" [items]="userVideoChannels" [(ngModel)]="firstStepChannelId" | |
33 | ></my-select-channel> | |
34 | </div> | |
35 | ||
36 | <div class="form-group"> | |
37 | <label i18n for="first-step-privacy">Privacy</label> | |
38 | <my-select-options | |
39 | labelForId="first-step-privacy" [items]="videoPrivacies" [(ngModel)]="firstStepPrivacyId" | |
40 | ></my-select-options> | |
41 | </div> | |
42 | ||
43 | <input | |
44 | type="button" i18n-value value="Import" | |
45 | [disabled]="!isMagnetUrlValid() || isImportingVideo" (click)="importVideo()" | |
46 | /> | |
47 | </div> | |
48 | </div> | |
49 | ||
50 | <div *ngIf="error" class="alert alert-danger"> | |
51 | <div i18n>Sorry, but something went wrong</div> | |
52 | {{ error }} | |
53 | </div> | |
54 | ||
55 | <div *ngIf="hasImportedVideo && !error" class="alert alert-info" i18n> | |
56 | Congratulations, the video will be imported with BitTorrent! You can already add information about this video. | |
57 | </div> | |
58 | ||
59 | <!-- Hidden because we want to load the component --> | |
60 | <form [hidden]="!hasImportedVideo" novalidate [formGroup]="form"> | |
61 | <my-video-edit | |
62 | [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false" | |
63 | [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" | |
64 | type="import-torrent" | |
65 | ></my-video-edit> | |
66 | ||
67 | <div class="submit-container"> | |
68 | <my-button className="orange-button" i18n-label label="Update" icon="circle-tick" | |
69 | (click)="updateSecondStep()" | |
70 | [disabled]="!form.valid || isUpdatingVideo === true" | |
71 | ></my-button> | |
72 | </div> | |
73 | </form> |