aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-27 14:37:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit2760b454a761f6af3138b2fb5f34340772ab0d1e (patch)
tree2b3a2d81478f8b432eb54cce4caa5a760c494627 /client/src/app/+admin
parente4611b54910d8e7f2b4f8a97ee2d9cc8e1054127 (diff)
downloadPeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.gz
PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.zst
PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.zip
Deprecate filter video query
Introduce include and isLocal instead
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.html13
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.scss2
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts32
3 files changed, 41 insertions, 6 deletions
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html
index 1f1e9cc6e..6250c00fb 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.html
+++ b/client/src/app/+admin/overview/videos/video-list.component.html
@@ -63,10 +63,17 @@
63 <my-video-cell [video]="video"></my-video-cell> 63 <my-video-cell [video]="video"></my-video-cell>
64 </td> 64 </td>
65 65
66 <td> 66 <td class="badges">
67 <span class="badge badge-blue" i18n>{{ video.privacy.label }}</span> 67 <span [ngClass]="getPrivacyBadgeClass(video.privacy.id)" class="badge" i18n>{{ video.privacy.label }}</span>
68
68 <span *ngIf="video.nsfw" class="badge badge-red" i18n>NSFW</span> 69 <span *ngIf="video.nsfw" class="badge badge-red" i18n>NSFW</span>
69 <span *ngIf="video.blocked" class="badge badge-red" i18n>NSFW</span> 70
71 <span *ngIf="isUnpublished(video.state.id)" class="badge badge-yellow" i18n>Not published yet</span>
72
73 <span *ngIf="isAccountBlocked(video)" class="badge badge-red" i18n>Account muted</span>
74 <span *ngIf="isServerBlocked(video)" class="badge badge-red" i18n>Server muted</span>
75
76 <span *ngIf="isVideoBlocked(video)" class="badge badge-red" i18n>Blocked</span>
70 </td> 77 </td>
71 78
72 <td> 79 <td>
diff --git a/client/src/app/+admin/overview/videos/video-list.component.scss b/client/src/app/+admin/overview/videos/video-list.component.scss
index fcdb457f2..250a917e4 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.scss
+++ b/client/src/app/+admin/overview/videos/video-list.component.scss
@@ -7,4 +7,6 @@ my-embed {
7 7
8.badge { 8.badge {
9 @include table-badge; 9 @include table-badge;
10
11 margin-right: 5px;
10} 12}
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index a445bc209..dd9225e6a 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { AuthService, ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' 4import { AuthService, ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
5import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' 5import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
6import { UserRight } from '@shared/models' 6import { UserRight, VideoPrivacy, VideoState } from '@shared/models'
7import { AdvancedInputFilter } from '@app/shared/shared-forms' 7import { AdvancedInputFilter } from '@app/shared/shared-forms'
8import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' 8import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
9 9
@@ -28,8 +28,12 @@ export class VideoListComponent extends RestTable implements OnInit {
28 title: $localize`Advanced filters`, 28 title: $localize`Advanced filters`,
29 children: [ 29 children: [
30 { 30 {
31 queryParams: { search: 'local:true' }, 31 queryParams: { search: 'isLocal:false' },
32 label: $localize`Only local videos` 32 label: $localize`Remote videos`
33 },
34 {
35 queryParams: { search: 'isLocal:true' },
36 label: $localize`Local videos`
33 } 37 }
34 ] 38 ]
35 } 39 }
@@ -88,6 +92,28 @@ export class VideoListComponent extends RestTable implements OnInit {
88 this.reloadData() 92 this.reloadData()
89 } 93 }
90 94
95 getPrivacyBadgeClass (privacy: VideoPrivacy) {
96 if (privacy === VideoPrivacy.PUBLIC) return 'badge-blue'
97
98 return 'badge-yellow'
99 }
100
101 isUnpublished (state: VideoState) {
102 return state !== VideoState.PUBLISHED
103 }
104
105 isAccountBlocked (video: Video) {
106 return video.blockedOwner
107 }
108
109 isServerBlocked (video: Video) {
110 return video.blockedServer
111 }
112
113 isVideoBlocked (video: Video) {
114 return video.blacklisted
115 }
116
91 protected reloadData () { 117 protected reloadData () {
92 this.selectedVideos = [] 118 this.selectedVideos = []
93 119