rsanchez
2017-03-10 ac8d1f0e8ab4bab6eb546daa8062a6dad3ab8e23
securis/src/main/webapp/src/app/forms/pack.form.html
....@@ -1,172 +1,66 @@
1
-<h3 md-dialog-title>{{form_title}}</h3>
21 <form #packForm="ngForm" class="inset" (keyup.enter)="save()">
3
-<md-dialog-content>
2
+ <md-card>
3
+ <md-card-title>
4
+ {{form_title}}
5
+ </md-card-title>
6
+ <md-card-subtitle>
7
+ {{form_subtitle}}
8
+ </md-card-subtitle>
9
+<md-divider></md-divider>
10
+ <md-card-content>
411 <div layout="column" layout-align="start center">
5
- <div layout="row" layout-align="start center">
6
- <md-icon class="form-icon">face</md-icon>
7
- <md-input-container class="md-icon-float">
8
- <input mdInput flex placeholder="Username" type="text" [(ngModel)]="data.username" name="username" required />
12
+ <div layout="row" layout-align="start center" layout-margin>
13
+ <md-input-container flex>
14
+ <input mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required />
15
+ <md-placeholder>
16
+ <span i18n>Code</span>
17
+ </md-placeholder>
918 </md-input-container>
10
- <div id="invalid-auth-msg" *ngIf="invalidError" class="tc-red-600 text-center" flex i18n>The username or password is incorrect. Please try again.</div>
19
+ <!-- TODO: <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid">
20
+ <span class="glyphicon glyphicon-warning-sign"></span>
21
+ <span ng-show="packForm.code.$error.maxlength" ng-bind="maxLengthErrorMsg('Code', maxlength.code)"
22
+ class="ng-binding ng-hide">Code length is too long (max: 50).</span>
23
+ <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')" class="ng-binding">'Code' is required.</span>
24
+ </div> -->
25
+ <md-input-container flex>
26
+ <input mdInput type="number" type="text" [(ngModel)]="data.num_licenses" name="num_licenses" required />
27
+ <md-placeholder>
28
+ <span i18n>Num. licenses</span>
29
+ </md-placeholder>
30
+ </md-input-container>
1131 </div>
12
- <div layout="row" layout-align="start center">
13
- <md-icon class="form-icon">vpn_key</md-icon>
14
- <md-input-container class="md-icon-float">
15
- <input mdInput (keyup.enter)="loginForm.form.valid && false" flex placeholder="Password" type="password" [(ngModel)]="data.password"
16
- name="password" required/>
32
+ <div layout="row" layout-align="start center" layout-margin>
33
+ <md-input-container flex>
34
+ <input mdInput type="date" type="text" [(ngModel)]="data.init_valid_date" name="init_valid_date" required />
35
+ <md-placeholder>
36
+ <span i18n>Initial date</span>
37
+ </md-placeholder>
1738 </md-input-container>
39
+ <md-input-container flex>
40
+ <input mdInput type="date" type="text" [(ngModel)]="data.end_valid_date" name="end_valid_date" required />
41
+ <md-placeholder>
42
+ <span i18n>End date</span>
43
+ </md-placeholder>
44
+ </md-input-container>
45
+ </div>
46
+ <div layout="row" layout-align="start center" layout-margin>
47
+ <md-select flex placeholder="Organization" [(ngModel)]="data.organization_id" name="organization_id">
48
+ <md-option *ngFor="let org of organizations" [value]="org.id">
49
+ {{org.label}}
50
+ </md-option>
51
+ </md-select>
52
+ <md-select flex placeholder="License type" [(ngModel)]="data.license_type_id" name="license_type_id">
53
+ <md-option *ngFor="let lt of lictypes" [value]="lt.id">
54
+ {{lt.label}}
55
+ </md-option>
56
+ </md-select>
1857 </div>
1958 </div>
20
-</md-dialog-content>
21
-<md-dialog-actions layout="row" layout-align="end center">
22
- <button flex [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button>
23
- <button flex md-button (click)="close()">Cancel</button>
24
-</md-dialog-actions>
59
+</md-card-content>
60
+<md-divider></md-divider>
61
+<md-card-actions>
62
+ <button [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button>
63
+ <button md-button (click)="close()">Cancel</button>
64
+</md-card-actions>
65
+</md-card>
2566 </form>
26
-
27
-
28
-<form role="form" class="form-horizontal ng-pristine ng-invalid ng-invalid-required ng-valid-maxlength ng-valid-min" name="packForm" id="packForm" ng-submit="save()">
29
-<!-- ngIf: !isNew -->
30
-<div class="form-group">
31
-<label class="col-md-3 control-label" for="code" i18n="">Code</label>
32
-<div class="col-md-8">
33
- <input type="string" id="code" name="code" placeholder="" class="form-control ng-pristine ng-invalid ng-invalid-required ng-valid-maxlength ng-touched" ng-model="pack.code" ng-required="mandatory.code" ng-maxlength="50" required="required">
34
- <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid">
35
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.code.$error.maxlength" ng-bind="maxLengthErrorMsg('Code', maxlength.code)" class="ng-binding ng-hide">Code length is too long (max: 50).</span> <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')" class="ng-binding">'Code' is required.</span>
36
- </div>
37
-</div>
38
-</div>
39
-
40
-<div class="form-group">
41
-<label class="col-md-3 control-label" for="init_valid_date" i18n="">Validity (from - to)</label>
42
-<div class="col-md-4">
43
- <input type="date" id="init_valid_date" name="init_valid_date" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-required" ng-model="pack.init_valid_date" ng-required="mandatory.init_valid_date" required="required">
44
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.initValidDate.$invalid">
45
- <span class="glyphicon glyphicon-warning-sign"></span>
46
- <span ng-show="packForm.init_valid_date.$error.required" ng-bind="mandatoryFieldErrorMsg('Init valid date')" class="ng-binding ng-hide">'Init valid date' is required.</span>
47
- </div>
48
-</div>
49
-<div class="col-md-4">
50
- <input type="date" id="end_valid_date" name="end_valid_date" placeholder="" class="form-control ng-pristine ng-untouched ng-valid-min ng-invalid ng-invalid-required" ng-model="pack.end_valid_date" min="2017-03-09" ng-required="mandatory.end_valid_date" required="required">
51
- <div class="alert inline-alert alert-warning" ng-show="packForm.end_valid_date.$invalid">
52
- <span class="glyphicon glyphicon-warning-sign"></span>
53
- <span ng-show="packForm.end_valid_date.$error.required" ng-bind="mandatoryFieldErrorMsg('End valid date')" class="ng-binding">'End valid date' is required.</span>
54
- <span ng-show="packForm.end_valid_date.$error.min" ng-bind="field1ShouldBeGreaterThanField2('End date', 'Init date')" class="ng-binding ng-hide">End date should be greater than Init date</span>
55
- </div>
56
-</div>
57
-</div>
58
-
59
-<div class="form-group">
60
-<label class="col-md-3 control-label" for="num_licenses" i18n="">Num.
61
- Licenses</label>
62
-<div class="col-md-8">
63
- <input type="number" id="num_licenses" name="num_licenses" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-required" ng-model="pack.num_licenses" ng-required="mandatory.num_licenses" required="required">
64
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.num_licenses.$invalid">
65
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.num_licenses.$error.maxlength" ng-bind="maxLengthErrorMsg('Num. Licenses', maxlength.num_licenses)" class="ng-binding ng-hide">Num. Licenses length is too long (max: undefined).</span>
66
- <span ng-show="packForm.num_licenses.$error.required" ng-bind="mandatoryFieldErrorMsg('Num. Licenses')" class="ng-binding ng-hide">'Num. Licenses' is required.</span>
67
- </div>
68
-</div>
69
-</div>
70
-
71
-<!-- ngIf: !isNew -->
72
-
73
-<div class="form-group">
74
-<label class="col-md-3 control-label" for="license_type_id" i18n="">License
75
- type</label>
76
-<div class="col-md-8">
77
- <!-- ngIf: isNew --><select ng-if="isNew" class="form-control ng-pristine ng-untouched ng-scope ng-invalid ng-invalid-required" id="license_type_id" ng-change="updateMetadata()" ng-required="mandatory.license_type_id" ng-model="pack.license_type_id" ng-options="o.id as o.label for o in refs.license_type_id" required="required"><option value="" selected="selected" label=""></option><option value="0" label="CI ConfigServer ext">CI ConfigServer ext</option><option value="1" label="Analytic2">Analytic2</option><option value="2" label="Doxr L2">Doxr L2</option><option value="3" label="Doxr L3">Doxr L3</option><option value="4" label="CurisIntegrity - Desktop">CurisIntegrity - Desktop</option><option value="5" label="CurisIntegrity SA">CurisIntegrity SA</option><option value="6" label="Analytic1">Analytic1</option><option value="7" label="CurisIntegrity - List of modes">CurisIntegrity - List of modes</option><option value="8" label="CurisIntegrity for Curistec">CurisIntegrity for Curistec</option><option value="9" label="CurisIntegrity for BP">CurisIntegrity for BP</option><option value="10" label="CD_AllMod_AllCemtest_Custom_0U">CD_AllMod_AllCemtest_Custom_0U</option><option value="11" label="CurisIntegrity StandAlone - A1CPC">CurisIntegrity StandAlone - A1CPC</option><option value="12" label="CD_AllMod_AllCemtest_MIDtest_Custom_0U">CD_AllMod_AllCemtest_MIDtest_Custom_0U</option><option value="13" label="CI SA Complete">CI SA Complete</option><option value="14" label="CI for Dev Complete">CI for Dev Complete</option><option value="15" label="CD_RockMod_MIDtest_MIDSynth_Express_50U">CD_RockMod_MIDtest_MIDSynth_Express_50U</option><option value="16" label="CurisData for Sonatrach">CurisData for Sonatrach</option><option value="17" label="CD_AllMod_Alltest_Full_100_L_0S_0U">CD_AllMod_Alltest_Full_100_L_0S_0U</option><option value="18" label="CD_CementAdvMod_AllCemtest_Custom_100L_0S_0U">CD_CementAdvMod_AllCemtest_Custom_100L_0S_0U</option><option value="19" label="CD_CementAdvMod_AllCemtest_Custom_30U">CD_CementAdvMod_AllCemtest_Custom_30U</option><option value="20" label="CD_CementAdvMod_30U_10L_Express">CD_CementAdvMod_30U_10L_Express</option><option value="21" label="CD_CementAdv_Monolab">CD_CementAdv_Monolab</option><option value="22" label="Stand alone - MultiComputation">Stand alone - MultiComputation</option><option value="23" label="MultiCement">MultiCement</option><option value="24" label="CD_CementAdvMod_AllCemtest_Custom_100U">CD_CementAdvMod_AllCemtest_Custom_100U</option><option value="25" label="CI StandAlone A1">CI StandAlone A1</option><option value="26" label="CI StandAlone A1 A2 QL CementProperties">CI StandAlone A1 A2 QL CementProperties</option><option value="27" label="CI Corporate A1">CI Corporate A1</option><option value="28" label="CI Demo version">CI Demo version</option><option value="29" label="CD Complete">CD Complete</option></select><!-- end ngIf: isNew -->
78
- <!-- ngIf: !isNew -->
79
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.license_type_id.$invalid">
80
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.license_type_id.$error.required" ng-bind="mandatoryFieldErrorMsg('License type')" class="ng-binding ng-hide">'License type' is required.</span>
81
- </div>
82
-</div>
83
-</div>
84
-
85
-<div class="form-group">
86
-<label class="col-md-3 control-label" for="organization_id" i18n="">Organization</label>
87
-<div class="col-md-8">
88
- <!-- ngIf: isNew --><select ng-if="isNew" class="form-control ng-pristine ng-untouched ng-scope ng-invalid ng-invalid-required" ng-model="pack.organization_id" ng-required="mandatory.organization_id" ng-options="o.id as o.label for o in refs.organization_id" required="required"><option value="" selected="selected" label=""></option><option value="0" label="British Petroleum">British Petroleum</option><option value="1" label="CurisTec">CurisTec</option><option value="2" label="KindSoft">KindSoft</option><option value="3" label="CurisIT">CurisIT</option><option value="4" label="Trican">Trican</option><option value="5" label="Schlumberger">Schlumberger</option><option value="6" label="Sonatrach">Sonatrach</option><option value="7" label="Sanjel-Taqa">Sanjel-Taqa</option><option value="8" label="National Petroleum Services Saudi Arabia Int.">National Petroleum Services Saudi Arabia Int.</option></select><!-- end ngIf: isNew -->
89
- <!-- ngIf: !isNew -->
90
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.organization_id.$invalid">
91
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.organization_id.$error.required" ng-bind="mandatoryFieldErrorMsg('Organization')" class="ng-binding ng-hide">'Organization' is required.</span>
92
- </div>
93
-</div>
94
-</div>
95
-<div class="form-group">
96
-<label class="col-md-3 control-label" for="license_preactivation" i18n="">License preactivation</label>
97
-<div class="col-md-8">
98
- <input type="checkbox" class="form-control ng-pristine ng-untouched ng-valid" ng-model="pack.license_preactivation">
99
-</div>
100
-</div>
101
-<div class="form-group">
102
-<label class="col-md-3 control-label" for="preactivation_valid_period" i18n="">Preactivation valid period (days)</label>
103
-<div class="col-md-8">
104
- <input type="number" id="preactivation_valid_period" name="preactivation_valid_period" min="1" class="form-control ng-pristine ng-untouched ng-valid ng-valid-min ng-valid-required" ng-model="pack.preactivation_valid_period" ng-required="pack.license_preactivation" required="required">
105
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.preactivation_valid_period.$invalid">
106
- <span class="glyphicon glyphicon-warning-sign"></span>
107
- <span ng-show="packForm.preactivation_valid_period.$error.required" ng-bind="mandatoryFieldErrorMsg('Preactivation valid period')" class="ng-binding ng-hide">'Preactivation valid period' is required.</span>
108
- <span ng-show="packForm.preactivation_valid_period.$error.min" ng-bind="field1ShouldBeGreaterThanField2('The preactivation valid period', '0')" class="ng-binding ng-hide">The preactivation valid period should be greater than 0</span>
109
- </div>
110
-</div>
111
-</div>
112
-<div class="form-group">
113
-<label class="col-md-3 control-label" for="renew_valid_period" i18n="">Period for renew (days)</label>
114
-<div class="col-md-8">
115
- <input type="number" id="renew_valid_period" name="renew_valid_period" min="0" class="form-control ng-pristine ng-untouched ng-valid-min ng-valid ng-valid-required" ng-model="pack.renew_valid_period" ng-required="true" required="required">
116
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.renew_valid_period.$invalid">
117
- <span class="glyphicon glyphicon-warning-sign"></span>
118
- <span ng-show="packForm.renew_valid_period.$error.required" ng-bind="mandatoryFieldErrorMsg('Period for renew')" class="ng-binding ng-hide">'Period for renew' is required.</span>
119
- <span ng-show="packForm.renew_valid_period.$error.min" ng-bind="field1ShouldBeGreaterThanField2('The period for renew valid period', '0')" class="ng-binding ng-hide">The period for renew valid period should be greater than 0</span>
120
- </div>
121
-</div>
122
-</div>
123
-
124
-
125
-<div class="form-group">
126
-<label class="col-md-3 control-label" for="comments" i18n="">Comments</label>
127
-<div class="col-md-8">
128
- <textarea type="string" id="comments" name="comments" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required" ng-model="pack.comments" rows="2" ng-required="mandatory.comments" ng-maxlength="1024"></textarea>
129
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.comments.$invalid">
130
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.comments.$error.maxlength" ng-bind="maxLengthErrorMsg('Comments', maxlength.comments)" class="ng-binding ng-hide">Comments length is too long (max: 1024).</span>
131
- <span ng-show="packForm.comments.$error.required" ng-bind="mandatoryFieldErrorMsg('comments')" class="ng-binding ng-hide">'comments' is required.</span>
132
- </div>
133
-</div>
134
-</div>
135
-
136
-<!-- ngIf: !isNew -->
137
-
138
-<!-- ngIf: !isNew -->
139
-
140
-<div class="form-group">
141
-<label class="col-md-3 control-label" i18n="">Metadata</label>
142
-<div class="col-md-8">
143
- <table class="table table-hover table-condensed">
144
- <thead>
145
- <tr>
146
- <th i18n="">Key</th>
147
- <th i18n="">Value</th>
148
- </tr>
149
- </thead>
150
- <tbody>
151
- <!-- ngRepeat: row_md in pack.metadata -->
152
- </tbody>
153
- </table>
154
-</div>
155
-</div>
156
-
157
-<div class="form-group">
158
-<div class="col-md-offset-3 col-md-10">
159
- <button id="save" type="submit" class="btn btn-primary">
160
- <span i18n="" class="glyphicon glyphicon-floppy-disk"></span> Save
161
- </button>
162
- <!-- ngIf: !isNew -->
163
- <ul class="dropdown-menu" role="menu">
164
- <li><!-- ngIf: Packs.isActionAvailable('activate', pack) --><a ng-click="execute('activate')" ng-if="Packs.isActionAvailable('activate', pack)" href="#" class="ng-scope">Activate</a><!-- end ngIf: Packs.isActionAvailable('activate', pack) --></li>
165
- <li><!-- ngIf: Packs.isActionAvailable('putonhold', pack) --></li>
166
- <li class="divider"></li>
167
- <li><!-- ngIf: Packs.isActionAvailable('cancel', pack) --></li>
168
- <li><!-- ngIf: Packs.isActionAvailable('delete', pack) --><a ng-click="execute('delete')" ng-if="Packs.isActionAvailable('delete', pack)" href="#" class="ng-scope">Delete</a><!-- end ngIf: Packs.isActionAvailable('delete', pack) --></li>
169
- </ul>
170
-</div>
171
-</div>
172
-</form>