From 6078e6018ca05bcc0203241dc44071a59cf5e78c Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Fri, 10 Mar 2017 16:33:31 +0000
Subject: [PATCH] #3527 fix - Customizing packs listing
---
securis/src/main/webapp/src/app/forms/pack.form.html | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/securis/src/main/webapp/src/app/forms/pack.form.html b/securis/src/main/webapp/src/app/forms/pack.form.html
index 9b0d17c..df65d4d 100644
--- a/securis/src/main/webapp/src/app/forms/pack.form.html
+++ b/securis/src/main/webapp/src/app/forms/pack.form.html
@@ -8,49 +8,58 @@
</md-card-subtitle>
<md-divider></md-divider>
<md-card-content>
- <div layout="column" layout-align="start center">
- <div layout="row" layout-align="start center" layout-margin>
- <md-input-container flex>
+ <div layout="column" layout-align="start center" layout-fill>
+ <div layout="row" layout-fill layout-padding>
+ <div layout="column" layout-fill flex="50">
+ <md-input-container>
<input mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required />
<md-placeholder>
<span i18n>Code</span>
</md-placeholder>
</md-input-container>
+ {{log(packForm.controls)}}
+ <div *ngIf="packForm.controls.code?.touched && packForm.controls.code.invalid" layout="column">
+ <span *ngIf="packForm.controls.code.errors.required" align="end">Code is required</span>
+ <span align="end">Code is ok</span>
+ </div>
+ </div>
<!-- TODO: <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid">
<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>
</div> -->
- <md-input-container flex>
+ <md-input-container flex="50">
<input mdInput type="number" type="text" [(ngModel)]="data.num_licenses" name="num_licenses" required />
<md-placeholder>
<span i18n>Num. licenses</span>
</md-placeholder>
</md-input-container>
</div>
- <div layout="row" layout-align="start center" layout-margin>
+ <div layout="row" layout-align="start center" layout-fill layout-padding>
<md-input-container flex>
<input mdInput type="date" type="text" [(ngModel)]="data.init_valid_date" name="init_valid_date" required />
<md-placeholder>
<span i18n>Initial date</span>
</md-placeholder>
+ <md-hint align="end">YYYY-MM-DD</md-hint>
</md-input-container>
<md-input-container flex>
<input mdInput type="date" type="text" [(ngModel)]="data.end_valid_date" name="end_valid_date" required />
<md-placeholder>
<span i18n>End date</span>
</md-placeholder>
+ <md-hint align="end">YYYY-MM-DD</md-hint>
</md-input-container>
</div>
- <div layout="row" layout-align="start center" layout-margin>
+ <div layout="row" layout-fill layout-padding>
<md-select flex placeholder="Organization" [(ngModel)]="data.organization_id" name="organization_id">
<md-option *ngFor="let org of organizations" [value]="org.id">
{{org.label}}
</md-option>
</md-select>
<md-select flex placeholder="License type" [(ngModel)]="data.license_type_id" name="license_type_id">
- <md-option *ngFor="let lt of lictypes" [value]="lt.id">
+ <md-option *ngFor="let lt of licensetypes" [value]="lt.id">
{{lt.label}}
</md-option>
</md-select>
@@ -60,7 +69,7 @@
<md-divider></md-divider>
<md-card-actions>
<button [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button>
- <button md-button (click)="close()">Cancel</button>
+ <button md-button md-dialog-close>Cancel</button>
</md-card-actions>
</md-card>
</form>
--
Gitblit v1.3.2