aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-16 11:55:17 +0100
committerChocobozzz <me@florianbigard.com>2020-11-16 13:48:58 +0100
commitf1273314593a4a7dc7ec9594ce0c6c3ae8f62b34 (patch)
treecf1f3949e64a24a820833950d7b2bbf9ccd40013 /client/src/app/shared
parent0f8d00e3144060270d7fe603865fccaf18649c47 (diff)
downloadPeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.tar.gz
PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.tar.zst
PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.zip
Add admin view to manage comments
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared-main/feeds/feed.component.html2
-rw-r--r--client/src/app/shared/shared-main/feeds/feed.component.scss2
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.model.ts11
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.service.ts7
4 files changed, 15 insertions, 7 deletions
diff --git a/client/src/app/shared/shared-main/feeds/feed.component.html b/client/src/app/shared/shared-main/feeds/feed.component.html
index 13883fd9b..a00011785 100644
--- a/client/src/app/shared/shared-main/feeds/feed.component.html
+++ b/client/src/app/shared/shared-main/feeds/feed.component.html
@@ -1,4 +1,4 @@
1<div class="video-feed"> 1<div class="feed">
2 <my-global-icon 2 <my-global-icon
3 *ngIf="syndicationItems.length !== 0" [ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto" 3 *ngIf="syndicationItems.length !== 0" [ngbPopover]="feedsList" [autoClose]="true" placement="bottom left auto"
4 class="icon-syndication" role="button" iconName="syndication" 4 class="icon-syndication" role="button" iconName="syndication"
diff --git a/client/src/app/shared/shared-main/feeds/feed.component.scss b/client/src/app/shared/shared-main/feeds/feed.component.scss
index 34dd0e937..333d59440 100644
--- a/client/src/app/shared/shared-main/feeds/feed.component.scss
+++ b/client/src/app/shared/shared-main/feeds/feed.component.scss
@@ -1,7 +1,7 @@
1@import '_variables'; 1@import '_variables';
2@import '_mixins'; 2@import '_mixins';
3 3
4.video-feed { 4.feed {
5 width: min-content; 5 width: min-content;
6 6
7 a { 7 a {
diff --git a/client/src/app/shared/shared-video-comment/video-comment.model.ts b/client/src/app/shared/shared-video-comment/video-comment.model.ts
index 1589091e5..eeee397af 100644
--- a/client/src/app/shared/shared-video-comment/video-comment.model.ts
+++ b/client/src/app/shared/shared-video-comment/video-comment.model.ts
@@ -59,12 +59,14 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel {
59 createdAt: Date | string 59 createdAt: Date | string
60 updatedAt: Date | string 60 updatedAt: Date | string
61 61
62 account: AccountInterface 62 account: AccountInterface & { localUrl?: string }
63 localUrl: string
63 64
64 video: { 65 video: {
65 id: number 66 id: number
66 uuid: string 67 uuid: string
67 name: string 68 name: string
69 localUrl: string
68 } 70 }
69 71
70 by: string 72 by: string
@@ -85,14 +87,19 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel {
85 this.video = { 87 this.video = {
86 id: hash.video.id, 88 id: hash.video.id,
87 uuid: hash.video.uuid, 89 uuid: hash.video.uuid,
88 name: hash.video.name 90 name: hash.video.name,
91 localUrl: '/videos/watch/' + hash.video.uuid
89 } 92 }
90 93
94 this.localUrl = this.video.localUrl + ';threadId=' + this.threadId
95
91 this.account = hash.account 96 this.account = hash.account
92 97
93 if (this.account) { 98 if (this.account) {
94 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host) 99 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
95 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) 100 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
101
102 this.account.localUrl = '/accounts/' + this.by
96 } 103 }
97 } 104 }
98} 105}
diff --git a/client/src/app/shared/shared-video-comment/video-comment.service.ts b/client/src/app/shared/shared-video-comment/video-comment.service.ts
index e318e069d..1ab996a76 100644
--- a/client/src/app/shared/shared-video-comment/video-comment.service.ts
+++ b/client/src/app/shared/shared-video-comment/video-comment.service.ts
@@ -19,8 +19,9 @@ import { SortMeta } from 'primeng/api'
19 19
20@Injectable() 20@Injectable()
21export class VideoCommentService { 21export class VideoCommentService {
22 static BASE_FEEDS_URL = environment.apiUrl + '/feeds/video-comments.'
23
22 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' 24 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/'
23 private static BASE_FEEDS_URL = environment.apiUrl + '/feeds/video-comments.'
24 25
25 constructor ( 26 constructor (
26 private authHttp: HttpClient, 27 private authHttp: HttpClient,
@@ -56,7 +57,7 @@ export class VideoCommentService {
56 search?: string 57 search?: string
57 }): Observable<ResultList<VideoCommentAdmin>> { 58 }): Observable<ResultList<VideoCommentAdmin>> {
58 const { pagination, sort, search } = options 59 const { pagination, sort, search } = options
59 const url = VideoCommentService.BASE_VIDEO_URL + '/comments' 60 const url = VideoCommentService.BASE_VIDEO_URL + 'comments'
60 61
61 let params = new HttpParams() 62 let params = new HttpParams()
62 params = this.restService.addRestGetParams(params, pagination, sort) 63 params = this.restService.addRestGetParams(params, pagination, sort)
@@ -172,7 +173,7 @@ export class VideoCommentService {
172 173
173 private buildParamsFromSearch (search: string, params: HttpParams) { 174 private buildParamsFromSearch (search: string, params: HttpParams) {
174 const filters = this.restService.parseQueryStringFilter(search, { 175 const filters = this.restService.parseQueryStringFilter(search, {
175 state: { 176 isLocal: {
176 prefix: 'local:', 177 prefix: 'local:',
177 isBoolean: true, 178 isBoolean: true,
178 handler: v => { 179 handler: v => {