Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning and update privacy on share playlist #4469

Merged
merged 5 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ <h4 i18n class="modal-title">Share</h4>
<div class="playlist" *ngIf="playlist">
<div class="title-page title-page-single" i18n *ngIf="video">Share the playlist</div>


<div *ngIf="isPrivatePlaylist()" class="alert-private alert alert-warning">
<div i18n>This playlist is private so you won't be able to share it with external users</div>

<a i18n class="peertube-button-link orange-button" [routerLink]="[ '/my-library/video-playlists/update', playlist.uuid ]" target="_blank" rel="noopener noreferrer">
Update playlist privacy
</a>
</div>

<div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activePlaylistId">

<ng-container ngbNavItem="url">
Expand Down Expand Up @@ -65,6 +74,14 @@ <h4 i18n class="modal-title">Share</h4>
<div class="video" *ngIf="video">
<div class="title-page title-page-single" *ngIf="playlist" i18n>Share the video</div>

<div *ngIf="isPrivateVideo()" class="alert-private alert alert-warning">
<div i18n>This video is private so you won't be able to share it with external users</div>

<a i18n class="peertube-button-link orange-button" [routerLink]="[ '/videos/', 'update', video.shortUUID ]" target="_blank" rel="noopener noreferrer">
Update video privacy
</a>
</div>

<div ngbNav #nav="ngbNav" class="nav-tabs" [(activeId)]="activeVideoId">

<ng-container ngbNavItem="url">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ my-input-toggle-hidden {
}
}
}

.alert-private {
display: flex;
align-items: center;
justify-content: space-between;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { VideoDetails } from '@app/shared/shared-main'
import { VideoPlaylist } from '@app/shared/shared-video-playlist'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { buildPlaylistLink, buildVideoLink, decoratePlaylistLink, decorateVideoLink } from '@shared/core-utils'
import { VideoCaption } from '@shared/models'
import { VideoCaption, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
import { buildVideoOrPlaylistEmbed } from '../../../assets/player/utils'

type Customizations = {
Expand Down Expand Up @@ -126,6 +126,14 @@ export class VideoShareComponent {
return this.video.isLocal
}

isPrivateVideo () {
return this.video.privacy.id === VideoPrivacy.PRIVATE
}

isPrivatePlaylist () {
return this.playlist.privacy.id === VideoPlaylistPrivacy.PRIVATE
}

private getPlaylistOptions (baseUrl?: string) {
return {
baseUrl,
Expand Down