2020-03-27 15:19:03 +01:00
|
|
|
<nav aria-label="breadcrumb">
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li class="breadcrumb-item">
|
|
|
|
<a routerLink="/admin/users" i18n>Users</a>
|
|
|
|
</li>
|
2016-08-09 21:45:21 +02:00
|
|
|
|
2020-03-27 15:19:03 +01:00
|
|
|
<ng-container *ngIf="isCreation()">
|
|
|
|
<li class="breadcrumb-item active" i18n>Create</li>
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="!isCreation()">
|
|
|
|
<li class="breadcrumb-item active" i18n>Edit</li>
|
|
|
|
<li class="breadcrumb-item active" aria-current="page">
|
2021-04-28 23:45:23 +02:00
|
|
|
<a *ngIf="user" [routerLink]="[ '/a', user?.username ]">{{ user?.username }}</a>
|
2020-03-27 15:19:03 +01:00
|
|
|
</li>
|
|
|
|
</ng-container>
|
|
|
|
</ol>
|
|
|
|
</nav>
|
2016-08-09 21:45:21 +02:00
|
|
|
|
2020-03-27 15:19:03 +01:00
|
|
|
<ng-template #dashboard>
|
|
|
|
<div *ngIf="!isCreation() && user" class="dashboard">
|
|
|
|
<div>
|
|
|
|
<a>
|
|
|
|
<div class="dashboard-num">{{ user.videosCount }} ({{ user.videoQuotaUsed | bytes: 0 }})</div>
|
|
|
|
<div class="dashboard-label" i18n>{user.videosCount, plural, =1 {Video} other {Videos}}</div>
|
|
|
|
</a>
|
2017-12-08 10:41:49 +01:00
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
<div>
|
|
|
|
<a>
|
|
|
|
<div class="dashboard-num">{{ user.videoChannels.length || 0 }}</div>
|
|
|
|
<div class="dashboard-label" i18n>{user.videoChannels.length, plural, =1 {Channel} other {Channels}}</div>
|
|
|
|
</a>
|
2017-12-08 10:41:49 +01:00
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
<div>
|
|
|
|
<a>
|
|
|
|
<div class="dashboard-num">{{ subscribersCount }}</div>
|
|
|
|
<div class="dashboard-label" i18n>{subscribersCount, plural, =1 {Subscriber} other {Subscribers}}</div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
2020-07-07 14:34:16 +02:00
|
|
|
<a [routerLink]="[ '/admin/moderation/abuses/list' ]" [queryParams]="{ 'search': 'reportee:"' + user?.account.displayName + '"' }">
|
|
|
|
<div class="dashboard-num">{{ user.abusesCount }}</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="dashboard-label" i18n>Incriminated in reports</div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
2020-07-07 14:34:16 +02:00
|
|
|
<a [routerLink]="[ '/admin/moderation/abuses/list' ]" [queryParams]="{ 'search': 'reporter:"' + user?.account.displayName + '" state:accepted' }">
|
|
|
|
<div class="dashboard-num">{{ user.abusesAcceptedCount }} / {{ user.abusesCreatedCount }}</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="dashboard-label" i18n>Authored reports accepted</div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a>
|
|
|
|
<div class="dashboard-num">{{ user.videoCommentsCount }}</div>
|
|
|
|
<div class="dashboard-label" i18n>{user.videoCommentsCount, plural, =1 {Comment} other {Comments}}</div>
|
|
|
|
</a>
|
2017-12-08 10:41:49 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</ng-template>
|
2017-10-27 16:55:03 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="row d-xxl-none"> <!-- hidden on large screens, as it is then displayed on the right side of the form -->
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="col-12 col-xl-3"></div>
|
2017-10-27 16:55:03 +02:00
|
|
|
|
2020-11-26 16:39:43 +01:00
|
|
|
<div class="col-12 col-xl-9">
|
2020-03-27 15:19:03 +01:00
|
|
|
<ng-template *ngTemplateOutlet="dashboard"></ng-template>
|
2017-12-08 10:41:49 +01:00
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2017-10-19 17:33:32 +02:00
|
|
|
|
2020-03-27 15:19:03 +01:00
|
|
|
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
|
2018-08-31 10:05:54 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="row mt-4"> <!-- user grid -->
|
|
|
|
<div class="col-12 col-lg-4 col-xl-3">
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="anchor" id="user"></div> <!-- user anchor -->
|
|
|
|
<div *ngIf="isCreation()" class="account-title" i18n>NEW USER</div>
|
|
|
|
<div *ngIf="!isCreation() && user" class="account-title">
|
2021-04-07 17:01:29 +02:00
|
|
|
<my-actor-avatar-edit [actor]="user.account" [editable]="false" [displaySubscribers]="false" [displayUsername]="false"></my-actor-avatar-edit>
|
2018-08-31 10:05:54 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="col-12 col-lg-8 col-xl-9">
|
|
|
|
<div class="row">
|
|
|
|
<form class="col" role="form" (ngSubmit)="formValidated()" [formGroup]="form">
|
|
|
|
<div class="form-group" *ngIf="isCreation()">
|
|
|
|
<label i18n for="username">Username</label>
|
|
|
|
<input
|
|
|
|
type="text" id="username" i18n-placeholder placeholder="john" class="form-control"
|
|
|
|
formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
|
|
|
|
>
|
|
|
|
<div *ngIf="formErrors.username" class="form-error">
|
|
|
|
{{ formErrors.username }}
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group" *ngIf="isCreation()">
|
|
|
|
<label i18n for="channelName">Channel name</label>
|
|
|
|
<input
|
|
|
|
type="text" id="channelName" i18n-placeholder placeholder="john_channel" class="form-control"
|
|
|
|
formControlName="channelName" [ngClass]="{ 'input-error': formErrors['channelName'] }"
|
|
|
|
>
|
|
|
|
<div *ngIf="formErrors.channelName" class="form-error">
|
|
|
|
{{ formErrors.channelName }}
|
|
|
|
</div>
|
2020-07-14 23:36:15 +02:00
|
|
|
</div>
|
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label i18n for="email">Email</label>
|
|
|
|
<input
|
|
|
|
type="text" id="email" i18n-placeholder placeholder="mail@example.com" class="form-control"
|
|
|
|
formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }"
|
|
|
|
autocomplete="off" [readonly]="user && user.pluginAuth !== null"
|
|
|
|
>
|
|
|
|
<div *ngIf="formErrors.email" class="form-error">
|
|
|
|
{{ formErrors.email }}
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group" *ngIf="isCreation()">
|
|
|
|
<label i18n for="password">Password</label>
|
|
|
|
<my-help *ngIf="isPasswordOptional()">
|
|
|
|
<ng-template ptTemplate="customHtml">
|
|
|
|
<ng-container i18n>
|
|
|
|
If you leave the password empty, an email will be sent to the user.
|
|
|
|
</ng-container>
|
|
|
|
</ng-template>
|
|
|
|
</my-help>
|
|
|
|
|
|
|
|
<my-input-toggle-hidden
|
|
|
|
formControlName="password" inputId="password" [ngClass]="{ 'input-error': formErrors['password'] }" autocomplete="new-password"
|
|
|
|
></my-input-toggle-hidden>
|
|
|
|
|
|
|
|
<div *ngIf="formErrors.password" class="form-error">
|
|
|
|
{{ formErrors.password }}
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label i18n for="role">Role</label>
|
|
|
|
<div class="peertube-select-container">
|
|
|
|
<select id="role" formControlName="role" class="form-control">
|
|
|
|
<option *ngFor="let role of roles" [value]="role.value">
|
|
|
|
{{ role.label }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div *ngIf="formErrors.role" class="form-error">
|
|
|
|
{{ formErrors.role }}
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label i18n for="videoQuota">Video quota</label>
|
|
|
|
|
|
|
|
<my-select-custom-value
|
|
|
|
id="videoQuota"
|
|
|
|
[items]="videoQuotaOptions"
|
|
|
|
formControlName="videoQuota"
|
|
|
|
i18n-inputSuffix inputSuffix="bytes" inputType="number"
|
|
|
|
[clearable]="false"
|
|
|
|
></my-select-custom-value>
|
|
|
|
|
|
|
|
<div i18n class="transcoding-information" *ngIf="isTranscodingInformationDisplayed()">
|
|
|
|
Transcoding is enabled. The video quota only takes into account <strong>original</strong> video size. <br />
|
|
|
|
At most, this user could upload ~ {{ computeQuotaWithTranscoding() | bytes: 0 }}.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div *ngIf="formErrors.videoQuota" class="form-error">
|
|
|
|
{{ formErrors.videoQuota }}
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label i18n for="videoQuotaDaily">Daily video quota</label>
|
2021-02-10 09:05:29 +01:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<my-select-custom-value
|
|
|
|
id="videoQuotaDaily"
|
|
|
|
[items]="videoQuotaDailyOptions"
|
|
|
|
formControlName="videoQuotaDaily"
|
|
|
|
i18n-inputSuffix inputSuffix="bytes" inputType="number"
|
|
|
|
[clearable]="false"
|
|
|
|
></my-select-custom-value>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div *ngIf="formErrors.videoQuotaDaily" class="form-error">
|
|
|
|
{{ formErrors.videoQuotaDaily }}
|
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group" *ngIf="!isCreation() && getAuthPlugins().length !== 0">
|
|
|
|
<label i18n for="pluginAuth">Auth plugin</label>
|
2021-02-01 15:39:13 +01:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="peertube-select-container">
|
|
|
|
<select id="pluginAuth" formControlName="pluginAuth" class="form-control">
|
|
|
|
<option [value]="null" i18n>None (local authentication)</option>
|
|
|
|
<option *ngFor="let authPlugin of getAuthPlugins()" [value]="authPlugin">{{ authPlugin }}</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2021-02-01 15:39:13 +01:00
|
|
|
</div>
|
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<my-peertube-checkbox
|
|
|
|
inputName="byPassAutoBlock" formControlName="byPassAutoBlock"
|
|
|
|
i18n-labelText labelText="Doesn't need review before a video goes public"
|
|
|
|
></my-peertube-checkbox>
|
|
|
|
</div>
|
2020-07-06 11:03:05 +02:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
|
|
|
|
</form>
|
2020-03-27 15:19:03 +01:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="d-none d-xxl-block col-7">
|
|
|
|
<ng-template *ngTemplateOutlet="dashboard"></ng-template>
|
|
|
|
</div>
|
2018-08-28 09:01:35 +02:00
|
|
|
</div>
|
2017-04-21 18:26:09 +02:00
|
|
|
</div>
|
2020-03-27 15:19:03 +01:00
|
|
|
</div>
|
|
|
|
|
2017-12-08 10:41:49 +01:00
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div *ngIf="!isCreation() && user && user.pluginAuth === null" class="row mt-4"> <!-- danger zone grid -->
|
|
|
|
<div class="col-12 col-lg-4 col-xl-3">
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="anchor" id="danger"></div> <!-- danger zone anchor -->
|
2020-07-01 02:08:58 +02:00
|
|
|
<div i18n class="account-title account-title-danger">DANGER ZONE</div>
|
2019-04-15 10:49:46 +02:00
|
|
|
</div>
|
|
|
|
|
2022-06-08 16:14:24 +02:00
|
|
|
<div class="col-12 col-lg-8 col-xl-9">
|
2018-10-06 13:54:00 +02:00
|
|
|
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="danger-zone">
|
|
|
|
<div class="form-group reset-password-email">
|
|
|
|
<label i18n>Send a link to reset the password by email to the user</label>
|
|
|
|
<button (click)="resetPassword()" i18n>Ask for new password</button>
|
|
|
|
</div>
|
2018-10-06 13:54:00 +02:00
|
|
|
|
2020-03-27 15:19:03 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label i18n>Manually set the user password</label>
|
|
|
|
<my-user-password [userId]="user.id"></my-user-password>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-10-06 13:54:00 +02:00
|
|
|
|
2019-02-11 09:30:29 +01:00
|
|
|
</div>
|
|
|
|
</div>
|