1 <nav aria-label=
"breadcrumb">
2 <ol class=
"breadcrumb">
3 <li class=
"breadcrumb-item">
4 <a routerLink=
"/admin/users" i18n
>Users
</a>
7 <ng-container *
ngIf=
"isCreation()">
8 <li class=
"breadcrumb-item active" i18n
>Create
</li>
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>
19 <ng-template #dashboard
>
20 <div *
ngIf=
"!isCreation() && user" class=
"dashboard">
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>
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>
35 <div class=
"dashboard-num">{{ subscribersCount }}
</div>
36 <div class=
"dashboard-label" i18n
>{subscribersCount, plural, =
1 {Subscriber} other {Subscribers}}
</div>
40 <a [routerLink]=
"[ '/admin/moderation/abuses/list' ]" [queryParams]=
"{ 'search': 'reportee:"' + user?.account.displayName + '"' }">
41 <div class=
"dashboard-num">{{ user.abusesCount }}
</div>
42 <div class=
"dashboard-label" i18n
>Incriminated in reports
</div>
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>
48 <div class=
"dashboard-label" i18n
>Authored reports accepted
</div>
53 <div class=
"dashboard-num">{{ user.videoCommentsCount }}
</div>
54 <div class=
"dashboard-label" i18n
>{user.videoCommentsCount, plural, =
1 {Comment} other {Comments}}
</div>
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>
63 <div class=
"col-12 col-xl-9">
64 <ng-template *
ngTemplateOutlet=
"dashboard"></ng-template>
68 <div *
ngIf=
"error" class=
"alert alert-danger">{{ error }}
</div>
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>
79 <div class=
"form-group col-12 col-lg-8 col-xl-9" [ngClass]=
"{ 'form-row': isInBigView() }">
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>
85 type=
"text" id=
"username" i18n-placeholder
placeholder=
"john" class=
"form-control"
86 formControlName=
"username" [ngClass]=
"{ 'input-error': formErrors['username'] }"
88 <div *
ngIf=
"formErrors.username" class=
"form-error">
89 {{ formErrors.username }}
93 <div class=
"form-group" *
ngIf=
"isCreation()">
94 <label i18n
for=
"channelName">Channel name
</label>
96 type=
"text" id=
"channelName" i18n-placeholder
placeholder=
"john_channel" class=
"form-control"
97 formControlName=
"channelName" [ngClass]=
"{ 'input-error': formErrors['channelName'] }"
99 <div *
ngIf=
"formErrors.channelName" class=
"form-error">
100 {{ formErrors.channelName }}
104 <div class=
"form-group">
105 <label i18n
for=
"email">Email
</label>
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"
111 <div *
ngIf=
"formErrors.email" class=
"form-error">
112 {{ formErrors.email }}
116 <div class=
"form-group" *
ngIf=
"isCreation()">
117 <label i18n
for=
"password">Password
</label>
118 <my-help *
ngIf=
"isPasswordOptional()">
119 <ng-template ptTemplate=
"customHtml">
121 If you leave the password empty, an email will be sent to the user.
126 type=
"password" id=
"password" autocomplete=
"new-password" class=
"form-control"
127 formControlName=
"password" [ngClass]=
"{ 'input-error': formErrors['password'] }"
129 <div *
ngIf=
"formErrors.password" class=
"form-error">
130 {{ formErrors.password }}
134 <div class=
"form-group">
135 <label i18n
for=
"role">Role
</label>
136 <div class=
"peertube-select-container">
137 <select id=
"role" formControlName=
"role" class=
"form-control">
138 <option *
ngFor=
"let role of roles" [value]=
"role.value">
144 <div *
ngIf=
"formErrors.role" class=
"form-error">
145 {{ formErrors.role }}
149 <div class=
"form-group">
150 <label i18n
for=
"videoQuota">Video quota
</label>
151 <div class=
"peertube-select-container">
152 <select id=
"videoQuota" formControlName=
"videoQuota" class=
"form-control">
153 <option *
ngFor=
"let videoQuotaOption of videoQuotaOptions" [value]=
"videoQuotaOption.value" [disabled]=
"videoQuotaOption.disabled">
154 {{ videoQuotaOption.label }}
159 <div i18n
class=
"transcoding-information" *
ngIf=
"isTranscodingInformationDisplayed()">
160 Transcoding is enabled. The video quota only takes into account
<strong>original
</strong> video size.
<br />
161 At most, this user could upload ~ {{ computeQuotaWithTranscoding() | bytes:
0 }}.
165 <div class=
"form-group">
166 <label i18n
for=
"videoQuotaDaily">Daily video quota
</label>
167 <div class=
"peertube-select-container">
168 <select id=
"videoQuotaDaily" formControlName=
"videoQuotaDaily" class=
"form-control">
169 <option *
ngFor=
"let videoQuotaDailyOption of videoQuotaDailyOptions" [value]=
"videoQuotaDailyOption.value" [disabled]=
"videoQuotaDailyOption.disabled">
170 {{ videoQuotaDailyOption.label }}
176 <div class=
"form-group">
177 <my-peertube-checkbox
178 inputName=
"byPassAutoBlock" formControlName=
"byPassAutoBlock"
179 i18n-labelText
labelText=
"Doesn't need review before a video goes public"
180 ></my-peertube-checkbox>
183 <input type=
"submit" value=
"{{ getFormButtonTitle() }}" [disabled]=
"!form.valid">
186 <div *
ngIf=
"isInBigView()" class=
"col-7">
187 <ng-template *
ngTemplateOutlet=
"dashboard"></ng-template>
194 <div *
ngIf=
"!isCreation() && user && user.pluginAuth === null" class=
"form-row mt-4"> <!-- danger zone grid -->
195 <div class=
"form-group col-12 col-lg-4 col-xl-3">
196 <div class=
"anchor" id=
"danger"></div> <!-- danger zone anchor -->
197 <div i18n
class=
"account-title account-title-danger">DANGER ZONE
</div>
200 <div class=
"form-group col-12 col-lg-8 col-xl-9" [ngClass]=
"{ 'form-row': isInBigView() }">
202 <div class=
"danger-zone">
203 <div class=
"form-group reset-password-email">
204 <label i18n
>Send a link to reset the password by email to the user
</label>
205 <button (click)=
"resetPassword()" i18n
>Ask for new password
</button>
208 <div class=
"form-group">
209 <label i18n
>Manually set the user password
</label>
210 <my-user-password [userId]=
"user.id"></my-user-password>