| .. | .. |
|---|
| 3 | 3 | |
|---|
| 4 | 4 | <div class="container"> |
|---|
| 5 | 5 | <div class="col-md-12"> </div> |
|---|
| 6 | | - <div id="packs_section" class="col-md-6"> |
|---|
| 6 | + <div id="packs_section" class="col-md-6" ng-controller="PacksCtrl"> |
|---|
| 7 | 7 | <nav class="navbar navbar-default navbar-static-top"> |
|---|
| 8 | 8 | <!-- Brand and toggle get grouped for better mobile display --> |
|---|
| 9 | 9 | <div class="navbar-header"> |
|---|
| .. | .. |
|---|
| 14 | 14 | <div class="collapse navbar-collapse" |
|---|
| 15 | 15 | id="bs-example-navbar-collapse-1"> |
|---|
| 16 | 16 | <ul class="nav navbar-nav"> |
|---|
| 17 | | - <li><a i18n ng-click="editNew()"><span class="glyphicon glyphicon-plus"></span> |
|---|
| 17 | + <li><a i18n ng-click="newPack()"><span class="glyphicon glyphicon-plus"></span> |
|---|
| 18 | 18 | New</a></li> |
|---|
| 19 | 19 | <li><a i18n ng-click="cancel()"> <span |
|---|
| 20 | 20 | class="glyphicon glyphicon-ban-circle"></span> Cancel |
|---|
| .. | .. |
|---|
| 23 | 23 | <div class="navbar-form navbar-right"> |
|---|
| 24 | 24 | <div class="input-group input-group-sm"> |
|---|
| 25 | 25 | <span class="input-group-addon glyphicon glyphicon-search" style="top: 0px;"></span> |
|---|
| 26 | | - <input type="text" class="form-control" placeholder="Search" ng-model="$parent.searchText" > |
|---|
| 27 | | - <span class="btn input-group-addon glyphicon glyphicon-remove" ng-click="$parent.searchText = ''" style="top: 0px;"></span> |
|---|
| 26 | + <input type="text" class="form-control" placeholder="Search" ng-model="searchText" > |
|---|
| 27 | + <span class="btn input-group-addon glyphicon glyphicon-remove" ng-click="searchText = ''" style="top: 0px;"></span> |
|---|
| 28 | 28 | </div> |
|---|
| 29 | 29 | </div> |
|---|
| 30 | 30 | </div> |
|---|
| 31 | 31 | </nav> |
|---|
| 32 | + |
|---|
| 33 | + <div class="panel panel-default animate-show ng-hide" ng-show="showForm"> |
|---|
| 34 | + <form role="form" class="form-horizontal " name="packForm" id="packForm" ng-submit="save()" > |
|---|
| 35 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 36 | + <label class="col-md-3 control-label" >ID</label> |
|---|
| 37 | + <div class="col-md-8"> |
|---|
| 38 | + <p class="form-control-static" ng-bind="pack.id"></p> |
|---|
| 39 | + </div> |
|---|
| 40 | + </div> |
|---|
| 41 | + <div class="form-group" > |
|---|
| 42 | + <label class="col-md-3 control-label" for="code" i18n>Code</label> |
|---|
| 43 | + <div class="col-md-8"> |
|---|
| 44 | + <input type="string" id="code" name="code" placeholder="" class="form-control" ng-model="pack.code" ng-required="mandatory.code" ng-maxlength="{{maxlength.code}}" /> |
|---|
| 45 | + <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid"> |
|---|
| 46 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 47 | + <span ng-show="packForm.code.$error.maxlength" ng-bind="maxlengthErrorMsg('Code', maxlength.code)"></span> |
|---|
| 48 | + <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')"></span> |
|---|
| 49 | + </div> |
|---|
| 50 | + </div> |
|---|
| 51 | + </div> |
|---|
| 52 | + |
|---|
| 53 | + <div class="form-group" > |
|---|
| 54 | + <label class="col-md-3 control-label" for="num_licenses" i18n>Num. Licenses</label> |
|---|
| 55 | + <div class="col-md-8"> |
|---|
| 56 | + <input type="number" id="num_licenses" name="num_licenses" placeholder="" class="form-control" ng-model="pack.num_licenses" ng-required="mandatory.num_licenses" /> |
|---|
| 57 | + <div class="alert inline-alert alert-warning" ng-show="packForm.num_licenses.$invalid"> |
|---|
| 58 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 59 | + <span ng-show="packForm.num_licenses.$error.maxlength" ng-bind="maxlengthErrorMsg('Num. Licenses', maxlength.num_licenses)"></span> |
|---|
| 60 | + <span ng-show="packForm.num_licenses.$error.required" ng-bind="mandatoryFieldErrorMsg('Num. Licenses')"></span> |
|---|
| 61 | + </div> |
|---|
| 62 | + </div> |
|---|
| 63 | + </div> |
|---|
| 64 | + |
|---|
| 65 | + <div class="form-group" > |
|---|
| 66 | + <label class="col-md-3 control-label" for="license_type_id" i18n>License type</label> |
|---|
| 67 | + <div class="col-md-8"> |
|---|
| 68 | + <select class="form-control" ng-required="mandatory.license_type_id" ng-model="pack.license_type_id" |
|---|
| 69 | + ng-options="o.id as o.label for o in refs.license_type_id" > |
|---|
| 70 | + <option selected="true" ng-if="!mandatory.license_type_id" value=""></option> |
|---|
| 71 | + </select> |
|---|
| 72 | + <div class="alert inline-alert alert-warning" ng-show="packForm.license_type_id.$invalid"> |
|---|
| 73 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 74 | + <span ng-show="packForm.license_type_id.$error.required" ng-bind="mandatoryFieldErrorMsg('License type')"></span> |
|---|
| 75 | + </div> |
|---|
| 76 | + </div> |
|---|
| 77 | + </div> |
|---|
| 78 | + |
|---|
| 79 | + <div class="form-group" > |
|---|
| 80 | + <label class="col-md-3 control-label" for="organization_id" i18n>Organization</label> |
|---|
| 81 | + <div class="col-md-8"> |
|---|
| 82 | + <select class="form-control" ng-required="field.mandatory" ng-model="pack.organization_id" |
|---|
| 83 | + ng-options="o.id as o.label for o in refs.organization_id" > |
|---|
| 84 | + <option selected="true" ng-if="!mandatory.organization_id" value=""></option> |
|---|
| 85 | + </select> |
|---|
| 86 | + <div class="alert inline-alert alert-warning" ng-show="packForm.organization_id.$invalid"> |
|---|
| 87 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 88 | + <span ng-show="packForm.organization_id.$error.required" ng-bind="mandatoryFieldErrorMsg('Organization')"></span> |
|---|
| 89 | + </div> |
|---|
| 90 | + </div> |
|---|
| 91 | + </div> |
|---|
| 92 | + |
|---|
| 93 | + |
|---|
| 94 | + <div class="form-group" > |
|---|
| 95 | + <label class="col-md-3 control-label" for="comments" i18n>Comments</label> |
|---|
| 96 | + <div class="col-md-8"> |
|---|
| 97 | + <textarea type="string" id="comments" name="comments" placeholder="" |
|---|
| 98 | + class="form-control" ng-model="pack.comments" rows="2" ng-required="mandatory.comments" ng-maxlength="{{maxlength.comments}}"></textarea> |
|---|
| 99 | + <div class="alert inline-alert alert-warning" ng-show="packForm.comments.$invalid"> |
|---|
| 100 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 101 | + <span ng-show="packForm.comments.$error.maxlength" ng-bind="maxlengthErrorMsg('Comments', maxlength.comments)"></span> |
|---|
| 102 | + <span ng-show="packForm.comments.$error.required" ng-bind="mandatoryFieldErrorMsg('comments')"></span> |
|---|
| 103 | + </div> |
|---|
| 104 | + </div> |
|---|
| 105 | + </div> |
|---|
| 106 | + |
|---|
| 107 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 108 | + <label class="col-md-3 control-label" >Created by</label> |
|---|
| 109 | + <div class="col-md-8"> |
|---|
| 110 | + <p class="form-control-static" ng-bind="pack.created_by_name"></p> |
|---|
| 111 | + </div> |
|---|
| 112 | + </div> |
|---|
| 113 | + |
|---|
| 114 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 115 | + <label class="col-md-3 control-label" >Creation date</label> |
|---|
| 116 | + <div class="col-md-8"> |
|---|
| 117 | + <p class="form-control-static" ng-bind="pack.creationTimestamp | date:'medium'"></p> |
|---|
| 118 | + </div> |
|---|
| 119 | + </div> |
|---|
| 120 | + |
|---|
| 121 | + <div class="form-group"> |
|---|
| 122 | + <div class="col-md-offset-3 col-md-10" id="saveContainer"> |
|---|
| 123 | + <button id="save" type="submit" class="btn btn-primary" > |
|---|
| 124 | + <span i18n class="glyphicon glyphicon-floppy-disk"></span> Save |
|---|
| 125 | + </button> |
|---|
| 126 | + </div> |
|---|
| 127 | + </div> |
|---|
| 128 | + </form> |
|---|
| 129 | + </div> |
|---|
| 130 | + |
|---|
| 131 | + |
|---|
| 32 | 132 | <div class="panel panel-default" > |
|---|
| 33 | 133 | <div class="panel-heading"> |
|---|
| 34 | 134 | Packs <span class="badge pull-right" ng-bind="packs.length || 0"></span> |
|---|
| .. | .. |
|---|
| 37 | 137 | <table class="table table-hover table-condensed"> |
|---|
| 38 | 138 | <thead> |
|---|
| 39 | 139 | <tr> |
|---|
| 140 | + <th i18n >Code</th> |
|---|
| 40 | 141 | <th i18n >Organization</th> |
|---|
| 41 | 142 | <th i18n >Application</th> |
|---|
| 42 | | - <th i18n >Code</th> |
|---|
| 43 | 143 | <th i18n >Licenses</th> |
|---|
| 44 | 144 | <th></th> |
|---|
| 45 | 145 | </tr> |
|---|
| 46 | 146 | </thead> |
|---|
| 47 | 147 | <tbody> |
|---|
| 48 | | - <tr ng-repeat="pack in packs | filter:searchText" ng-dblclick="editPack(row)" ng-class="{success: currentPack.id === pack.id}" ng-click="selectPack(pack)"> |
|---|
| 49 | | - <td ng-bind="ellipsis(pack.organization_name, 20)" title="{{pack.organization_name}}" ></td> |
|---|
| 50 | | - <td ng-bind="pack.application_name"></td> |
|---|
| 51 | | - <td style="white-space: nowrap;" ng-bind="pack.code"></td> |
|---|
| 52 | | - <td title="Total: {{pack.licenses}}, avaliable: {{pack.lic_available}}">{{pack.licenses}} ({{pack.lic_available}})</td> |
|---|
| 53 | | - <td><span ng-click="editPack(row)" |
|---|
| 148 | + <tr ng-repeat="p in packs | filter:searchText" ng-dblclick="editPack(p)" ng-class="{success: currentPackId === p.id}" ng-click="selectPack(p.id)"> |
|---|
| 149 | + <td style="white-space: nowrap;" ng-bind="p.code"></td> |
|---|
| 150 | + <td ng-bind="ellipsis(p.organization_name, 20)" title="{{pack.organization_name}}" ></td> |
|---|
| 151 | + <td ng-bind="p.application_name"></td> |
|---|
| 152 | + <td title="Total: {{p.num_licenses}}, available: {{p.num_available}}">{{p.num_licenses}} ({{p.num_available}})</td> |
|---|
| 153 | + <td><span ng-click="editPack(p)" |
|---|
| 54 | 154 | class="glyphicon glyphicon-pencil"></span> |
|---|
| 55 | | - <span ng-click="deletePack(row)" |
|---|
| 155 | + <span ng-click="deletePack(p)" |
|---|
| 56 | 156 | class="glyphicon glyphicon-remove"></span> |
|---|
| 57 | 157 | </td> |
|---|
| 58 | 158 | </tr> |
|---|
| .. | .. |
|---|
| 61 | 161 | </tfoot> |
|---|
| 62 | 162 | </table> |
|---|
| 63 | 163 | </div> |
|---|
| 64 | | - |
|---|
| 164 | + |
|---|
| 65 | 165 | </div> |
|---|
| 66 | 166 | |
|---|
| 67 | 167 | <div id="licenses_section" class="col-md-6" > |
|---|
| 68 | | - <nav class="navbar navbar-default navbar-static-top" ng-disabled="!!currentPack"> |
|---|
| 168 | + <nav class="navbar navbar-default navbar-static-top" ng-disabled="currentPackId === null"> |
|---|
| 69 | 169 | <!-- Brand and toggle get grouped for better mobile display --> |
|---|
| 70 | 170 | <div class="navbar-header success"> |
|---|
| 71 | 171 | <a class="navbar-brand" i18n>Licenses</a> |
|---|
| .. | .. |
|---|
| 91 | 191 | </div> |
|---|
| 92 | 192 | </nav> |
|---|
| 93 | 193 | |
|---|
| 94 | | - <div ng-if="!currentPack" class="well well-lg"> |
|---|
| 194 | + <div ng-if="currentPackId === null" class="well well-lg"> |
|---|
| 95 | 195 | <h4 i18n>No pack selected</h4> |
|---|
| 96 | 196 | <p i18n>Please, select a pack to manage its licenses</p> |
|---|
| 97 | 197 | </div> |
|---|
| 98 | 198 | |
|---|
| 99 | | - <div class="panel panel-default" ng-if="currentPack"> |
|---|
| 199 | + <div class="panel panel-default" ng-if="currentPackId !== null"> |
|---|
| 100 | 200 | <div class="panel-heading"> |
|---|
| 101 | 201 | <span i18n>Licenses for pack: </span>{{currentPack.code}} |
|---|
| 102 | 202 | <span style="color: lightgreen;" class="badge pull-right" ng-bind="currentPack.lic_available || 0"></span> |
|---|