Use form-control to display box-shadow on form inputs/selects upon focus
[oweals/peertube.git] / client / src / app / shared / video / modals / video-download.component.html
1 <ng-template #modal let-hide="close">
2   <div class="modal-header">
3     <h4 class="modal-title">
4       <ng-container i18n>Download</ng-container>
5
6       <div *ngIf="videoCaptions" ngbDropdown class="d-inline-block">
7         <span id="dropdownDownloadType" ngbDropdownToggle>
8           {{ type }}
9         </span>
10         <div ngbDropdownMenu aria-labelledby="dropdownDownloadType">
11           <button *ngIf="type === 'video'" (click)="switchToType('subtitles')" ngbDropdownItem i18n>subtitles</button>
12           <button *ngIf="type === 'subtitles'" (click)="switchToType('video')" ngbDropdownItem i18n>video</button>
13         </div>
14       </div>
15     </h4>
16     <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
17   </div>
18
19   <div class="modal-body">
20     <div class="form-group">
21       <div class="input-group input-group-sm">
22         <div class="input-group-prepend peertube-select-container">
23           <select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()">
24             <option *ngFor="let file of getVideoFiles()" [value]="file.resolution.id">{{ file.resolution.label }}</option>
25           </select>
26
27           <select *ngIf="type === 'subtitles'" [(ngModel)]="subtitleLanguageId">
28             <option *ngFor="let caption of videoCaptions" [value]="caption.language.id">{{ caption.language.label }}</option>
29           </select>
30         </div>
31
32         <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" />
33         <div class="input-group-append">
34           <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary">
35             <span class="glyphicon glyphicon-copy"></span>
36           </button>
37         </div>
38       </div>
39     </div>
40
41     <ng-container *ngIf="type === 'video' && videoFile?.metadata">
42       <div ngbNav #nav="ngbNav" class="nav-tabs">
43
44         <ng-container ngbNavItem>
45           <a ngbNavLink i18n>Format</a>
46           <ng-template ngbNavContent>
47             <div class="file-metadata">
48               <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataFormat | keyvalue">
49                 <span i18n class="metadata-attribute-label">{{ item.value.label }}</span>
50                 <span class="metadata-attribute-value">{{ item.value.value }}</span>
51               </div>
52             </div>
53           </ng-template>
54         </ng-container>
55
56         <ng-container ngbNavItem [disabled]="videoFileMetadataVideoStream === undefined">
57           <a ngbNavLink i18n>Video stream</a>
58           <ng-template ngbNavContent>
59             <div class="file-metadata">
60               <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataVideoStream | keyvalue">
61                 <span i18n class="metadata-attribute-label">{{ item.value.label }}</span>
62                 <span class="metadata-attribute-value">{{ item.value.value }}</span>
63               </div>
64             </div>
65           </ng-template>
66         </ng-container>
67
68         <ng-container ngbNavItem [disabled]="videoFileMetadataAudioStream === undefined">
69           <a ngbNavLink i18n>Audio stream</a>
70           <ng-template ngbNavContent>
71             <div class="file-metadata">
72               <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataAudioStream | keyvalue">
73                 <span i18n class="metadata-attribute-label">{{ item.value.label }}</span>
74                 <span class="metadata-attribute-value">{{ item.value.value }}</span>
75               </div>
76             </div>
77           </ng-template>
78         </ng-container>
79       </div>
80
81       <div [ngbNavOutlet]="nav"></div>
82     </ng-container>
83
84     <div class="download-type" *ngIf="type === 'video'">
85       <div class="peertube-radio-container">
86         <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct">
87         <label i18n for="download-direct">Direct download</label>
88       </div>
89
90       <div class="peertube-radio-container">
91         <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent">
92         <label i18n for="download-torrent">Torrent (.torrent file)</label>
93       </div>
94     </div>
95   </div>
96
97   <div class="modal-footer inputs">
98     <input
99       type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel"
100       (click)="hide()" (key.enter)="hide()"
101     >
102
103     <input
104       type="submit" i18n-value value="Download" class="action-button-submit"
105       (click)="download()"
106     >
107   </div>
108 </ng-template>