]>
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"> | |
13 | <a *ngIf="user" [routerLink]="[ '/accounts', user?.username ]">{{ user?.username }}</a> | |
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 | |
76314386 RK |
60 | <div class="form-row" *ngIf="!isInBigView()"> <!-- hidden on large screens, as it is then displayed on the right side of the form --> |
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 | |
76314386 RK |
70 | <div class="form-row mt-4"> <!-- user grid --> |
71 | <div class="form-group col-12 col-lg-4 col-xl-3"> | |
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"> | |
75 | <my-actor-avatar-info [actor]="user.account"></my-actor-avatar-info> | |
d6ca951b C |
76 | </div> |
77 | </div> | |
78 | ||
e2c1f779 | 79 | <div class="form-group col-12 col-lg-8 col-xl-9" [ngClass]="{ 'form-row': isInBigView() }"> |
76314386 RK |
80 | |
81 | <form role="form" (ngSubmit)="formValidated()" [formGroup]="form" [ngClass]="{ 'col-5': isInBigView() }"> | |
82 | <div class="form-group" *ngIf="isCreation()"> | |
83 | <label i18n for="username">Username</label> | |
84 | <input | |
a6d5ff76 | 85 | type="text" id="username" i18n-placeholder placeholder="john" class="form-control" |
76314386 RK |
86 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" |
87 | > | |
88 | <div *ngIf="formErrors.username" class="form-error"> | |
89 | {{ formErrors.username }} | |
90 | </div> | |
91 | </div> | |
767bb14a | 92 | |
62fc6915 | 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> | |
102 | </div> | |
103 | ||
76314386 RK |
104 | <div class="form-group"> |
105 | <label i18n for="email">Email</label> | |
106 | <input | |
a6d5ff76 | 107 | type="text" id="email" i18n-placeholder placeholder="mail@example.com" class="form-control" |
76314386 | 108 | formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }" |
28215957 | 109 | autocomplete="off" [readonly]="user && user.pluginAuth !== null" |
76314386 RK |
110 | > |
111 | <div *ngIf="formErrors.email" class="form-error"> | |
112 | {{ formErrors.email }} | |
113 | </div> | |
114 | </div> | |
767bb14a | 115 | |
76314386 RK |
116 | <div class="form-group" *ngIf="isCreation()"> |
117 | <label i18n for="password">Password</label> | |
118 | <my-help *ngIf="isPasswordOptional()"> | |
119 | <ng-template ptTemplate="customHtml"> | |
120 | <ng-container i18n> | |
121 | If you leave the password empty, an email will be sent to the user. | |
122 | </ng-container> | |
123 | </ng-template> | |
124 | </my-help> | |
f8b530e0 RK |
125 | <my-input-toggle-hidden formControlName="password" id="password" |
126 | [ngClass]="{ 'input-error': formErrors['password'] }" | |
127 | autocomplete="new-password"></my-input-toggle-hidden> | |
76314386 RK |
128 | <div *ngIf="formErrors.password" class="form-error"> |
129 | {{ formErrors.password }} | |
130 | </div> | |
131 | </div> | |
767bb14a | 132 | |
76314386 RK |
133 | <div class="form-group"> |
134 | <label i18n for="role">Role</label> | |
135 | <div class="peertube-select-container"> | |
947d0102 | 136 | <select id="role" formControlName="role" class="form-control"> |
76314386 RK |
137 | <option *ngFor="let role of roles" [value]="role.value"> |
138 | {{ role.label }} | |
139 | </option> | |
140 | </select> | |
141 | </div> | |
767bb14a | 142 | |
76314386 RK |
143 | <div *ngIf="formErrors.role" class="form-error"> |
144 | {{ formErrors.role }} | |
145 | </div> | |
146 | </div> | |
767bb14a | 147 | |
76314386 RK |
148 | <div class="form-group"> |
149 | <label i18n for="videoQuota">Video quota</label> | |
150 | <div class="peertube-select-container"> | |
947d0102 | 151 | <select id="videoQuota" formControlName="videoQuota" class="form-control"> |
2bc9bd08 | 152 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value" [disabled]="videoQuotaOption.disabled"> |
76314386 RK |
153 | {{ videoQuotaOption.label }} |
154 | </option> | |
155 | </select> | |
156 | </div> | |
767bb14a | 157 | |
76314386 RK |
158 | <div i18n class="transcoding-information" *ngIf="isTranscodingInformationDisplayed()"> |
159 | Transcoding is enabled. The video quota only takes into account <strong>original</strong> video size. <br /> | |
160 | At most, this user could upload ~ {{ computeQuotaWithTranscoding() | bytes: 0 }}. | |
161 | </div> | |
162 | </div> | |
767bb14a | 163 | |
76314386 RK |
164 | <div class="form-group"> |
165 | <label i18n for="videoQuotaDaily">Daily video quota</label> | |
166 | <div class="peertube-select-container"> | |
947d0102 | 167 | <select id="videoQuotaDaily" formControlName="videoQuotaDaily" class="form-control"> |
2bc9bd08 | 168 | <option *ngFor="let videoQuotaDailyOption of videoQuotaDailyOptions" [value]="videoQuotaDailyOption.value" [disabled]="videoQuotaDailyOption.disabled"> |
76314386 RK |
169 | {{ videoQuotaDailyOption.label }} |
170 | </option> | |
171 | </select> | |
172 | </div> | |
173 | </div> | |
767bb14a | 174 | |
76314386 RK |
175 | <div class="form-group"> |
176 | <my-peertube-checkbox | |
3487330d | 177 | inputName="byPassAutoBlock" formControlName="byPassAutoBlock" |
76314386 RK |
178 | i18n-labelText labelText="Doesn't need review before a video goes public" |
179 | ></my-peertube-checkbox> | |
180 | </div> | |
767bb14a | 181 | |
76314386 RK |
182 | <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid"> |
183 | </form> | |
184 | ||
185 | <div *ngIf="isInBigView()" class="col-7"> | |
186 | <ng-template *ngTemplateOutlet="dashboard"></ng-template> | |
bee0abff | 187 | </div> |
76314386 | 188 | |
897ec54d | 189 | </div> |
76314386 RK |
190 | </div> |
191 | ||
04e0fc48 | 192 | |
767bb14a | 193 | <div *ngIf="!isCreation() && user && user.pluginAuth === null" class="form-row mt-4"> <!-- danger zone grid --> |
76314386 RK |
194 | <div class="form-group col-12 col-lg-4 col-xl-3"> |
195 | <div class="anchor" id="danger"></div> <!-- danger zone anchor --> | |
1fe1e14c | 196 | <div i18n class="account-title account-title-danger">DANGER ZONE</div> |
1eddc9a7 C |
197 | </div> |
198 | ||
e2c1f779 | 199 | <div class="form-group col-12 col-lg-8 col-xl-9" [ngClass]="{ 'form-row': isInBigView() }"> |
328c78bc | 200 | |
76314386 RK |
201 | <div class="danger-zone"> |
202 | <div class="form-group reset-password-email"> | |
203 | <label i18n>Send a link to reset the password by email to the user</label> | |
204 | <button (click)="resetPassword()" i18n>Ask for new password</button> | |
205 | </div> | |
328c78bc | 206 | |
76314386 RK |
207 | <div class="form-group"> |
208 | <label i18n>Manually set the user password</label> | |
209 | <my-user-password [userId]="user.id"></my-user-password> | |
210 | </div> | |
211 | </div> | |
328c78bc | 212 | |
b426edd4 C |
213 | </div> |
214 | </div> |