aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared/comment/video-comment.component.html
blob: d8b944b354d9e55a8ff4dedd0fb8958098563f70 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                                                             
                    
                                                                                                                           

                                       
 
                                                           


                                                                                                           
 
                                          
                                       
                                                   


                                                                                                                         
 

                                                                            
                
 
                                                                                                                                       

                                               
              
 





                                                             
 
                                     
                                                                                                 
 
                                      
                                                                                         
                                                                                                                                      
                                         

                     
 


                                                           
                                                                                     


                                                                         
                                                       


                                                   
 
                           
                                                                       





                                                        
                                 
                                  
                              
 
                               








                                                               
                                                       
                                         
                                                               
                                         

                              
            
 

                               

        



                                                                                 
<div *ngIf="isCommentDisplayed()" class="root-comment" [ngClass]="{ 'is-child': isChild() }">
  <div class="left">
    <my-actor-avatar *ngIf="!comment.isDeleted" [href]="comment.account.url" [account]="comment.account"></my-actor-avatar>
    <div class="vertical-border"></div>
  </div>

  <div class="right" [ngClass]="{ 'mb-3': firstInThread }">
    <div class="comment">
      <ng-container *ngIf="!comment.isDeleted">
        <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</div>

        <div class="comment-account-date">
          <div class="comment-account">
            <a [routerLink]="[ '/a', comment.by ]">
              <span class="comment-account-name" [ngClass]="{ 'video-author': video.account.id === comment.account.id }">
                {{ comment.account.displayName }}
              </span>

              <span class="comment-account-fid ml-1">{{ comment.by }}</span>
            </a>
          </div>

          <a [routerLink]="['/w', video.shortUUID, { 'threadId': comment.threadId }]" class="comment-date" [title]="comment.createdAt">
            {{ comment.createdAt | myFromNow }}
          </a>
        </div>

        <div
          class="comment-html"
          [innerHTML]="sanitizedCommentHTML"
          (timestampClicked)="handleTimestampClicked($event)"
          timestampRouteTransformer
        ></div>

        <div class="comment-actions">
          <div tabindex=0 (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div>

          <my-user-moderation-dropdown
            [prependActions]="prependModerationActions" tabindex=0 [buttonStyled]="false"
            buttonSize="small" [account]="commentAccount" [user]="commentUser" i18n-label label="Options" placement="bottom-left auto"
          ></my-user-moderation-dropdown>
        </div>
      </ng-container>

      <ng-container *ngIf="comment.isDeleted">
        <div class="comment-account-date">
          <span class="comment-account" i18n>Deleted</span>
          <a [routerLink]="['/w', video.shortUUID, { 'threadId': comment.threadId }]"
             class="comment-date">{{ comment.createdAt | myFromNow }}</a>
        </div>

        <div class="comment-html comment-html-deleted">
          <i i18n>This comment has been deleted</i>
        </div>
      </ng-container>

      <my-video-comment-add
        *ngIf="!comment.isDeleted && inReplyToCommentId === comment.id"
        [user]="user"
        [video]="video"
        [parentComment]="comment"
        [parentComments]="newParentComments"
        [focusOnInit]="true"
        (commentCreated)="onCommentReplyCreated($event)"
        (cancel)="onResetReply()"
        [textValue]="redraftValue"
      ></my-video-comment-add>

      <div *ngIf="commentTree">
        <div *ngFor="let commentChild of commentTree.children">
          <my-video-comment
            [comment]="commentChild.comment"
            [video]="video"
            [inReplyToCommentId]="inReplyToCommentId"
            [commentTree]="commentChild"
            [parentComments]="newParentComments"
            (wantedToReply)="onWantToReply($event)"
            (wantedToDelete)="onWantToDelete($event)"
            (wantedToRedraft)="onWantToRedraft($event)"
            (resetReply)="onResetReply()"
            (timestampClicked)="handleTimestampClicked($event)"
            [redraftValue]="redraftValue"
          ></my-video-comment>
        </div>
      </div>

      <ng-content></ng-content>
    </div>
  </div>
</div>

<ng-container *ngIf="prependModerationActions">
  <my-comment-report #commentReportModal [comment]="comment"></my-comment-report>
</ng-container>