]>
Commit | Line | Data |
---|---|---|
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 | <div class="input-group input-group-sm"> | |
32 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> | |
33 | ||
34 | <div class="input-group-append" *ngIf="!isConfidentialVideo()"> | |
35 | <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> | |
36 | <span class="glyphicon glyphicon-duplicate"></span> | |
37 | </button> | |
38 | </div> | |
39 | </div> | |
40 | </div> | |
41 | </ng-template> | |
42 | </ng-container> | |
43 | </div> | |
44 | ||
45 | <div [ngbNavOutlet]="subtitleNav"></div> | |
46 | </ng-container> | |
47 | ||
48 | <!-- Video tab --> | |
49 | <ng-container *ngIf="type === 'video'"> | |
50 | <div ngbNav #resolutionNav="ngbNav" class="nav-tabs" [activeId]="resolutionId" (activeIdChange)="onResolutionIdChange($event)"> | |
51 | <ng-container *ngFor="let file of getVideoFiles()" [ngbNavItem]="file.resolution.id"> | |
52 | <a ngbNavLink i18n>{{ file.resolution.label }}</a> | |
53 | ||
54 | <ng-template ngbNavContent> | |
55 | <div class="nav-content"> | |
56 | <div class="input-group input-group-sm"> | |
57 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> | |
58 | <div class="input-group-append" *ngIf="!isConfidentialVideo()"> | |
59 | <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> | |
60 | <span class="glyphicon glyphicon-duplicate"></span> | |
61 | </button> | |
62 | </div> | |
63 | </div> | |
64 | </div> | |
65 | </ng-template> | |
66 | </ng-container> | |
67 | </div> | |
68 | ||
69 | <div [ngbNavOutlet]="resolutionNav"></div> | |
70 | ||
71 | <div class="advanced-filters collapse-transition" [ngbCollapse]="isAdvancedCustomizationCollapsed"> | |
72 | <div ngbNav #navMetadata="ngbNav" class="nav-tabs nav-metadata"> | |
73 | <ng-container ngbNavItem> | |
74 | <a ngbNavLink i18n>Format</a> | |
75 | <ng-template ngbNavContent> | |
76 | <div class="file-metadata"> | |
77 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataFormat | keyvalue"> | |
78 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | |
79 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | |
80 | </div> | |
81 | </div> | |
82 | </ng-template> | |
83 | ||
84 | <ng-container ngbNavItem [disabled]="videoFileMetadataVideoStream === undefined"> | |
85 | <a ngbNavLink i18n>Video stream</a> | |
86 | <ng-template ngbNavContent> | |
87 | <div class="file-metadata"> | |
88 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataVideoStream | 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 ngbNavItem [disabled]="videoFileMetadataAudioStream === undefined"> | |
97 | <a ngbNavLink i18n>Audio stream</a> | |
98 | <ng-template ngbNavContent> | |
99 | <div class="file-metadata"> | |
100 | <div class="metadata-attribute metadata-attribute-tags" *ngFor="let item of videoFileMetadataAudioStream | keyvalue"> | |
101 | <span i18n class="metadata-attribute-label">{{ item.value.label }}</span> | |
102 | <span class="metadata-attribute-value">{{ item.value.value }}</span> | |
103 | </div> | |
104 | </div> | |
105 | </ng-template> | |
106 | </ng-container> | |
107 | ||
108 | </ng-container> | |
109 | </div> | |
110 | ||
111 | <div *ngIf="getFileMetadata()" [ngbNavOutlet]="navMetadata"></div> | |
112 | ||
113 | <div class="download-type"> | |
114 | <div class="peertube-radio-container"> | |
115 | <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct"> | |
116 | <label i18n for="download-direct">Direct download</label> | |
117 | </div> | |
118 | ||
119 | <div class="peertube-radio-container"> | |
120 | <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent"> | |
121 | <label i18n for="download-torrent">Torrent (.torrent file)</label> | |
122 | </div> | |
123 | </div> | |
124 | </div> | |
125 | ||
126 | <div | |
127 | (click)="isAdvancedCustomizationCollapsed = !isAdvancedCustomizationCollapsed" | |
128 | role="button" class="advanced-filters-button" | |
129 | [attr.aria-expanded]="!isAdvancedCustomizationCollapsed" aria-controls="collapseBasic" | |
130 | > | |
131 | <ng-container *ngIf="isAdvancedCustomizationCollapsed"> | |
132 | <span class="glyphicon glyphicon-menu-down"></span> | |
133 | ||
134 | <ng-container i18n> | |
135 | Advanced | |
136 | </ng-container> | |
137 | </ng-container> | |
138 | ||
139 | <ng-container *ngIf="!isAdvancedCustomizationCollapsed"> | |
140 | <span class="glyphicon glyphicon-menu-up"></span> | |
141 | ||
142 | <ng-container i18n> | |
143 | Simple | |
144 | </ng-container> | |
145 | </ng-container> | |
146 | </div> | |
147 | </ng-container> | |
148 | </div> | |
149 | ||
150 | <div class="modal-footer inputs"> | |
151 | <input | |
152 | type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button" | |
153 | (click)="hide()" (key.enter)="hide()" | |
154 | > | |
155 | ||
156 | <input type="submit" i18n-value value="Download" class="peertube-button orange-button" (click)="download()" /> | |
157 | </div> | |
158 | </ng-template> |