@import '_variables';
@import '_mixins';
-my-redundancy-checkbox /deep/ my-peertube-checkbox {
- .form-group {
- margin-bottom: 0;
- align-items: center;
- }
-
- label {
- margin: 0;
- }
-}
-
.caption {
justify-content: flex-end;
-<div class="form-group">
+<div class="root">
<label class="form-group-checkbox">
<input type="checkbox" [(ngModel)]="checked" (ngModelChange)="onModelChange()" [id]="inputName" [disabled]="isDisabled" />
<span role="checkbox" [attr.aria-checked]="checked"></span>
@import '_variables';
@import '_mixins';
-.form-group {
+.root {
display: flex;
.form-group-checkbox {
}
}
+ label {
+ margin-bottom: 0;
+ }
+
my-help {
position: relative;
top: -2px;
<div [ngClass]="{ 'margin-content': marginContent }">
- <div *ngIf="titlePage" class="title-page title-page-single">
- {{ titlePage }}
+ <div class="videos-header">
+ <div *ngIf="titlePage" class="title-page title-page-single">
+ {{ titlePage }}
+ </div>
+ <my-video-feed [syndicationItems]="syndicationItems"></my-video-feed>
+
+ <div class="moderation-block" *ngIf="displayModerationBlock">
+ <my-peertube-checkbox
+ (change)="toggleModerationDisplay()"
+ inputName="display-unlisted-private" i18n-labelText labelText="Display unlisted and private videos"
+ >
+ </my-peertube-checkbox>
+ </div>
</div>
- <my-video-feed [syndicationItems]="syndicationItems"></my-video-feed>
<div class="no-results" i18n *ngIf="pagination.totalItems === 0">No results.</div>
<div
}
}
-.title-page.title-page-single {
- margin-right: 5px;
-}
+.videos-header {
+ display: flex;
+ height: 80px;
+ align-items: center;
+
+ .title-page.title-page-single {
+ margin: 0 5px 0 0;
+ }
-my-video-feed {
- display: inline-block;
+ my-video-feed {
+ display: inline-block;
+ position: relative;
+ top: 1px;
+ }
+
+ .moderation-block {
+ display: flex;
+ flex-grow: 1;
+ justify-content: flex-end;
+ align-items: center;
+ }
}
@media screen and (max-width: 500px) {
videoPages: Video[][] = []
ownerDisplayType: OwnerDisplayType = 'account'
firstLoadedPage: number
+ displayModerationBlock = false
protected baseVideoWidth = 215
protected baseVideoHeight = 205
)
}
+ toggleModerationDisplay () {
+ throw new Error('toggleModerationDisplay is not implemented')
+ }
+
protected hasMoreVideos () {
// No results
if (this.pagination.totalItems === 0) return false
[routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur }"
>
{{ video.name }}
+
+ <span *ngIf="isUnlistedVideo(video)" class="badge badge-warning" i18n>Unlisted</span>
+ <span *ngIf="isPrivateVideo(video)" class="badge badge-danger" i18n>Private</span>
</a>
<span i18n class="video-miniature-created-at-views">{{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
import { User } from '../users'
import { Video } from './video.model'
import { ServerService } from '@app/core'
+import { VideoPrivacy } from '../../../../../shared'
export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto'
displayOwnerVideoChannel () {
return this.ownerDisplayTypeChosen === 'videoChannel'
}
+
+ isUnlistedVideo () {
+ return this.video.privacy.id === VideoPrivacy.UNLISTED
+ }
+
+ isPrivateVideo () {
+ return this.video.privacy.id === VideoPrivacy.PRIVATE
+ }
}
@include peertube-select-container(auto);
}
+my-peertube-checkbox {
+ display: block;
+ margin-bottom: 1rem;
+}
+
.video-edit {
height: 100%;
min-height: 300px;
import { VideoFilter } from '../../../../../shared/models/videos/video-query.type'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { UserRight } from '../../../../../shared/models/users'
@Component({
selector: 'my-videos-local',
ngOnInit () {
super.ngOnInit()
+ if (this.authService.isLoggedIn()) {
+ const user = this.authService.getUser()
+ this.displayModerationBlock = user.hasRight(UserRight.SEE_ALL_VIDEOS)
+ }
+
this.generateSyndicationList()
}
generateSyndicationList () {
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter, this.categoryOneOf)
}
+
+ toggleModerationDisplay () {
+ this.filter = this.filter === 'local' ? 'all-local' as 'all-local' : 'local' as 'local'
+
+ this.reloadVideos()
+ }
}
display: block;
/* Fallback for non-webkit */
display: -webkit-box;
- max-height: $font-size*$line-height*$lines-to-show;
+ max-height: $font-size*$line-height*$lines-to-show + 0.2;
/* Fallback for non-webkit */
font-size: $font-size;
line-height: $line-height;