]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+videos/+video-watch/comment/video-comments.component.html
Refactor feed component
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / comment / video-comments.component.html
CommitLineData
4635f59d 1<div>
169310b2 2 <div class="title-block">
c9e3565d 3 <h2 class="title-page title-page-single">
db8b2f56 4 {totalNotDeletedComments, plural, =0 {Comments} =1 {1 Comment} other {{{totalNotDeletedComments}} Comments}}
c9e3565d 5 </h2>
53877968 6
c199c427 7 <my-feed [syndicationItems]="syndicationItems"></my-feed>
c1125bca 8
81f790af 9 <div ngbDropdown class="d-inline-block ml-4 dropdown-root">
e0433a5f 10 <button class="btn btn-sm btn-outline-secondary" id="dropdown-sort-comments" ngbDropdownToggle i18n>
14571f19 11 SORT BY
c1125bca 12 </button>
e0433a5f 13 <div ngbDropdownMenu aria-labelledby="dropdown-sort-comments">
c1125bca
RK
14 <button (click)="handleSortChange('-createdAt')" ngbDropdownItem i18n>Most recent first (default)</button>
15 <button (click)="handleSortChange('-totalReplies')" ngbDropdownItem i18n>Most replies first</button>
16 </div>
17 </div>
4635f59d
C
18 </div>
19
47564bbe
C
20 <ng-template [ngIf]="video.commentsEnabled === true">
21 <my-video-comment-add
47564bbe 22 [video]="video"
cf117aaa 23 [user]="user"
47564bbe 24 (commentCreated)="onCommentThreadCreated($event)"
f63c03fb 25 [textValue]="commentThreadRedraftValue"
47564bbe 26 ></my-video-comment-add>
4635f59d 27
9d6b9d10 28 <div *ngIf="totalNotDeletedComments === 0 && comments.length === 0" i18n>No comments.</div>
4635f59d 29
47564bbe
C
30 <div
31 class="comment-threads"
0cd4344f 32 myInfiniteScroller
aa55a4da 33 [autoInit]="true"
0cd4344f 34 (nearOfBottom)="onNearOfBottom()"
ad453580 35 [dataObservable]="onDataSubject.asObservable()"
47564bbe 36 >
b7e21681
RK
37 <div>
38 <div class="anchor" #commentHighlightBlock id="highlighted-comment"></div>
1263fc4e 39 <my-video-comment
bf079b7b 40 *ngIf="highlightedThread"
b1d40cff
C
41 [comment]="highlightedThread"
42 [video]="video"
43 [inReplyToCommentId]="inReplyToCommentId"
44 [commentTree]="threadComments[highlightedThread.id]"
45 [highlightedComment]="true"
c62a34d3 46 [firstInThread]="true"
b1d40cff
C
47 (wantedToReply)="onWantedToReply($event)"
48 (wantedToDelete)="onWantedToDelete($event)"
f63c03fb 49 (wantedToRedraft)="onWantedToRedraft($event)"
b1d40cff
C
50 (threadCreated)="onThreadCreated($event)"
51 (resetReply)="onResetReply()"
b29bf61d 52 (timestampClicked)="handleTimestampClicked($event)"
f63c03fb 53 [redraftValue]="commentReplyRedraftValue"
1263fc4e
C
54 ></my-video-comment>
55 </div>
56
c62a34d3 57 <div *ngFor="let comment of comments; index as i">
47564bbe 58 <my-video-comment
5b8072ee 59 *ngIf="!highlightedThread || comment.id !== highlightedThread.id"
47564bbe
C
60 [comment]="comment"
61 [video]="video"
62 [inReplyToCommentId]="inReplyToCommentId"
63 [commentTree]="threadComments[comment.id]"
c62a34d3 64 [firstInThread]="i + 1 !== comments.length"
47564bbe 65 (wantedToReply)="onWantedToReply($event)"
4cb6d457 66 (wantedToDelete)="onWantedToDelete($event)"
f63c03fb 67 (wantedToRedraft)="onWantedToRedraft($event)"
4cb6d457 68 (threadCreated)="onThreadCreated($event)"
47564bbe 69 (resetReply)="onResetReply()"
b29bf61d 70 (timestampClicked)="handleTimestampClicked($event)"
f63c03fb 71 [redraftValue]="commentReplyRedraftValue"
c62a34d3
RK
72 >
73 <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies mb-2">
74 <span class="glyphicon glyphicon-menu-down"></span>
e0433a5f 75
c62a34d3 76 <ng-container *ngIf="comment.totalRepliesFromVideoAuthor > 0; then hasAuthorComments; else noAuthorComments"></ng-container>
db8b2f56 77
c62a34d3
RK
78 <ng-template #hasAuthorComments>
79 <ng-container *ngIf="comment.totalReplies !== comment.totalRepliesFromVideoAuthor; else onlyAuthorComments" i18n>
db8b2f56 80 View {comment.totalReplies, plural, =1 {1 reply} other {{{ comment.totalReplies }} replies}} from {{ video?.account?.displayName || 'the author' }} and others
c62a34d3
RK
81 </ng-container>
82 <ng-template i18n #onlyAuthorComments>
db8b2f56 83 View {comment.totalReplies, plural, =1 {1 reply} other {{{ comment.totalReplies }} replies}} from {{ video?.account?.displayName || 'the author' }}
c62a34d3 84 </ng-template>
5b0413dd 85 </ng-template>
db8b2f56
C
86
87 <ng-template i18n #noAuthorComments>View {comment.totalReplies, plural, =1 {1 reply} other {{{ comment.totalReplies }} replies}}</ng-template>
e0433a5f 88
c62a34d3
RK
89 <my-small-loader class="comment-thread-loading ml-1" [loading]="threadLoading[comment.id]"></my-small-loader>
90 </div>
91 </my-video-comment>
5b0413dd 92
4635f59d
C
93 </div>
94 </div>
47564bbe
C
95 </ng-template>
96
b1d40cff 97 <div *ngIf="video.commentsEnabled === false" i18n>
47564bbe 98 Comments are disabled.
4635f59d
C
99 </div>
100</div>