]> source.dussan.org Git - archiva.git/blob
c04ee50c6b37d643c1b08940300b934c46806d6d
[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   ~ Unless required by applicable law or agreed to in writing,
12   ~ software distributed under the License is distributed on an
13   ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14   ~ KIND, either express or implied.  See the License for the
15   ~ specific language governing permissions and limitations
16   ~ under the License.
17   -->
18
19 <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()">
20     <div class="form-group col-md-8">
21         <label for="user_id">{{'users.attributes.user_id' |translate}}</label>
22         <input type="text" class="form-control" formControlName="user_id" id="user_id"
23                [ngClass]="valid('user_id')"
24                placeholder="{{'users.input.user_id'|translate}}">
25         <small>{{'users.input.small.user_id'|translate:{'minSize':this.minUserIdSize} }}</small>
26         <div *ngIf="userForm.get('user_id').invalid" class="invalid-feedback">
27             <div *ngIf="userForm.get('user_id').errors.required">
28                 {{'form.error.required'|translate}}
29             </div>
30             <div *ngIf="userForm.get('user_id').errors.containsWhitespace">
31                 {{'form.error.containsWhitespace'|translate}}
32             </div>
33             <div *ngIf="userForm.get('user_id').errors.userexists">
34                 {{'form.error.userexists'|translate}}
35             </div>
36         </div>
37
38     </div>
39     <div class="form-group col-md-8">
40         <label for="full_name">{{'users.attributes.full_name' |translate}}</label>
41         <input type="text" class="form-control" formControlName="full_name" id="full_name"
42                [ngClass]="valid('full_name')"
43                placeholder="{{'users.input.full_name'|translate}}">
44         <small>{{'users.input.small.full_name'|translate}}</small>
45     </div>
46     <div class="form-group col-md-8">
47         <label for="email">{{'users.attributes.email' |translate}}</label>
48         <input type="text" class="form-control" formControlName="email" id="email"
49                [ngClass]="valid('email')"
50                placeholder="{{'users.input.email'|translate}}">
51     </div>
52     <div class="form-group col-md-8">
53         <label for="password">{{'users.attributes.password' |translate}}</label>
54         <input type="password" class="form-control" formControlName="password" id="password"
55                [ngClass]="valid('password')"
56                placeholder="{{'users.input.password'|translate}}">
57         <div *ngFor="let error of getErrorsFor('password')" class="invalid-feedback">
58             {{error}}
59         </div>
60     </div>
61     <div class="form-group col-md-8">
62         <label for="confirm_password">{{'users.attributes.confirm_password' |translate}}</label>
63         <input type="password" class="form-control" formControlName="confirm_password" id="confirm_password"
64                [ngClass]="valid('confirm_password')"
65                placeholder="{{'users.input.confirm_password'|translate}}">
66     </div>
67     <div class="form-group col-md-8">
68         <div class="form-check">
69             <input class="form-check-input" type="checkbox" formControlName="locked" id="locked">
70             <label class="form-check-label" for="locked">
71                 {{'users.attributes.locked'|translate}}
72             </label>
73         </div>
74         <div class="form-check">
75             <input class="form-check-input" type="checkbox" formControlName="password_change_required"
76                    id="password_change_required" checked>
77             <label class="form-check-label" for="password_change_required">
78                 {{'users.attributes.password_change_required'|translate}}
79             </label>
80         </div>
81         <div class="form-check">
82             <input class="form-check-input" type="checkbox" formControlName="validated"
83                    id="validated" checked>
84             <label class="form-check-label" for="validated">
85                 {{'users.attributes.validated'|translate}}
86             </label>
87         </div>
88     </div>
89     <div class="form-group col-md-8">
90         <button class="btn btn-primary" type="submit"
91                 [attr.disabled]="userForm.valid?null:true">{{'users.add.submit'|translate}}</button>
92     </div>
93
94     <ng-template #successTmpl let-userId="user_id">
95         User <a [routerLink]="['/security','users','edit',userId]">{{userId}}</a> was added to the list.
96     </ng-template>
97     <ng-template #errorTmpl let-messages="error_messages">
98         <h4 class="alert-heading">{{'users.add.errortitle1'|translate}}</h4>
99         <p>{{'users.add.errortitle2'|translate}}</p>
100         <ng-container *ngFor="let message of messages; first as isFirst" >
101             <hr>
102             <p>{{message.message}}</p>
103         </ng-container>
104     </ng-template>
105
106
107 </form>