]> source.dussan.org Git - archiva.git/blob
13b764cf6bf2e83d2820fa3cf515aba7d805863a
[archiva.git] /
1 <!--
2   ~ Licensed to the Apache Software Foundation (ASF) under one
3   ~ or more contributor license agreements.  See the NOTICE file
4   ~ distributed with this work for additional information
5   ~ regarding copyright ownership.  The ASF licenses this file
6   ~ to you under the Apache License, Version 2.0 (the
7   ~ "License"); you may not use this file except in compliance
8   ~ with the License.  You may obtain a copy of the License at
9   ~
10   ~ http://www.apache.org/licenses/LICENSE-2.0
11   ~
12   ~ Unless required by applicable law or agreed to in writing,
13   ~ software distributed under the License is distributed on an
14   ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   ~ KIND, either express or implied.  See the License for the
16   ~ specific language governing permissions and limitations
17   ~ under the License.
18   -->
19
20 <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()">
21     <div class="form-group col-md-8">
22         <label for="user_id">{{'users.attributes.user_id' |translate}}</label>
23         <input type="text" class="form-control" formControlName="user_id" id="user_id"
24                [ngClass]="valid('user_id')"
25                placeholder="{{'users.input.user_id'|translate}}">
26         <small>{{'users.input.small.user_id'|translate:{'minSize':this.minUserIdSize} }}</small>
27         <div *ngIf="userForm.get('user_id').invalid" class="invalid-feedback">
28             <div *ngIf="userForm.get('user_id').errors.required">
29                 {{'form.error.required'|translate}}
30             </div>
31             <div *ngIf="userForm.get('user_id').errors.containsWhitespace">
32                 {{'form.error.containsWhitespace'|translate}}
33             </div>
34             <div *ngIf="userForm.get('user_id').errors.userexists">
35                 {{'form.error.userexists'|translate}}
36             </div>
37         </div>
38
39     </div>
40     <div class="form-group col-md-8">
41         <label for="full_name">{{'users.attributes.full_name' |translate}}</label>
42         <input type="text" class="form-control" formControlName="full_name" id="full_name"
43                [ngClass]="valid('full_name')"
44                placeholder="{{'users.input.full_name'|translate}}">
45         <small>{{'users.input.small.full_name'|translate}}</small>
46     </div>
47     <div class="form-group col-md-8">
48         <label for="email">{{'users.attributes.email' |translate}}</label>
49         <input type="text" class="form-control" formControlName="email" id="email"
50                [ngClass]="valid('email')"
51                placeholder="{{'users.input.email'|translate}}">
52     </div>
53     <div class="form-group col-md-8">
54         <label for="password">{{'users.attributes.password' |translate}}</label>
55         <input type="password" class="form-control" formControlName="password" id="password"
56                [ngClass]="valid('password')"
57                placeholder="{{'users.input.password'|translate}}">
58     </div>
59     <div class="form-group col-md-8">
60         <label for="confirm_password">{{'users.attributes.confirm_password' |translate}}</label>
61         <input type="password" class="form-control" formControlName="confirm_password" id="confirm_password"
62                [ngClass]="valid('confirm_password')"
63                placeholder="{{'users.input.confirm_password'|translate}}">
64     </div>
65     <div class="form-group col-md-8">
66         <div class="form-check">
67             <input class="form-check-input" type="checkbox" formControlName="locked" id="locked">
68             <label class="form-check-label" for="locked">
69                 {{'users.attributes.locked'|translate}}
70             </label>
71         </div>
72         <div class="form-check">
73             <input class="form-check-input" type="checkbox" formControlName="password_change_required"
74                    id="password_change_required" checked>
75             <label class="form-check-label" for="password_change_required">
76                 {{'users.attributes.password_change_required'|translate}}
77             </label>
78         </div>
79         <div class="form-check">
80             <input class="form-check-input" type="checkbox" formControlName="validated"
81                    id="validated" checked>
82             <label class="form-check-label" for="validated">
83                 {{'users.attributes.validated'|translate}}
84             </label>
85         </div>
86     </div>
87     <div class="form-group col-md-8">
88         <button class="btn btn-primary" type="submit"
89                 [attr.disabled]="userForm.valid?null:true">{{'users.add.submit'|translate}}</button>
90     </div>
91     <div *ngIf="success" class="alert alert-success" role="alert">
92         User <a [routerLink]="['user','users','edit',result?.user_id]">{{result?.userid}}</a> was added to the list.
93     </div>
94     <div *ngIf="error" class="alert alert-danger" role="alert" >
95         <h4 class="alert-heading">{{'users.add.errortitle'|translate}}</h4>
96         <ng-container *ngFor="let message of errorResult?.error_messages; first as isFirst" >
97             <hr *ngIf="!isFirst">
98             <p>{{message.message}}</p>
99         </ng-container>
100     </div>
101
102
103 </form>