| .. | .. |
|---|
| 8 | 8 | </md-card-subtitle> |
|---|
| 9 | 9 | <md-divider></md-divider> |
|---|
| 10 | 10 | <md-card-content> |
|---|
| 11 | | - <div layout="column" layout-align="start center"> |
|---|
| 12 | | - <div layout="row" layout-align="start center" layout-margin> |
|---|
| 13 | | - <md-input-container flex> |
|---|
| 11 | + <div layout="column" layout-align="start center" layout-fill> |
|---|
| 12 | + <div layout="row" layout-fill layout-padding> |
|---|
| 13 | + <div layout="column" layout-fill flex="50"> |
|---|
| 14 | + <md-input-container> |
|---|
| 14 | 15 | <input mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required /> |
|---|
| 15 | 16 | <md-placeholder> |
|---|
| 16 | 17 | <span i18n>Code</span> |
|---|
| 17 | 18 | </md-placeholder> |
|---|
| 18 | 19 | </md-input-container> |
|---|
| 20 | + {{log(packForm.controls)}} |
|---|
| 21 | + <div *ngIf="packForm.controls.code?.touched && packForm.controls.code.invalid" layout="column"> |
|---|
| 22 | + <span *ngIf="packForm.controls.code.errors.required" align="end">Code is required</span> |
|---|
| 23 | + <span align="end">Code is ok</span> |
|---|
| 24 | + </div> |
|---|
| 25 | + </div> |
|---|
| 19 | 26 | <!-- TODO: <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid"> |
|---|
| 20 | 27 | <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 21 | 28 | <span ng-show="packForm.code.$error.maxlength" ng-bind="maxLengthErrorMsg('Code', maxlength.code)" |
|---|
| 22 | 29 | class="ng-binding ng-hide">Code length is too long (max: 50).</span> |
|---|
| 23 | 30 | <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')" class="ng-binding">'Code' is required.</span> |
|---|
| 24 | 31 | </div> --> |
|---|
| 25 | | - <md-input-container flex> |
|---|
| 32 | + <md-input-container flex="50"> |
|---|
| 26 | 33 | <input mdInput type="number" type="text" [(ngModel)]="data.num_licenses" name="num_licenses" required /> |
|---|
| 27 | 34 | <md-placeholder> |
|---|
| 28 | 35 | <span i18n>Num. licenses</span> |
|---|
| 29 | 36 | </md-placeholder> |
|---|
| 30 | 37 | </md-input-container> |
|---|
| 31 | 38 | </div> |
|---|
| 32 | | - <div layout="row" layout-align="start center" layout-margin> |
|---|
| 39 | + <div layout="row" layout-align="start center" layout-fill layout-padding> |
|---|
| 33 | 40 | <md-input-container flex> |
|---|
| 34 | 41 | <input mdInput type="date" type="text" [(ngModel)]="data.init_valid_date" name="init_valid_date" required /> |
|---|
| 35 | 42 | <md-placeholder> |
|---|
| 36 | 43 | <span i18n>Initial date</span> |
|---|
| 37 | 44 | </md-placeholder> |
|---|
| 45 | + <md-hint align="end">YYYY-MM-DD</md-hint> |
|---|
| 38 | 46 | </md-input-container> |
|---|
| 39 | 47 | <md-input-container flex> |
|---|
| 40 | 48 | <input mdInput type="date" type="text" [(ngModel)]="data.end_valid_date" name="end_valid_date" required /> |
|---|
| 41 | 49 | <md-placeholder> |
|---|
| 42 | 50 | <span i18n>End date</span> |
|---|
| 43 | 51 | </md-placeholder> |
|---|
| 52 | + <md-hint align="end">YYYY-MM-DD</md-hint> |
|---|
| 44 | 53 | </md-input-container> |
|---|
| 45 | 54 | </div> |
|---|
| 46 | | - <div layout="row" layout-align="start center" layout-margin> |
|---|
| 55 | + <div layout="row" layout-fill layout-padding> |
|---|
| 47 | 56 | <md-select flex placeholder="Organization" [(ngModel)]="data.organization_id" name="organization_id"> |
|---|
| 48 | 57 | <md-option *ngFor="let org of organizations" [value]="org.id"> |
|---|
| 49 | 58 | {{org.label}} |
|---|
| 50 | 59 | </md-option> |
|---|
| 51 | 60 | </md-select> |
|---|
| 52 | 61 | <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"> |
|---|
| 62 | + <md-option *ngFor="let lt of licensetypes" [value]="lt.id"> |
|---|
| 54 | 63 | {{lt.label}} |
|---|
| 55 | 64 | </md-option> |
|---|
| 56 | 65 | </md-select> |
|---|
| .. | .. |
|---|
| 60 | 69 | <md-divider></md-divider> |
|---|
| 61 | 70 | <md-card-actions> |
|---|
| 62 | 71 | <button [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button> |
|---|
| 63 | | - <button md-button (click)="close()">Cancel</button> |
|---|
| 72 | + <button md-button md-dialog-close>Cancel</button> |
|---|
| 64 | 73 | </md-card-actions> |
|---|
| 65 | 74 | </md-card> |
|---|
| 66 | 75 | </form> |
|---|