aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation/registration-list/registration-list.component.html
blob: 4f9d06accc2ade0347b00234110830270f26c3eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<h1>
  <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
  <ng-container i18n>Registration requests</ng-container>
</h1>

<p-table
  [value]="registrations" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
  [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
  [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false"
  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
  currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} registrations"
  [expandedRowKeys]="expandedRows"
>
  <ng-template pTemplate="caption">
    <div class="caption">
      <div class="ms-auto">
        <my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter>
      </div>
    </div>
  </ng-template>

  <ng-template pTemplate="header">
    <tr> <!-- header -->
      <th style="width: 40px;"></th>
      <th style="width: 150px;"></th>
      <th i18n>Account</th>
      <th i18n>Email</th>
      <th i18n>Channel</th>
      <th i18n>Registration reason</th>
      <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th>
      <th i18n>Moderation response</th>
      <th style="width: 150px;" i18n pSortableColumn="createdAt">Requested on <p-sortIcon field="createdAt"></p-sortIcon></th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-expanded="expanded" let-registration>
    <tr>
      <td class="expand-cell" [pRowToggler]="registration">
        <my-table-expander-icon [expanded]="expanded"></my-table-expander-icon>
      </td>

      <td class="action-cell">
        <my-action-dropdown
          [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body"
          i18n-label label="Actions" [actions]="registrationActions" [entry]="registration"
        ></my-action-dropdown>
      </td>

      <td>
        <div class="chip two-lines">
          <div>
            <span>{{ registration.username }}</span>
            <span class="muted">{{ registration.accountDisplayName }}</span>
          </div>
        </div>
      </td>

      <td>
        <my-user-email-info [entry]="registration" [requiresEmailVerification]="requiresEmailVerification"></my-user-email-info>
      </td>

      <td>
        <div class="chip two-lines">
          <div>
            <span>{{ registration.channelHandle }}</span>
            <span class="muted">{{ registration.channelDisplayName }}</span>
          </div>
        </div>
      </td>

      <td container="body" placement="left auto" [ngbTooltip]="registration.registrationReason">
        {{ registration.registrationReason }}
      </td>

      <td class="c-hand abuse-states" [pRowToggler]="registration">
        <my-global-icon *ngIf="isRegistrationAccepted(registration)" [title]="registration.state.label" iconName="tick"></my-global-icon>
        <my-global-icon *ngIf="isRegistrationRejected(registration)" [title]="registration.state.label" iconName="cross"></my-global-icon>
      </td>

      <td container="body" placement="left auto" [ngbTooltip]="registration.moderationResponse">
        {{ registration.moderationResponse }}
      </td>

      <td class="c-hand" [pRowToggler]="registration">{{ registration.createdAt | date: 'short'  }}</td>
    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-registration>
    <tr>
      <td colspan="9">
        <div class="moderation-expanded">
          <div class="left">
            <div class="d-flex">
              <span class="moderation-expanded-label" i18n>Registration reason:</span>
              <span class="moderation-expanded-text" [innerHTML]="registration.registrationReasonHTML"></span>
            </div>

            <div *ngIf="registration.moderationResponse">
              <span class="moderation-expanded-label" i18n>Moderation response:</span>
              <span class="moderation-expanded-text" [innerHTML]="registration.moderationResponseHTML"></span>
            </div>
          </div>
        </div>
      </td>
    </tr>
  </ng-template>

  <ng-template pTemplate="emptymessage">
    <tr>
      <td colspan="9">
        <div class="no-results">
          <ng-container *ngIf="search" i18n>No registrations found matching current filters.</ng-container>
          <ng-container *ngIf="!search" i18n>No registrations found.</ng-container>
        </div>
      </td>
    </tr>
  </ng-template>
</p-table>

<my-process-registration-modal #processRegistrationModal (registrationProcessed)="onRegistrationProcessed()"></my-process-registration-modal>