Add warning in download modal if needed

pull/3888/head
Chocobozzz 2021-03-24 17:06:50 +01:00
parent e6ea0cac44
commit 51294901cf
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 10 additions and 2 deletions

View File

@ -18,6 +18,10 @@
<div class="modal-body">
<div class="form-group">
<div class="alert alert-warning" *ngIf="isConfidentialVideo()" i18n>
The following link contains a private token and should not be shared with anyone.
</div>
<div class="input-group input-group-sm">
<div class="input-group-prepend peertube-select-container">
<select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()">
@ -30,7 +34,7 @@
</div>
<input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" />
<div class="input-group-append">
<div class="input-group-append" *ngIf="!isConfidentialVideo()">
<button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary">
<span class="glyphicon glyphicon-copy"></span>
</button>

View File

@ -116,7 +116,7 @@ export class VideoDownloadComponent {
const file = this.videoFile
if (!file) return
const suffix = this.video.privacy.id === VideoPrivacy.PRIVATE || this.video.privacy.id === VideoPrivacy.INTERNAL
const suffix = this.isConfidentialVideo()
? '?access_token=' + this.auth.getAccessToken()
: ''
@ -129,6 +129,10 @@ export class VideoDownloadComponent {
}
}
isConfidentialVideo () {
return this.video.privacy.id === VideoPrivacy.PRIVATE || this.video.privacy.id === VideoPrivacy.INTERNAL
}
getSubtitlesLink () {
return window.location.origin + this.videoCaptions.find(caption => caption.language.id === this.subtitleLanguageId).captionPath
}