1
0
Fork 0

Add warning in download modal if needed

This commit is contained in:
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="modal-body">
<div class="form-group"> <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 input-group-sm">
<div class="input-group-prepend peertube-select-container"> <div class="input-group-prepend peertube-select-container">
<select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()"> <select *ngIf="type === 'video'" [(ngModel)]="resolutionId" (ngModelChange)="onResolutionIdChange()">
@ -30,7 +34,7 @@
</div> </div>
<input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" /> <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"> <button [cdkCopyToClipboard]="urlInput.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary">
<span class="glyphicon glyphicon-copy"></span> <span class="glyphicon glyphicon-copy"></span>
</button> </button>

View file

@ -116,7 +116,7 @@ export class VideoDownloadComponent {
const file = this.videoFile const file = this.videoFile
if (!file) return 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() ? '?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 () { getSubtitlesLink () {
return window.location.origin + this.videoCaptions.find(caption => caption.language.id === this.subtitleLanguageId).captionPath return window.location.origin + this.videoCaptions.find(caption => caption.language.id === this.subtitleLanguageId).captionPath
} }