aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-03-24 17:06:50 +0100
committerChocobozzz <me@florianbigard.com>2021-03-24 17:06:50 +0100
commitb5ab0e5bf7434e93e7c9f83897f62bbb2b03acce (patch)
tree2a269c25c4f41db1a637784b0e1cf483af20bdcd /client/src/app
parentfd734688850e04058895c13e576edba3cf6510fc (diff)
downloadPeerTube-b5ab0e5bf7434e93e7c9f83897f62bbb2b03acce.tar.gz
PeerTube-b5ab0e5bf7434e93e7c9f83897f62bbb2b03acce.tar.zst
PeerTube-b5ab0e5bf7434e93e7c9f83897f62bbb2b03acce.zip
Add warning in download modal if needed
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/shared/shared-video-miniature/video-download.component.html6
-rw-r--r--client/src/app/shared/shared-video-miniature/video-download.component.ts6
2 files changed, 10 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.html b/client/src/app/shared/shared-video-miniature/video-download.component.html
index 45ba555af..4608e93e7 100644
--- a/client/src/app/shared/shared-video-miniature/video-download.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.html
@@ -18,6 +18,10 @@
18 18
19 <div class="modal-body"> 19 <div class="modal-body">
20 <div class="form-group"> 20 <div class="form-group">
21 <div class="alert alert-warning" *ngIf="isConfidentialVideo()" i18n>
22 The following link contains a private token and should not be shared with anyone.
23 </div>
24
21 <div class="input-group input-group-sm"> 25 <div class="input-group input-group-sm">
22 <div class="input-group-prepend peertube-select-container"> 26 <div class="input-group-prepend peertube-select-container">
23 <select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()"> 27 <select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()">
@@ -30,7 +34,7 @@
30 </div> 34 </div>
31 35
32 <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> 36 <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" />
33 <div class="input-group-append"> 37 <div class="input-group-append" *ngIf="!isConfidentialVideo()">
34 <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary"> 38 <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary">
35 <span class="glyphicon glyphicon-copy"></span> 39 <span class="glyphicon glyphicon-copy"></span>
36 </button> 40 </button>
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts
index 70b27b105..90f4daf7c 100644
--- a/client/src/app/shared/shared-video-miniature/video-download.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts
@@ -116,7 +116,7 @@ export class VideoDownloadComponent {
116 const file = this.videoFile 116 const file = this.videoFile
117 if (!file) return 117 if (!file) return
118 118
119 const suffix = this.video.privacy.id === VideoPrivacy.PRIVATE || this.video.privacy.id === VideoPrivacy.INTERNAL 119 const suffix = this.isConfidentialVideo()
120 ? '?access_token=' + this.auth.getAccessToken() 120 ? '?access_token=' + this.auth.getAccessToken()
121 : '' 121 : ''
122 122
@@ -129,6 +129,10 @@ export class VideoDownloadComponent {
129 } 129 }
130 } 130 }
131 131
132 isConfidentialVideo () {
133 return this.video.privacy.id === VideoPrivacy.PRIVATE || this.video.privacy.id === VideoPrivacy.INTERNAL
134 }
135
132 getSubtitlesLink () { 136 getSubtitlesLink () {
133 return window.location.origin + this.videoCaptions.find(caption => caption.language.id === this.subtitleLanguageId).captionPath 137 return window.location.origin + this.videoCaptions.find(caption => caption.language.id === this.subtitleLanguageId).captionPath
134 } 138 }