]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | <cd-loading-panel *ngIf="editing && loading && !error" |
2 | i18n>Loading bucket data...</cd-loading-panel> | |
3 | <cd-error-panel *ngIf="editing && error" | |
4 | (backAction)="goToListView()" | |
5 | i18n>The bucket data could not be loaded.</cd-error-panel> | |
6 | ||
7 | <div class="col-sm-12 col-lg-6" | |
8 | *ngIf="!loading && !error"> | |
9 | <form name="bucketForm" | |
10 | class="form-horizontal" | |
11 | #frm="ngForm" | |
12 | [formGroup]="bucketForm" | |
13 | novalidate> | |
14 | <div class="panel panel-default"> | |
15 | <div class="panel-heading"> | |
16 | <h3 i18n="form title|Example: Create Pool@@formTitle" | |
17 | class="panel-title">{{ action | titlecase }} {{ resource | upperFirst }}</h3> | |
18 | </div> | |
19 | <div class="panel-body"> | |
20 | ||
21 | <!-- Id --> | |
22 | <div class="form-group" | |
23 | *ngIf="editing"> | |
24 | <label i18n | |
25 | class="col-sm-3 control-label" | |
26 | for="id">Id</label> | |
27 | <div class="col-sm-9"> | |
28 | <input id="id" | |
29 | name="id" | |
30 | class="form-control" | |
31 | type="text" | |
32 | formControlName="id" | |
33 | readonly> | |
34 | </div> | |
35 | </div> | |
36 | ||
37 | <!-- Name --> | |
38 | <div class="form-group" | |
39 | [ngClass]="{'has-error': bucketForm.showError('bid', frm)}"> | |
40 | <label class="control-label col-sm-3" | |
41 | for="bid"> | |
42 | <ng-container i18n>Name</ng-container> | |
43 | <span class="required" | |
44 | *ngIf="!editing"></span> | |
45 | </label> | |
46 | <div class="col-sm-9"> | |
47 | <input id="bid" | |
48 | name="bid" | |
49 | class="form-control" | |
50 | type="text" | |
51 | i18n-placeholder | |
52 | placeholder="Name..." | |
53 | formControlName="bid" | |
54 | [readonly]="editing" | |
55 | autofocus> | |
56 | <span class="help-block" | |
57 | *ngIf="bucketForm.showError('bid', frm, 'required')" | |
58 | i18n>This field is required.</span> | |
59 | <span class="help-block" | |
60 | *ngIf="bucketForm.showError('bid', frm, 'bucketNameInvalid')" | |
61 | i18n>The value is not valid.</span> | |
62 | <span class="help-block" | |
63 | *ngIf="bucketForm.showError('bid', frm, 'bucketNameExists')" | |
64 | i18n>The chosen name is already in use.</span> | |
65 | </div> | |
66 | </div> | |
67 | ||
68 | <!-- Owner --> | |
69 | <div class="form-group" | |
70 | [ngClass]="{'has-error': bucketForm.showError('owner', frm)}"> | |
71 | <label class="control-label col-sm-3" | |
72 | for="owner"> | |
73 | <ng-container i18n>Owner</ng-container> | |
74 | <span class="required"></span> | |
75 | </label> | |
76 | <div class="col-sm-9"> | |
77 | <select id="owner" | |
78 | name="owner" | |
79 | class="form-control" | |
80 | formControlName="owner"> | |
81 | <option i18n | |
82 | *ngIf="owners === null" | |
83 | [ngValue]="null">Loading...</option> | |
84 | <option i18n | |
85 | *ngIf="owners !== null" | |
86 | [ngValue]="null">-- Select a user --</option> | |
87 | <option *ngFor="let owner of owners" | |
88 | [value]="owner">{{ owner }}</option> | |
89 | </select> | |
90 | <span class="help-block" | |
91 | *ngIf="bucketForm.showError('owner', frm, 'required')" | |
92 | i18n>This field is required.</span> | |
93 | </div> | |
94 | </div> | |
95 | ||
96 | </div> | |
97 | <div class="panel-footer"> | |
98 | <div class="button-group text-right"> | |
99 | <cd-submit-button | |
100 | (submitAction)="submit()" [form]="bucketForm" | |
101 | i18n="form action button|Example: Create Pool@@formActionButton" | |
102 | type="button">{{ action | titlecase }} {{ resource | upperFirst }}</cd-submit-button> | |
103 | <cd-back-button></cd-back-button> | |
104 | </div> | |
105 | </div> | |
106 | </div> | |
107 | </form> | |
108 | </div> |