]>
Commit | Line | Data |
---|---|---|
76314386 RK |
1 | <nav aria-label="breadcrumb"> |
2 | <ol class="breadcrumb"> | |
3 | <li class="breadcrumb-item"> | |
4 | <a routerLink="/admin/users" i18n>Users</a> | |
5 | </li> | |
7da18e44 | 6 | |
76314386 RK |
7 | <ng-container *ngIf="isCreation()"> |
8 | <li class="breadcrumb-item active" i18n>Create</li> | |
9 | </ng-container> | |
10 | <ng-container *ngIf="!isCreation()"> | |
11 | <li class="breadcrumb-item active" i18n>Edit</li> | |
12 | <li class="breadcrumb-item active" aria-current="page"> | |
71887396 | 13 | <a *ngIf="user" [routerLink]="[ '/a', user?.username ]">{{ user?.username }}</a> |
76314386 RK |
14 | </li> |
15 | </ng-container> | |
16 | </ol> | |
17 | </nav> | |
7da18e44 | 18 | |
76314386 RK |
19 | <ng-template #dashboard> |
20 | <div *ngIf="!isCreation() && user" class="dashboard"> | |
21 | <div> | |
22 | <a> | |
23 | <div class="dashboard-num">{{ user.videosCount }} ({{ user.videoQuotaUsed | bytes: 0 }})</div> | |
24 | <div class="dashboard-label" i18n>{user.videosCount, plural, =1 {Video} other {Videos}}</div> | |
25 | </a> | |
04e0fc48 | 26 | </div> |
76314386 RK |
27 | <div> |
28 | <a> | |
29 | <div class="dashboard-num">{{ user.videoChannels.length || 0 }}</div> | |
30 | <div class="dashboard-label" i18n>{user.videoChannels.length, plural, =1 {Channel} other {Channels}}</div> | |
31 | </a> | |
04e0fc48 | 32 | </div> |
76314386 RK |
33 | <div> |
34 | <a> | |
35 | <div class="dashboard-num">{{ subscribersCount }}</div> | |
36 | <div class="dashboard-label" i18n>{subscribersCount, plural, =1 {Subscriber} other {Subscribers}}</div> | |
37 | </a> | |
38 | </div> | |
39 | <div> | |
4f32032f C |
40 | <a [routerLink]="[ '/admin/moderation/abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' + user?.account.displayName + '"' }"> |
41 | <div class="dashboard-num">{{ user.abusesCount }}</div> | |
76314386 RK |
42 | <div class="dashboard-label" i18n>Incriminated in reports</div> |
43 | </a> | |
44 | </div> | |
45 | <div> | |
4f32032f C |
46 | <a [routerLink]="[ '/admin/moderation/abuses/list' ]" [queryParams]="{ 'search': 'reporter:"' + user?.account.displayName + '" state:accepted' }"> |
47 | <div class="dashboard-num">{{ user.abusesAcceptedCount }} / {{ user.abusesCreatedCount }}</div> | |
76314386 RK |
48 | <div class="dashboard-label" i18n>Authored reports accepted</div> |
49 | </a> | |
50 | </div> | |
51 | <div> | |
52 | <a> | |
53 | <div class="dashboard-num">{{ user.videoCommentsCount }}</div> | |
54 | <div class="dashboard-label" i18n>{user.videoCommentsCount, plural, =1 {Comment} other {Comments}}</div> | |
55 | </a> | |
04e0fc48 C |
56 | </div> |
57 | </div> | |
76314386 | 58 | </ng-template> |
954605a8 | 59 | |
4c8749cb | 60 | <div class="row d-xxl-none"> <!-- hidden on large screens, as it is then displayed on the right side of the form --> |
76314386 | 61 | <div class="col-12 col-xl-3"></div> |
954605a8 | 62 | |
e2c1f779 | 63 | <div class="col-12 col-xl-9"> |
76314386 | 64 | <ng-template *ngTemplateOutlet="dashboard"></ng-template> |
04e0fc48 | 65 | </div> |
76314386 | 66 | </div> |
6a84aafd | 67 | |
76314386 | 68 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> |
d6ca951b | 69 | |
4c8749cb C |
70 | <div class="row mt-4"> <!-- user grid --> |
71 | <div class="col-12 col-lg-4 col-xl-3"> | |
76314386 RK |
72 | <div class="anchor" id="user"></div> <!-- user anchor --> |
73 | <div *ngIf="isCreation()" class="account-title" i18n>NEW USER</div> | |
74 | <div *ngIf="!isCreation() && user" class="account-title"> | |
cdeddff1 | 75 | <my-actor-avatar-edit [actor]="user.account" [editable]="false" [displaySubscribers]="false" [displayUsername]="false"></my-actor-avatar-edit> |
d6ca951b C |
76 | </div> |
77 | </div> | |
78 | ||
4c8749cb C |
79 | <div class="col-12 col-lg-8 col-xl-9"> |
80 | <div class="row"> | |
81 | <form class="col" role="form" (ngSubmit)="formValidated()" [formGroup]="form"> | |
82 | <div class="form-group" *ngIf="isCreation()"> | |
83 | <label i18n for="username">Username</label> | |
84 | <input | |
85 | type="text" id="username" i18n-placeholder placeholder="john" class="form-control" | |
86 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" | |
87 | > | |
88 | <div *ngIf="formErrors.username" class="form-error"> | |
89 | {{ formErrors.username }} | |
90 | </div> | |
76314386 | 91 | </div> |
767bb14a | 92 | |
4c8749cb C |
93 | <div class="form-group" *ngIf="isCreation()"> |
94 | <label i18n for="channelName">Channel name</label> | |
95 | <input | |
96 | type="text" id="channelName" i18n-placeholder placeholder="john_channel" class="form-control" | |
97 | formControlName="channelName" [ngClass]="{ 'input-error': formErrors['channelName'] }" | |
98 | > | |
99 | <div *ngIf="formErrors.channelName" class="form-error"> | |
100 | {{ formErrors.channelName }} | |
101 | </div> | |
62fc6915 | 102 | </div> |
62fc6915 | 103 | |
4c8749cb C |
104 | <div class="form-group"> |
105 | <label i18n for="email">Email</label> | |
106 | <input | |
107 | type="text" id="email" i18n-placeholder placeholder="mail@example.com" class="form-control" | |
108 | formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }" | |
109 | autocomplete="off" [readonly]="user && user.pluginAuth !== null" | |
110 | > | |
111 | <div *ngIf="formErrors.email" class="form-error"> | |
112 | {{ formErrors.email }} | |
113 | </div> | |
76314386 | 114 | </div> |
767bb14a | 115 | |
4c8749cb C |
116 | <div class="form-group" *ngIf="isCreation()"> |
117 | <label i18n for="password">Password</label> | |
f3bc1b54 | 118 | |
4c8749cb C |
119 | <my-help *ngIf="isPasswordOptional()"> |
120 | <ng-template ptTemplate="customHtml"> | |
121 | <ng-container i18n> | |
122 | If you leave the password empty, an email will be sent to the user. | |
123 | </ng-container> | |
124 | </ng-template> | |
125 | </my-help> | |
126 | ||
75084782 | 127 | <my-input-text formControlName="password" inputId="password" [formError]="formErrors['password']" autocomplete="new-password"></my-input-text> |
76314386 | 128 | </div> |
767bb14a | 129 | |
4c8749cb C |
130 | <div class="form-group"> |
131 | <label i18n for="role">Role</label> | |
132 | <div class="peertube-select-container"> | |
133 | <select id="role" formControlName="role" class="form-control"> | |
134 | <option *ngFor="let role of roles" [value]="role.value"> | |
135 | {{ role.label }} | |
136 | </option> | |
137 | </select> | |
138 | </div> | |
139 | ||
140 | <div *ngIf="formErrors.role" class="form-error"> | |
141 | {{ formErrors.role }} | |
142 | </div> | |
76314386 | 143 | </div> |
767bb14a | 144 | |
4c8749cb C |
145 | <div class="form-group"> |
146 | <label i18n for="videoQuota">Video quota</label> | |
147 | ||
148 | <my-select-custom-value | |
149 | id="videoQuota" | |
150 | [items]="videoQuotaOptions" | |
151 | formControlName="videoQuota" | |
152 | i18n-inputSuffix inputSuffix="bytes" inputType="number" | |
153 | [clearable]="false" | |
154 | ></my-select-custom-value> | |
155 | ||
f67ac646 | 156 | <my-user-real-quota-info [videoQuota]="getUserVideoQuota()"></my-user-real-quota-info> |
4c8749cb C |
157 | |
158 | <div *ngIf="formErrors.videoQuota" class="form-error"> | |
159 | {{ formErrors.videoQuota }} | |
160 | </div> | |
76314386 | 161 | </div> |
767bb14a | 162 | |
4c8749cb C |
163 | <div class="form-group"> |
164 | <label i18n for="videoQuotaDaily">Daily video quota</label> | |
21e493d4 | 165 | |
4c8749cb C |
166 | <my-select-custom-value |
167 | id="videoQuotaDaily" | |
168 | [items]="videoQuotaDailyOptions" | |
169 | formControlName="videoQuotaDaily" | |
170 | i18n-inputSuffix inputSuffix="bytes" inputType="number" | |
171 | [clearable]="false" | |
172 | ></my-select-custom-value> | |
767bb14a | 173 | |
4c8749cb C |
174 | <div *ngIf="formErrors.videoQuotaDaily" class="form-error"> |
175 | {{ formErrors.videoQuotaDaily }} | |
176 | </div> | |
76314386 | 177 | </div> |
767bb14a | 178 | |
4c8749cb C |
179 | <div class="form-group" *ngIf="!isCreation() && getAuthPlugins().length !== 0"> |
180 | <label i18n for="pluginAuth">Auth plugin</label> | |
6d989edc | 181 | |
4c8749cb C |
182 | <div class="peertube-select-container"> |
183 | <select id="pluginAuth" formControlName="pluginAuth" class="form-control"> | |
184 | <option [value]="null" i18n>None (local authentication)</option> | |
185 | <option *ngFor="let authPlugin of getAuthPlugins()" [value]="authPlugin">{{ authPlugin }}</option> | |
186 | </select> | |
187 | </div> | |
6d989edc | 188 | </div> |
6d989edc | 189 | |
4c8749cb C |
190 | <div class="form-group"> |
191 | <my-peertube-checkbox | |
192 | inputName="byPassAutoBlock" formControlName="byPassAutoBlock" | |
06a9fdf4 C |
193 | i18n-labelText labelText="User bypasses video validation by moderators" |
194 | > | |
195 | <ng-container ngProjectAs="description" i18n> | |
196 | Enable this checkbox if this user doesn't need to have its videos reviewed by moderators. | |
197 | </ng-container> | |
198 | </my-peertube-checkbox> | |
4c8749cb | 199 | </div> |
767bb14a | 200 | |
4c8749cb C |
201 | <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid"> |
202 | </form> | |
76314386 | 203 | |
4c8749cb C |
204 | <div class="d-none d-xxl-block col-7"> |
205 | <ng-template *ngTemplateOutlet="dashboard"></ng-template> | |
206 | </div> | |
bee0abff | 207 | </div> |
897ec54d | 208 | </div> |
76314386 RK |
209 | </div> |
210 | ||
04e0fc48 | 211 | |
2166c058 | 212 | <div *ngIf="displayDangerZone()" class="row mt-4"> <!-- danger zone grid --> |
4c8749cb | 213 | <div class="col-12 col-lg-4 col-xl-3"> |
76314386 | 214 | <div class="anchor" id="danger"></div> <!-- danger zone anchor --> |
1fe1e14c | 215 | <div i18n class="account-title account-title-danger">DANGER ZONE</div> |
1eddc9a7 C |
216 | </div> |
217 | ||
4c8749cb | 218 | <div class="col-12 col-lg-8 col-xl-9"> |
328c78bc | 219 | |
76314386 | 220 | <div class="danger-zone"> |
2166c058 | 221 | <div class="form-group"> |
76314386 RK |
222 | <label i18n>Send a link to reset the password by email to the user</label> |
223 | <button (click)="resetPassword()" i18n>Ask for new password</button> | |
224 | </div> | |
328c78bc | 225 | |
76314386 RK |
226 | <div class="form-group"> |
227 | <label i18n>Manually set the user password</label> | |
16b7ad79 | 228 | <my-user-password [userId]="user.id" [username]="user.username"></my-user-password> |
76314386 | 229 | </div> |
2166c058 C |
230 | |
231 | <div *ngIf="user.twoFactorEnabled" class="form-group"> | |
232 | <label i18n>This user has two factor authentication enabled</label> | |
233 | <button (click)="disableTwoFactorAuth()" i18n>Disable two factor authentication</button> | |
234 | </div> | |
76314386 | 235 | </div> |
328c78bc | 236 | |
b426edd4 C |
237 | </div> |
238 | </div> |