aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2019-12-28 11:27:31 +0100
committerRigel Kent <sendmemail@rigelk.eu>2019-12-28 11:48:53 +0100
commit5b0413ddaa7949a6a44512a8281c5a23466599ae (patch)
tree07dafe7f97ffc1e7570e8b1ee9515f29d6c2d611 /client/src/app
parentbf64ed4196938ba9002c887cadb01bd2a6e3127a (diff)
downloadPeerTube-5b0413ddaa7949a6a44512a8281c5a23466599ae.tar.gz
PeerTube-5b0413ddaa7949a6a44512a8281c5a23466599ae.tar.zst
PeerTube-5b0413ddaa7949a6a44512a8281c5a23466599ae.zip
Add author indicator to the comment replies loader
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.model.ts2
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.html14
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.scss2
3 files changed, 15 insertions, 3 deletions
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 719d1f04e..aaeb0ea9c 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
@@ -15,6 +15,7 @@ export class VideoComment implements VideoCommentServerModel {
15 deletedAt: Date | string 15 deletedAt: Date | string
16 isDeleted: boolean 16 isDeleted: boolean
17 account: AccountInterface 17 account: AccountInterface
18 totalRepliesFromVideoAuthor: number
18 totalReplies: number 19 totalReplies: number
19 by: string 20 by: string
20 accountAvatarUrl: string 21 accountAvatarUrl: string
@@ -33,6 +34,7 @@ export class VideoComment implements VideoCommentServerModel {
33 this.deletedAt = hash.deletedAt ? new Date(hash.deletedAt.toString()) : null 34 this.deletedAt = hash.deletedAt ? new Date(hash.deletedAt.toString()) : null
34 this.isDeleted = hash.isDeleted 35 this.isDeleted = hash.isDeleted
35 this.account = hash.account 36 this.account = hash.account
37 this.totalRepliesFromVideoAuthor = hash.totalRepliesFromVideoAuthor
36 this.totalReplies = hash.totalReplies 38 this.totalReplies = hash.totalReplies
37 39
38 if (this.account) { 40 if (this.account) {
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.html b/client/src/app/videos/+video-watch/comment/video-comments.component.html
index e284eab0a..8f5c583d3 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.html
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.html
@@ -69,9 +69,19 @@
69 ></my-video-comment> 69 ></my-video-comment>
70 70
71 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies"> 71 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies">
72 <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container>
73
74 <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span> 72 <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
73
74 <ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container>
75 <ng-template #hasAuthorComments>
76 <ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n>
77 View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} and others
78 </ng-container>
79 <ng-template i18n #onlyAuthorComments>
80 View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }}
81 </ng-template>
82 </ng-template>
83 <ng-template i18n #noAuthorComments>View {{ comment.totalReplies }} replies</ng-template>
84
75 <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader> 85 <my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader>
76 </div> 86 </div>
77 </div> 87 </div>
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.scss b/client/src/app/videos/+video-watch/comment/video-comments.component.scss
index c02f6c21b..600bc1cee 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.scss
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.scss
@@ -14,7 +14,7 @@
14} 14}
15 15
16.glyphicon, .comment-thread-loading { 16.glyphicon, .comment-thread-loading {
17 margin-left: 5px; 17 margin-right: 5px;
18 display: inline-block; 18 display: inline-block;
19 font-size: 13px; 19 font-size: 13px;
20} 20}