add keyboard navigation for video actions (#2854)
[oweals/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       <div class="peertube-select-container">
29         <select id="first-step-channel" [(ngModel)]="firstStepChannelId" class="form-control">
30           <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
31         </select>
32       </div>
33     </div>
34
35     <div class="form-group">
36       <label i18n for="first-step-privacy">Privacy</label>
37       <div class="peertube-select-container">
38         <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId" class="form-control">
39           <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
40         </select>
41       </div>
42     </div>
43
44     <input
45       type="button" i18n-value value="Import"
46       [disabled]="!isMagnetUrlValid() || isImportingVideo" (click)="importVideo()"
47     />
48   </div>
49 </div>
50
51 <div *ngIf="error" class="alert alert-danger">
52   <div i18n>Sorry, but something went wrong</div>
53   {{ error }}
54 </div>
55
56 <div *ngIf="hasImportedVideo && !error" class="alert alert-info" i18n>
57   Congratulations, the video will be imported with BitTorrent! You can already add information about this video.
58 </div>
59
60 <!-- Hidden because we want to load the component -->
61 <form [hidden]="!hasImportedVideo" novalidate [formGroup]="form">
62   <my-video-edit
63     [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false"
64     [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
65   ></my-video-edit>
66
67   <div class="submit-container">
68     <div class="submit-button"
69        (click)="updateSecondStep()"
70        [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }"
71     >
72       <my-global-icon iconName="validate" aria-hidden="true"></my-global-icon>
73       <input type="button" i18n-value value="Update" />
74     </div>
75   </div>
76 </form>