aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit/user-edit.component.html
blob: a69ffee772523717f91fe686d6f18253f315e837 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<div class="admin-sub-title" *ngIf="isCreation() === true">Add user</div>
<div class="admin-sub-title" *ngIf="isCreation() === false">Edit user {{ username }}</div>

<div *ngIf="error" class="alert alert-danger">{{ error }}</div>

<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
  <div class="form-group" *ngIf="isCreation()">
    <label for="username">Username</label>
    <input
      type="text" id="username" placeholder="john"
      formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
    >
    <div *ngIf="formErrors.username" class="form-error">
      {{ formErrors.username }}
    </div>
  </div>

  <div class="form-group">
    <label for="email">Email</label>
    <input
      type="text" id="email" placeholder="mail@example.com"
      formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }"
    >
    <div *ngIf="formErrors.email" class="form-error">
      {{ formErrors.email }}
    </div>
  </div>

  <div class="form-group" *ngIf="isCreation()">
    <label for="password">Password</label>
    <input
      type="password" id="password"
      formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
    >
    <div *ngIf="formErrors.password" class="form-error">
      {{ formErrors.password }}
    </div>
  </div>

  <div class="form-group">
    <label for="role">Role</label>
    <div class="peertube-select-container">
      <select id="role" formControlName="role">
        <option *ngFor="let role of roles" [value]="role.value">
          {{ role.label }}
        </option>
      </select>
    </div>

    <div *ngIf="formErrors.role" class="form-error">
      {{ formErrors.role }}
    </div>
  </div>

  <div class="form-group">
    <label for="videoQuota">Video quota</label>
    <div class="peertube-select-container">
      <select id="videoQuota" formControlName="videoQuota">
        <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value">
          {{ videoQuotaOption.label }}
        </option>
      </select>
    </div>

    <div class="transcoding-information" *ngIf="isTranscodingInformationDisplayed()">
      Transcoding is enabled on server. The video quota only take in account <strong>original</strong> video. <br />
      In maximum, this user could use ~ {{ computeQuotaWithTranscoding() | bytes: 0 }}.
    </div>
  </div>

  <input type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>