aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html
blob: 204cb209eb4a245826aa7a01b5c9ffe0b99f3cea (plain) (tree)
1
2
3
4
5
6
7
8
9
        

                                                                                                                                                     
                                                               
                                                                                                   
 
                                  

                                    
                                                                 
                         
                                                                                                                        
                                                                                                              
                                     


                
                                                                       
        

                                                                                                                                        




                                                                                                           












                                                                                                                                          

            
 
          
                                                                                                                             
                                                                                                                                 

                                     
           
 

                                         
                                                                       

                                                                                                                                  
                                                                                                                                     

           
                              
                                                                                                                                                                              




                                                       
          











                                                                                                                   
 
                               





                                                                                                            
                  


                

                
 
                                                                                                                                   
<p-table
  [value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true"
  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
  currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports"
>
  <ng-template pTemplate="header">
    <tr> <!-- header -->
      <th style="width: 40px;"></th>
      <th style="width: 20%;" pResizableColumn i18n>Reporter</th>
      <th i18n>Video</th>
      <th style="width:190px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
      <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th>
      <th style="width: 120px;"></th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-expanded="expanded" let-videoAbuse>
    <tr>
      <td class="c-hand" [pRowToggler]="videoAbuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
        <span class="expander">
          <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
        </span>
      </td>

      <td>
        <a [href]="videoAbuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
          <div class="chip two-lines">
            <img
              class="avatar"
              [src]="videoAbuse.reporterAccount.avatar.path"
              (error)="switchToDefaultAvatar($event)"
              alt="Avatar"
            >
            <div>
              {{ videoAbuse.reporterAccount.displayName }}
              <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
            </div>
          </div>
        </a>
      </td>

      <td>
        <span *ngIf="videoAbuse.video.deleted" i18n-title title="Video was deleted" class="glyphicon glyphicon-trash"></span>
        <a [href]="getVideoUrl(videoAbuse)" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
          {{ videoAbuse.video.name }}
        </a>
      </td>

      <td>{{ videoAbuse.createdAt }}</td>

      <td class="c-hand video-abuse-states" [pRowToggler]="videoAbuse">
        <span *ngIf="isVideoAbuseAccepted(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-ok"></span>
        <span *ngIf="isVideoAbuseRejected(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-remove"></span>
        <span *ngIf="videoAbuse.moderationComment" [title]="videoAbuse.moderationComment" class="glyphicon glyphicon-comment"></span>
      </td>

      <td class="action-cell">
        <my-action-dropdown placement="bottom-right auto" container="body" i18n-label label="Actions" [actions]="videoAbuseActions" [entry]="videoAbuse"></my-action-dropdown>
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-videoAbuse>
      <tr>
        <td class="expand-cell" colspan="6">
          <div class="d-flex">
            <div class="col-8">
              <div class="d-flex">
                <span class="col-3 moderation-expanded-label" i18n>Reason:</span>
                <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span>
              </div>
              <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
                <span class="col-3 moderation-expanded-label" i18n>Note:</span>
                <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span>
              </div>
            </div>

            <div class="col-4">
              <div class="screenratio">
                <div *ngIf="videoAbuse.video.deleted">
                  <span i18n>The video was {{ videoAbuse.video.deleted ? 'deleted' : 'blacklisted' }}</span>
                </div>
                <div *ngIf="!videoAbuse.video.deleted" [innerHTML]="videoAbuse.embedHtml"></div>
              </div>
            </div>
          </div>
        </td>
      </tr>
  </ng-template>
</p-table>

<my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>