deletedAt: Date | string
isDeleted: boolean
account: AccountInterface
+ totalRepliesFromVideoAuthor: number
totalReplies: number
by: string
accountAvatarUrl: string
this.deletedAt = hash.deletedAt ? new Date(hash.deletedAt.toString()) : null
this.isDeleted = hash.isDeleted
this.account = hash.account
+ this.totalRepliesFromVideoAuthor = hash.totalRepliesFromVideoAuthor
this.totalReplies = hash.totalReplies
if (this.account) {
></my-video-comment>
<div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies">
- <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container>
-
<span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span>
+
+ <ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container>
+ <ng-template #hasAuthorComments>
+ <ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n>
+ View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }} and others
+ </ng-container>
+ <ng-template i18n #onlyAuthorComments>
+ View {{ comment.totalReplies }} replies from {{ video?.account?.displayName || 'the author' }}
+ </ng-template>
+ </ng-template>
+ <ng-template i18n #noAuthorComments>View {{ comment.totalReplies }} replies</ng-template>
+
<my-small-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-small-loader>
</div>
</div>
}
.glyphicon, .comment-thread-loading {
- margin-left: 5px;
+ margin-right: 5px;
display: inline-block;
font-size: 13px;
}
')'
),
'totalReplies'
+ ],
+ [
+ Sequelize.literal(
+ '(' +
+ 'SELECT COUNT("replies"."id") ' +
+ 'FROM "videoComment" AS "replies" ' +
+ 'WHERE "replies"."originCommentId" = "VideoCommentModel"."id" ' +
+ 'AND "accountId" = ' + userAccountId +
+ ')'
+ ),
+ 'totalRepliesFromVideoAuthor'
]
]
}
updatedAt: this.updatedAt,
deletedAt: this.deletedAt,
isDeleted: this.isDeleted(),
+ totalRepliesFromVideoAuthor: this.get('totalRepliesFromVideoAuthor') || 0,
totalReplies: this.get('totalReplies') || 0,
account: this.Account ? this.Account.toFormattedJSON() : null
} as VideoComment
updatedAt: Date | string
deletedAt: Date | string
isDeleted: boolean
+ totalRepliesFromVideoAuthor: number
totalReplies: number
account: Account
}
type: string
updatedAt:
type: string
+ totalRepliesFromVideoAuthor:
+ type: number
totalReplies:
type: number
account: