diff options
Diffstat (limited to 'client/src/app/+admin/users/user-edit')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-edit.component.html | 123 | ||||
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-edit.component.scss | 18 |
2 files changed, 77 insertions, 64 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.html b/client/src/app/+admin/users/user-edit/user-edit.component.html index 349be13c1..963e2f39a 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.component.html +++ b/client/src/app/+admin/users/user-edit/user-edit.component.html | |||
@@ -1,73 +1,68 @@ | |||
1 | <div class="row"> | 1 | <div class="admin-sub-title" *ngIf="isCreation() === true">Add user</div> |
2 | <div class="content-padding"> | 2 | <div class="admin-sub-title" *ngIf="isCreation() === false">Edit user {{ username }}</div> |
3 | 3 | ||
4 | <h3 *ngIf="isCreation() === true">Add user</h3> | 4 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> |
5 | <h3 *ngIf="isCreation() === false">Edit user {{ username }}</h3> | ||
6 | 5 | ||
7 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> | 6 | <form role="form" (ngSubmit)="formValidated()" [formGroup]="form"> |
8 | 7 | <div class="form-group" *ngIf="isCreation()"> | |
9 | <form role="form" (ngSubmit)="formValidated()" [formGroup]="form"> | 8 | <label for="username">Username</label> |
10 | <div class="form-group" *ngIf="isCreation()"> | 9 | <input |
11 | <label for="username">Username</label> | 10 | type="text" class="form-control" id="username" placeholder="john" |
12 | <input | 11 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" |
13 | type="text" class="form-control" id="username" placeholder="john" | 12 | > |
14 | formControlName="username" | 13 | <div *ngIf="formErrors.username" class="form-error"> |
15 | > | 14 | {{ formErrors.username }} |
16 | <div *ngIf="formErrors.username" class="alert alert-danger"> | 15 | </div> |
17 | {{ formErrors.username }} | 16 | </div> |
18 | </div> | ||
19 | </div> | ||
20 | |||
21 | <div class="form-group"> | ||
22 | <label for="email">Email</label> | ||
23 | <input | ||
24 | type="text" class="form-control" id="email" placeholder="mail@example.com" | ||
25 | formControlName="email" | ||
26 | > | ||
27 | <div *ngIf="formErrors.email" class="alert alert-danger"> | ||
28 | {{ formErrors.email }} | ||
29 | </div> | ||
30 | </div> | ||
31 | 17 | ||
32 | <div class="form-group" *ngIf="isCreation()"> | 18 | <div class="form-group"> |
33 | <label for="password">Password</label> | 19 | <label for="email">Email</label> |
34 | <input | 20 | <input |
35 | type="password" class="form-control" id="password" | 21 | type="text" class="form-control" id="email" placeholder="mail@example.com" |
36 | formControlName="password" | 22 | formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }" |
37 | > | 23 | > |
38 | <div *ngIf="formErrors.password" class="alert alert-danger"> | 24 | <div *ngIf="formErrors.email" class="form-error"> |
39 | {{ formErrors.password }} | 25 | {{ formErrors.email }} |
40 | </div> | 26 | </div> |
41 | </div> | 27 | </div> |
42 | 28 | ||
43 | <div class="form-group"> | 29 | <div class="form-group" *ngIf="isCreation()"> |
44 | <label for="role">Role</label> | 30 | <label for="password">Password</label> |
45 | <select class="form-control" id="role" formControlName="role"> | 31 | <input |
46 | <option *ngFor="let role of roles" [value]="role.value"> | 32 | type="password" class="form-control" id="password" |
47 | {{ role.label }} | 33 | formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" |
48 | </option> | 34 | > |
49 | </select> | 35 | <div *ngIf="formErrors.password" class="form-error"> |
36 | {{ formErrors.password }} | ||
37 | </div> | ||
38 | </div> | ||
50 | 39 | ||
51 | <div *ngIf="formErrors.role" class="alert alert-danger"> | 40 | <div class="form-group"> |
52 | {{ formErrors.role }} | 41 | <label for="role">Role</label> |
53 | </div> | 42 | <select class="form-control" id="role" formControlName="role"> |
54 | </div> | 43 | <option *ngFor="let role of roles" [value]="role.value"> |
44 | {{ role.label }} | ||
45 | </option> | ||
46 | </select> | ||
55 | 47 | ||
56 | <div class="form-group"> | 48 | <div *ngIf="formErrors.role" class="form-error"> |
57 | <label for="videoQuota">Video quota</label> | 49 | {{ formErrors.role }} |
58 | <select class="form-control" id="videoQuota" formControlName="videoQuota"> | 50 | </div> |
59 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value"> | 51 | </div> |
60 | {{ videoQuotaOption.label }} | ||
61 | </option> | ||
62 | </select> | ||
63 | 52 | ||
64 | <div class="transcoding-information" *ngIf="isTranscodingInformationDisplayed()"> | 53 | <div class="form-group"> |
65 | Transcoding is enabled on server. The video quota only take in account <strong>original</strong> video. <br /> | 54 | <label for="videoQuota">Video quota</label> |
66 | In maximum, this user could use ~ {{ computeQuotaWithTranscoding() | bytes }}. | 55 | <select class="form-control" id="videoQuota" formControlName="videoQuota"> |
67 | </div> | 56 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value"> |
68 | </div> | 57 | {{ videoQuotaOption.label }} |
58 | </option> | ||
59 | </select> | ||
69 | 60 | ||
70 | <input type="submit" value="{{ getFormButtonTitle() }}" class="btn btn-default" [disabled]="!form.valid"> | 61 | <div class="transcoding-information" *ngIf="isTranscodingInformationDisplayed()"> |
71 | </form> | 62 | Transcoding is enabled on server. The video quota only take in account <strong>original</strong> video. <br /> |
63 | In maximum, this user could use ~ {{ computeQuotaWithTranscoding() | bytes }}. | ||
64 | </div> | ||
72 | </div> | 65 | </div> |
73 | </div> | 66 | |
67 | <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid"> | ||
68 | </form> | ||
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.scss b/client/src/app/+admin/users/user-edit/user-edit.component.scss index 401caa0c6..68d270c19 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.component.scss +++ b/client/src/app/+admin/users/user-edit/user-edit.component.scss | |||
@@ -1,3 +1,21 @@ | |||
1 | .admin-sub-title { | ||
2 | margin-bottom: 30px; | ||
3 | } | ||
4 | |||
5 | input:not([type=submit]) { | ||
6 | @include peertube-input-text(340px); | ||
7 | display: block; | ||
8 | } | ||
9 | |||
10 | select { | ||
11 | @include peertube-select(340px); | ||
12 | } | ||
13 | |||
14 | input[type=submit] { | ||
15 | @include peertube-button; | ||
16 | @include orange-button; | ||
17 | } | ||
18 | |||
1 | .transcoding-information { | 19 | .transcoding-information { |
2 | margin-top: 5px; | 20 | margin-top: 5px; |
3 | font-size: 11px; | 21 | font-size: 11px; |