]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-video-miniature/video-download.component.html
Improve accessibility
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-video-miniature / 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 class="peertube-select-container title-select" *ngIf="hasCaptions()">
7 <select id="type" name="type" [(ngModel)]="type" class="form-control">
8 <option value="video" i18n>Video</option>
9 <option value="subtitles" i18n>Subtitles</option>
10 </select>
11 </div>
12 </h4>
13
14 <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
15 </div>
16
17 <div class="modal-body">
18 <div class="alert alert-warning" *ngIf="isConfidentialVideo()" i18n>
19 The following link contains a private token and should not be shared with anyone.
20 </div>
21
22 <!-- Subtitle tab -->
23 <ng-container *ngIf="type === 'subtitles'">
24 <div ngbNav #subtitleNav="ngbNav" class="nav-tabs" [activeId]="subtitleLanguageId" (activeIdChange)="onSubtitleIdChange($event)">
25
26 <ng-container *ngFor="let caption of getCaptions()" [ngbNavItem]="caption.language.id">
27 <a ngbNavLink i18n>{{ caption.language.label }}</a>
28
29 <ng-template ngbNavContent>
30 <div class="nav-content">
31 <my-input-text
32 *ngIf="!isConfidentialVideo()"
33 [show]="true" [readonly]="true" [withCopy]="true" [withToggle]="false" [value]="getLink()"
34 ></my-input-text>
35 </div>
36 </ng-template>
37 </ng-container>
38 </div>
39
40 <div [ngbNavOutlet]="subtitleNav"></div>
41 </ng-container>
42
43 <!-- Video tab -->
44 <ng-container *ngIf="type === 'video'">
45 <div ngbNav #resolutionNav="ngbNav" class="nav-tabs" [activeId]="resolutionId" (activeIdChange)="onResolutionIdChange($event)">
46 <ng-container *ngFor="let file of getVideoFiles()" [ngbNavItem]="file.resolution.id">
47 <a ngbNavLink i18n>{{ file.resolution.label }}</a>
48
49 <ng-template ngbNavContent>
50 <div class="nav-content">
51 <my-input-text [show]="true" [readonly]="true" [withCopy]="true" [withToggle]="false" [value]="getLink()"></my-input-text>
52 </div>
53 </ng-template>
54 </ng-container>
55 </div>
56
57 <div [ngbNavOutlet]="resolutionNav"></div>
58
59 <div class="advanced-filters" [ngbCollapse]="isAdvancedCustomizationCollapsed" [animation]="true">
60 <div ngbNav #navMetadata="ngbNav" class="nav-tabs nav-metadata">
61 <ng-container ngbNavItem>
62 <a ngbNavLink i18n>Format</a>
63 <ng-template ngbNavContent>
64 <div class="file-metadata">
65 <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataFormat | keyvalue">
66 <span i18n class="metadata-attribute-label">{{ item.value.label }}</span>
67 <span class="metadata-attribute-value">{{ item.value.value }}</span>
68 </div>
69 </div>
70 </ng-template>
71
72 <ng-container ngbNavItem [disabled]="videoFileMetadataVideoStream === undefined">
73 <a ngbNavLink i18n>Video stream</a>
74 <ng-template ngbNavContent>
75 <div class="file-metadata">
76 <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataVideoStream | keyvalue">
77 <span i18n class="metadata-attribute-label">{{ item.value.label }}</span>
78 <span class="metadata-attribute-value">{{ item.value.value }}</span>
79 </div>
80 </div>
81 </ng-template>
82 </ng-container>
83
84 <ng-container ngbNavItem [disabled]="videoFileMetadataAudioStream === undefined">
85 <a ngbNavLink i18n>Audio stream</a>
86 <ng-template ngbNavContent>
87 <div class="file-metadata">
88 <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataAudioStream | keyvalue">
89 <span i18n class="metadata-attribute-label">{{ item.value.label }}</span>
90 <span class="metadata-attribute-value">{{ item.value.value }}</span>
91 </div>
92 </div>
93 </ng-template>
94 </ng-container>
95
96 </ng-container>
97 </div>
98
99 <div *ngIf="getFileMetadata()" [ngbNavOutlet]="navMetadata"></div>
100
101 <div class="download-type">
102 <div class="peertube-radio-container">
103 <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct">
104 <label i18n for="download-direct">Direct download</label>
105 </div>
106
107 <div class="peertube-radio-container">
108 <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent">
109 <label i18n for="download-torrent">Torrent (.torrent file)</label>
110 </div>
111 </div>
112 </div>
113
114 <div
115 (click)="isAdvancedCustomizationCollapsed = !isAdvancedCustomizationCollapsed"
116 role="button" class="advanced-filters-button"
117 [attr.aria-expanded]="!isAdvancedCustomizationCollapsed" aria-controls="collapseBasic"
118 >
119 <ng-container *ngIf="isAdvancedCustomizationCollapsed">
120 <span class="chevron-down"></span>
121
122 <ng-container i18n>
123 Advanced
124 </ng-container>
125 </ng-container>
126
127 <ng-container *ngIf="!isAdvancedCustomizationCollapsed">
128 <span class="chevron-up"></span>
129
130 <ng-container i18n>
131 Simple
132 </ng-container>
133 </ng-container>
134 </div>
135 </ng-container>
136 </div>
137
138 <div class="modal-footer inputs">
139 <input
140 type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
141 (click)="hide()" (key.enter)="hide()"
142 >
143
144 <input type="submit" i18n-value value="Download" class="peertube-button orange-button" (click)="download()" />
145 </div>
146 </ng-template>