Skip to content

Commit

Permalink
Add warning in download modal if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Mar 24, 2021
1 parent fd73468 commit b5ab0e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ <h4 class="modal-title">

<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()">
Expand All @@ -30,7 +34,7 @@ <h4 class="modal-title">
</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
: ''

Expand All @@ -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
}
Expand Down

0 comments on commit b5ab0e5

Please sign in to comment.