diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-02-04 11:11:32 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-02-07 11:24:35 +0100 |
commit | af6b45e5d96f37d986c54c1deb6d64e81cd0dbb0 (patch) | |
tree | 2dd64308d51c489b336674510e939e8317c4578b | |
parent | f33e515991a32885622b217bf2ed1d1b0d9d6832 (diff) | |
download | PeerTube-af6b45e5d96f37d986c54c1deb6d64e81cd0dbb0.tar.gz PeerTube-af6b45e5d96f37d986c54c1deb6d64e81cd0dbb0.tar.zst PeerTube-af6b45e5d96f37d986c54c1deb6d64e81cd0dbb0.zip |
client: show private badge in playlists
closes #2601
3 files changed, 26 insertions, 7 deletions
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html index 9cdee96b4..2400a4c25 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html | |||
@@ -15,10 +15,14 @@ | |||
15 | 15 | ||
16 | <div class="video-info"> | 16 | <div class="video-info"> |
17 | <ng-container *ngIf="playlistElement.video"> | 17 | <ng-container *ngIf="playlistElement.video"> |
18 | <a tabindex="-1" class="video-info-name" | 18 | <div class="video-info-header"> |
19 | [routerLink]="buildRouterLink()" [queryParams]="buildRouterQuery()" | 19 | <a tabindex="-1" class="video-info-name" |
20 | [attr.title]="playlistElement.video.name" | 20 | [routerLink]="buildRouterLink()" [queryParams]="buildRouterQuery()" |
21 | >{{ playlistElement.video.name }}</a> | 21 | [attr.title]="playlistElement.video.name" |
22 | >{{ playlistElement.video.name }}</a> | ||
23 | |||
24 | <span *ngIf="isVideoPrivate()" class="badge badge-yellow">Private</span> | ||
25 | </div> | ||
22 | 26 | ||
23 | <span class="video-miniature-created-at-views"> | 27 | <span class="video-miniature-created-at-views"> |
24 | <my-date-toggle [date]="playlistElement.video.publishedAt"></my-date-toggle> | 28 | <my-date-toggle [date]="playlistElement.video.publishedAt"></my-date-toggle> |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss index c476b3ac1..fbf67e892 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss | |||
@@ -82,8 +82,19 @@ my-video-thumbnail, | |||
82 | align-self: flex-start; | 82 | align-self: flex-start; |
83 | min-width: 0; | 83 | min-width: 0; |
84 | 84 | ||
85 | a { | 85 | .video-info-header { |
86 | width: auto; | 86 | display: flex; |
87 | align-items: baseline; | ||
88 | |||
89 | a { | ||
90 | width: auto; | ||
91 | padding-right: 5px; | ||
92 | } | ||
93 | |||
94 | .badge { | ||
95 | @include peertube-badge; | ||
96 | margin-right: 5px; | ||
97 | } | ||
87 | } | 98 | } |
88 | 99 | ||
89 | .video-info-account, | 100 | .video-info-account, |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index ea58d7f76..7a2574345 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | |||
@@ -3,7 +3,7 @@ import { AuthService, Notifier, ServerService } from '@app/core' | |||
3 | import { Video } from '@app/shared/shared-main' | 3 | import { Video } from '@app/shared/shared-main' |
4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
5 | import { secondsToTime } from '@shared/core-utils' | 5 | import { secondsToTime } from '@shared/core-utils' |
6 | import { HTMLServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models' | 6 | import { HTMLServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate, VideoPrivacy } from '@shared/models' |
7 | import { VideoPlaylistElement } from './video-playlist-element.model' | 7 | import { VideoPlaylistElement } from './video-playlist-element.model' |
8 | import { VideoPlaylist } from './video-playlist.model' | 8 | import { VideoPlaylist } from './video-playlist.model' |
9 | import { VideoPlaylistService } from './video-playlist.service' | 9 | import { VideoPlaylistService } from './video-playlist.service' |
@@ -51,6 +51,10 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
51 | this.serverConfig = this.serverService.getHTMLConfig() | 51 | this.serverConfig = this.serverService.getHTMLConfig() |
52 | } | 52 | } |
53 | 53 | ||
54 | isVideoPrivate () { | ||
55 | return this.playlistElement.video.privacy.id === VideoPrivacy.PRIVATE | ||
56 | } | ||
57 | |||
54 | isUnavailable (e: VideoPlaylistElement) { | 58 | isUnavailable (e: VideoPlaylistElement) { |
55 | return e.type === VideoPlaylistElementType.UNAVAILABLE | 59 | return e.type === VideoPlaylistElementType.UNAVAILABLE |
56 | } | 60 | } |