aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/comment
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-25 15:43:19 +0200
committerChocobozzz <me@florianbigard.com>2018-04-25 15:43:19 +0200
commitd3e91a5f72ac9c986cdb67d7d6c85bb4819e680c (patch)
tree3c2406346c7774587ba4e095ab595e5953e25c61 /client/src/app/videos/+video-watch/comment
parent03e12d7c4954e1071fdeb7ef362ea5c3965d4075 (diff)
downloadPeerTube-d3e91a5f72ac9c986cdb67d7d6c85bb4819e680c.tar.gz
PeerTube-d3e91a5f72ac9c986cdb67d7d6c85bb4819e680c.tar.zst
PeerTube-d3e91a5f72ac9c986cdb67d7d6c85bb4819e680c.zip
Add video channel account list
Diffstat (limited to 'client/src/app/videos/+video-watch/comment')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-add.component.html2
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-add.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.component.html2
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.component.ts6
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.model.ts6
5 files changed, 6 insertions, 14 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html b/client/src/app/videos/+video-watch/comment/video-comment-add.component.html
index e393daa79..54d7286db 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html
+++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.html
@@ -1,6 +1,6 @@
1<form novalidate [formGroup]="form" (ngSubmit)="formValidated()"> 1<form novalidate [formGroup]="form" (ngSubmit)="formValidated()">
2 <div class="avatar-and-textarea"> 2 <div class="avatar-and-textarea">
3 <img [src]="getUserAvatarUrl()" alt="Avatar" /> 3 <img [src]="user.accountAvatarUrl" alt="Avatar" />
4 4
5 <div class="form-group"> 5 <div class="form-group">
6 <textarea placeholder="Add comment..." formControlName="text" [ngClass]="{ 'input-error': formErrors['text'] }" 6 <textarea placeholder="Add comment..." formControlName="text" [ngClass]="{ 'input-error': formErrors['text'] }"
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
index 731652fda..d1ca1968b 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
@@ -100,10 +100,6 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
100 return this.form.value['text'] 100 return this.form.value['text']
101 } 101 }
102 102
103 getUserAvatarUrl () {
104 return this.user.getAvatarUrl()
105 }
106
107 private addCommentReply (commentCreate: VideoCommentCreate) { 103 private addCommentReply (commentCreate: VideoCommentCreate) {
108 return this.videoCommentService 104 return this.videoCommentService
109 .addCommentReply(this.video.id, this.parentComment.id, commentCreate) 105 .addCommentReply(this.video.id, this.parentComment.id, commentCreate)
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.html b/client/src/app/videos/+video-watch/comment/video-comment.component.html
index 8a649e88f..06808ef80 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.component.html
+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.html
@@ -1,5 +1,5 @@
1<div class="root-comment"> 1<div class="root-comment">
2 <img [src]="getAvatarUrl(comment.account)" alt="Avatar" /> 2 <img [src]="comment.accountAvatarUrl" alt="Avatar" />
3 3
4 <div class="comment"> 4 <div class="comment">
5 <div *ngIf="highlightedComment === true" class="highlighted-comment">Highlighted comment</div> 5 <div *ngIf="highlightedComment === true" class="highlighted-comment">Highlighted comment</div>
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
index 26fc9d0b8..e90008de9 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
@@ -1,11 +1,9 @@
1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'
2import { LinkifierService } from '@app/videos/+video-watch/comment/linkifier.service' 2import { LinkifierService } from '@app/videos/+video-watch/comment/linkifier.service'
3import * as sanitizeHtml from 'sanitize-html' 3import * as sanitizeHtml from 'sanitize-html'
4import { Account as AccountInterface } from '../../../../../../shared/models/actors'
5import { UserRight } from '../../../../../../shared/models/users' 4import { UserRight } from '../../../../../../shared/models/users'
6import { VideoCommentThreadTree } from '../../../../../../shared/models/videos/video-comment.model' 5import { VideoCommentThreadTree } from '../../../../../../shared/models/videos/video-comment.model'
7import { AuthService } from '../../../core/auth' 6import { AuthService } from '../../../core/auth'
8import { Account } from '../../../shared/account/account.model'
9import { Video } from '../../../shared/video/video.model' 7import { Video } from '../../../shared/video/video.model'
10import { VideoComment } from './video-comment.model' 8import { VideoComment } from './video-comment.model'
11 9
@@ -80,10 +78,6 @@ export class VideoCommentComponent implements OnInit, OnChanges {
80 this.resetReply.emit() 78 this.resetReply.emit()
81 } 79 }
82 80
83 getAvatarUrl (account: AccountInterface) {
84 return Account.GET_ACCOUNT_AVATAR_URL(account)
85 }
86
87 isRemovableByUser () { 81 isRemovableByUser () {
88 return this.isUserLoggedIn() && 82 return this.isUserLoggedIn() &&
89 ( 83 (
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
index 8fa02aee1..fe591811e 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
@@ -1,6 +1,6 @@
1import { Account } from '@app/shared/account/account.model'
2import { Account as AccountInterface } from '../../../../../../shared/models/actors' 1import { Account as AccountInterface } from '../../../../../../shared/models/actors'
3import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model' 2import { VideoComment as VideoCommentServerModel } from '../../../../../../shared/models/videos/video-comment.model'
3import { Actor } from '@app/shared/actor/actor.model'
4 4
5export class VideoComment implements VideoCommentServerModel { 5export class VideoComment implements VideoCommentServerModel {
6 id: number 6 id: number
@@ -14,6 +14,7 @@ export class VideoComment implements VideoCommentServerModel {
14 account: AccountInterface 14 account: AccountInterface
15 totalReplies: number 15 totalReplies: number
16 by: string 16 by: string
17 accountAvatarUrl
17 18
18 constructor (hash: VideoCommentServerModel) { 19 constructor (hash: VideoCommentServerModel) {
19 this.id = hash.id 20 this.id = hash.id
@@ -27,6 +28,7 @@ export class VideoComment implements VideoCommentServerModel {
27 this.account = hash.account 28 this.account = hash.account
28 this.totalReplies = hash.totalReplies 29 this.totalReplies = hash.totalReplies
29 30
30 this.by = Account.CREATE_BY_STRING(this.account.name, this.account.host) 31 this.by = Actor.CREATE_BY_STRING(this.account.name, this.account.host)
32 this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account)
31 } 33 }
32} 34}