| .. | .. |
|---|
| 145 | 145 | </tr> |
|---|
| 146 | 146 | </thead> |
|---|
| 147 | 147 | <tbody> |
|---|
| 148 | | - <tr ng-repeat="p in packs | filter:searchText" ng-dblclick="editPack(p)" ng-class="{success: currentPackId === p.id}" ng-click="selectPack(p.id)"> |
|---|
| 148 | + <tr ng-repeat="p in packs | filter:searchText" ng-dblclick="editPack(p)" ng-class="{success: currentPack.id === p.id}" ng-click="selectPack(p)"> |
|---|
| 149 | 149 | <td style="white-space: nowrap;" ng-bind="p.code"></td> |
|---|
| 150 | 150 | <td ng-bind="ellipsis(p.organization_name, 20)" title="{{pack.organization_name}}" ></td> |
|---|
| 151 | 151 | <td ng-bind="p.application_name"></td> |
|---|
| .. | .. |
|---|
| 164 | 164 | |
|---|
| 165 | 165 | </div> |
|---|
| 166 | 166 | |
|---|
| 167 | | - <div id="licenses_section" class="col-md-6" > |
|---|
| 168 | | - <nav class="navbar navbar-default navbar-static-top" ng-disabled="currentPackId === null"> |
|---|
| 167 | + <div id="licenses_section" class="col-md-6" ng-controller="LicensesCtrl"> |
|---|
| 168 | + <nav class="navbar navbar-default navbar-static-top" ng-disabled="!currentPack"> |
|---|
| 169 | 169 | <!-- Brand and toggle get grouped for better mobile display --> |
|---|
| 170 | 170 | <div class="navbar-header success"> |
|---|
| 171 | 171 | <a class="navbar-brand" i18n>Licenses</a> |
|---|
| .. | .. |
|---|
| 175 | 175 | <div class="collapse navbar-collapse" |
|---|
| 176 | 176 | id="bs-example-navbar-collapse-1"> |
|---|
| 177 | 177 | <ul class="nav navbar-nav"> |
|---|
| 178 | | - <li><a i18n ng-click="editNewLicense()"><span class="glyphicon glyphicon-plus"></span> |
|---|
| 178 | + <li><a i18n ng-click="newLicense()"><span class="glyphicon glyphicon-plus"></span> |
|---|
| 179 | 179 | New</a></li> |
|---|
| 180 | | - <li><a i18n ng-click="cancelEditionLicense()"> <span |
|---|
| 180 | + <li><a i18n ng-click="cancel()"> <span |
|---|
| 181 | 181 | class="glyphicon glyphicon-ban-circle"></span> Cancel |
|---|
| 182 | 182 | </a></li> |
|---|
| 183 | 183 | </ul> |
|---|
| .. | .. |
|---|
| 191 | 191 | </div> |
|---|
| 192 | 192 | </nav> |
|---|
| 193 | 193 | |
|---|
| 194 | | - <div ng-if="currentPackId === null" class="well well-lg"> |
|---|
| 194 | + <div ng-if="!currentPack" class="well well-lg"> |
|---|
| 195 | 195 | <h4 i18n>No pack selected</h4> |
|---|
| 196 | 196 | <p i18n>Please, select a pack to manage its licenses</p> |
|---|
| 197 | 197 | </div> |
|---|
| 198 | 198 | |
|---|
| 199 | | - <div class="panel panel-default" ng-if="currentPackId !== null"> |
|---|
| 199 | + <div ng-if="currentPack" class="panel panel-default animate-show ng-hide" ng-show="showForm"> |
|---|
| 200 | + <form role="form" class="form-horizontal " name="licenseForm" id="licenseForm" ng-submit="save()" > |
|---|
| 201 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 202 | + <label class="col-md-3 control-label" >ID</label> |
|---|
| 203 | + <div class="col-md-8"> |
|---|
| 204 | + <p class="form-control-static" ng-bind="license.id"></p> |
|---|
| 205 | + </div> |
|---|
| 206 | + </div> |
|---|
| 207 | + <div class="form-group" > |
|---|
| 208 | + <label class="col-md-3 control-label" for="pack_id" i18n>Pack</label> |
|---|
| 209 | + <div class="col-md-8"> |
|---|
| 210 | + <p class="form-control-static" ng-bind="currentPack.code"></p> |
|---|
| 211 | + <input type="hidden" id="pack_id" name="pack_id" ng-model="license.pack_id" /> |
|---|
| 212 | + </div> |
|---|
| 213 | + </div> |
|---|
| 214 | + <div class="form-group" > |
|---|
| 215 | + <label class="col-md-3 control-label" for="code" i18n>Code</label> |
|---|
| 216 | + <div class="col-md-8"> |
|---|
| 217 | + <input type="string" id="code" name="code" placeholder="" class="form-control" ng-model="license.code" ng-required="mandatory.code" ng-maxlength="{{maxlength.code}}" /> |
|---|
| 218 | + <div class="alert inline-alert alert-warning" ng-show="licenseForm.code.$invalid"> |
|---|
| 219 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 220 | + <span ng-show="licenseForm.code.$error.maxlength" ng-bind="maxlengthErrorMsg('Code', maxlength.code)"></span> |
|---|
| 221 | + <span ng-show="licenseForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')"></span> |
|---|
| 222 | + </div> |
|---|
| 223 | + </div> |
|---|
| 224 | + </div> |
|---|
| 225 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 226 | + <label class="col-md-3 control-label" i18n>Status</label> |
|---|
| 227 | + <div class="col-md-8"> |
|---|
| 228 | + <p class="form-control-static" ng-bind="showStatusComplete(license)"></p> |
|---|
| 229 | + </div> |
|---|
| 230 | + </div> |
|---|
| 231 | + |
|---|
| 232 | + <div class="form-group" > |
|---|
| 233 | + <label class="col-md-3 control-label" for="full_name" i18n>User full name</label> |
|---|
| 234 | + <div class="col-md-8"> |
|---|
| 235 | + <input type="string" id="full_name" name="full_name" placeholder="" class="form-control" ng-model="license.full_name" ng-required="mandatory.full_name" /> |
|---|
| 236 | + <div class="alert inline-alert alert-warning" ng-show="licenseForm.full_name.$invalid"> |
|---|
| 237 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 238 | + <span ng-show="licenseForm.full_name.$error.maxlength" ng-bind="maxlengthErrorMsg('User full name', maxlength.full_name)"></span> |
|---|
| 239 | + <span ng-show="licenseForm.full_name.$error.required" ng-bind="mandatoryFieldErrorMsg('User full name')"></span> |
|---|
| 240 | + </div> |
|---|
| 241 | + </div> |
|---|
| 242 | + </div> |
|---|
| 243 | + |
|---|
| 244 | + <div class="form-group" > |
|---|
| 245 | + <label class="col-md-3 control-label" for="email" i18n>User email</label> |
|---|
| 246 | + <div class="col-md-8"> |
|---|
| 247 | + <input type="email" id="email" name="email" placeholder="" class="form-control" ng-model="license.email" ng-required="mandatory.email" /> |
|---|
| 248 | + <div class="alert inline-alert alert-warning" ng-show="licenseForm.email.$invalid"> |
|---|
| 249 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 250 | + <span ng-show="licenseForm.email.$error.email" ng-bind="'Please, write a valid email address'"></span> |
|---|
| 251 | + <span ng-show="licenseForm.email.$error.maxlength" ng-bind="maxlengthErrorMsg('User email', maxlength.email)"></span> |
|---|
| 252 | + <span ng-show="licenseForm.email.$error.required" ng-bind="mandatoryFieldErrorMsg('User email')"></span> |
|---|
| 253 | + </div> |
|---|
| 254 | + </div> |
|---|
| 255 | + </div> |
|---|
| 256 | + |
|---|
| 257 | + <div class="form-group" ng-if="isNew || !license.request_data" > |
|---|
| 258 | + <label class="col-md-3 control-label" for="request_data" i18n>Request data</label> |
|---|
| 259 | + <div class="col-md-8"> |
|---|
| 260 | + <textarea type="string" id="request_data" name="request_data" placeholder="" |
|---|
| 261 | + class="form-control" ng-model="license.request_data" rows="2" ng-required="mandatory.request_data" ng-maxlength="{{maxlength.request_data}}"></textarea> |
|---|
| 262 | + <div class="alert inline-alert alert-warning" ng-show="licenseForm.request_data.$invalid"> |
|---|
| 263 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 264 | + <span ng-show="licenseForm.request_data.$error.maxlength" ng-bind="maxlengthErrorMsg('Request data', maxlength.request_data)"></span> |
|---|
| 265 | + <span ng-show="licenseForm.request_data.$error.required" ng-bind="mandatoryFieldErrorMsg('Request data')"></span> |
|---|
| 266 | + </div> |
|---|
| 267 | + </div> |
|---|
| 268 | + </div> |
|---|
| 269 | + |
|---|
| 270 | + <div class="form-group" > |
|---|
| 271 | + <label class="col-md-3 control-label" for="comments" i18n>Comments</label> |
|---|
| 272 | + <div class="col-md-8"> |
|---|
| 273 | + <textarea type="string" id="comments" name="comments" placeholder="" |
|---|
| 274 | + class="form-control" ng-model="license.comments" rows="2" ng-required="mandatory.comments" ng-maxlength="{{maxlength.comments}}"></textarea> |
|---|
| 275 | + <div class="alert inline-alert alert-warning" ng-show="licenseForm.comments.$invalid"> |
|---|
| 276 | + <span class="glyphicon glyphicon-warning-sign"></span> |
|---|
| 277 | + <span ng-show="licenseForm.comments.$error.maxlength" ng-bind="maxlengthErrorMsg('Comments', maxlength.comments)"></span> |
|---|
| 278 | + <span ng-show="licenseForm.comments.$error.required" ng-bind="mandatoryFieldErrorMsg('comments')"></span> |
|---|
| 279 | + </div> |
|---|
| 280 | + </div> |
|---|
| 281 | + </div> |
|---|
| 282 | + |
|---|
| 283 | + <div class="form-group" ng-if="!isNew && license.request_data"> |
|---|
| 284 | + <label class="col-md-3 control-label" i18n>Request data</label> |
|---|
| 285 | + <div class="col-md-8"> |
|---|
| 286 | + <pre class="form-control-static" ng-bind="license.request_data | json"></pre> |
|---|
| 287 | + </div> |
|---|
| 288 | + </div> |
|---|
| 289 | + |
|---|
| 290 | + <div class="form-group" ng-if="!isNew && license.license_data"> |
|---|
| 291 | + <label class="col-md-3 control-label" i18n >License file</label> |
|---|
| 292 | + <div class="col-md-8"> |
|---|
| 293 | + <p class="form-control-static" ng-bind="license.license_data"></p> |
|---|
| 294 | + <button id="downloadLicense" class="btn btn-xs btn-link" ng-click="downloadLicense(license)"> |
|---|
| 295 | + <span i18n class="glyphicon glyphicon-download"></span> |
|---|
| 296 | + </button> |
|---|
| 297 | + </div> |
|---|
| 298 | + </div> |
|---|
| 299 | + |
|---|
| 300 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 301 | + <label class="col-md-3 control-label" i18n>Created by</label> |
|---|
| 302 | + <div class="col-md-8"> |
|---|
| 303 | + <p class="form-control-static" ng-bind="license.created_by_name"></p> |
|---|
| 304 | + </div> |
|---|
| 305 | + </div> |
|---|
| 306 | + |
|---|
| 307 | + <div class="form-group" ng-if="!isNew && license.canceled_by_name"> |
|---|
| 308 | + <label class="col-md-3 control-label" >Canceled by</label> |
|---|
| 309 | + <div class="col-md-8"> |
|---|
| 310 | + <p class="form-control-static" ng-bind="license.canceled_by_name"></p> |
|---|
| 311 | + </div> |
|---|
| 312 | + </div> |
|---|
| 313 | + |
|---|
| 314 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 315 | + <label class="col-md-3 control-label" i18n>Creation date</label> |
|---|
| 316 | + <div class="col-md-8"> |
|---|
| 317 | + <p class="form-control-static" ng-bind="license.creationTimestamp | date:'medium'"></p> |
|---|
| 318 | + </div> |
|---|
| 319 | + </div> |
|---|
| 320 | + |
|---|
| 321 | + <div class="form-group" ng-if="!isNew"> |
|---|
| 322 | + <label class="col-md-3 control-label" i18n >Modification date</label> |
|---|
| 323 | + <div class="col-md-8"> |
|---|
| 324 | + <p class="form-control-static" ng-bind="license.modificationTimestamp | date:'medium'"></p> |
|---|
| 325 | + </div> |
|---|
| 326 | + </div> |
|---|
| 327 | + |
|---|
| 328 | + <div class="form-group" ng-if="!isNew && license.activationTimestamp"> |
|---|
| 329 | + <label class="col-md-3 control-label" i18n >Activation date</label> |
|---|
| 330 | + <div class="col-md-8"> |
|---|
| 331 | + <p class="form-control-static" ng-bind="license.activationTimestamp | date:'medium'"></p> |
|---|
| 332 | + </div> |
|---|
| 333 | + </div> |
|---|
| 334 | + |
|---|
| 335 | + <div class="form-group" ng-if="!isNew && license.sendTimestamp"> |
|---|
| 336 | + <label class="col-md-3 control-label" i18n >Send date</label> |
|---|
| 337 | + <div class="col-md-8"> |
|---|
| 338 | + <p class="form-control-static" ng-bind="license.sendTimestamp | date:'medium'"></p> |
|---|
| 339 | + </div> |
|---|
| 340 | + </div> |
|---|
| 341 | + |
|---|
| 342 | + <div class="form-group" ng-if="!isNew && license.cancelationTimestamp"> |
|---|
| 343 | + <label class="col-md-3 control-label" i18n >Cancelation date</label> |
|---|
| 344 | + <div class="col-md-8"> |
|---|
| 345 | + <p class="form-control-static" ng-bind="license.cancelationTimestamp | date:'medium'"></p> |
|---|
| 346 | + </div> |
|---|
| 347 | + </div> |
|---|
| 348 | + |
|---|
| 349 | + <div class="form-group" ng-if="!isNew && license.lastAccessTimestamp"> |
|---|
| 350 | + <label class="col-md-3 control-label" i18n>Last access date</label> |
|---|
| 351 | + <div class="col-md-8"> |
|---|
| 352 | + <p class="form-control-static" ng-bind="license.lastAccessTimestamp | date:'medium'"></p> |
|---|
| 353 | + </div> |
|---|
| 354 | + </div> |
|---|
| 355 | + |
|---|
| 356 | + <div class="form-group"> |
|---|
| 357 | + <div class="col-md-offset-3 col-md-10" id="saveContainer"> |
|---|
| 358 | + <button id="save" type="submit" class="btn btn-primary" > |
|---|
| 359 | + <span i18n class="glyphicon glyphicon-floppy-disk"></span> Save |
|---|
| 360 | + </button> |
|---|
| 361 | + </div> |
|---|
| 362 | + </div> |
|---|
| 363 | + </form> |
|---|
| 364 | + </div> |
|---|
| 365 | + |
|---|
| 366 | + <div class="panel panel-default" ng-if="currentPack"> |
|---|
| 200 | 367 | <div class="panel-heading"> |
|---|
| 201 | 368 | <span i18n>Licenses for pack: </span>{{currentPack.code}} |
|---|
| 202 | 369 | <span style="color: lightgreen;" class="badge pull-right" ng-bind="currentPack.lic_available || 0"></span> |
|---|
| .. | .. |
|---|
| 217 | 384 | <tbody> |
|---|
| 218 | 385 | <tr ng-repeat="lic in licenses | filter:searchLicenseText" ng-dblclick="editLicense(lic)" > |
|---|
| 219 | 386 | <td style="white-space: nowrap;" ng-bind="lic.code"></td> |
|---|
| 220 | | - <td ng-bind="ellipsis(lic.user_fullname, 20)" title="{{lic.user_fullname}}" ></td> |
|---|
| 221 | | - <td ng-bind="ellipsis(lic.user_email, 30)" title="{{lic.user_email}}" ></td> |
|---|
| 222 | | - <td ng-bind="lic.status"></td> |
|---|
| 387 | + <td ng-bind="ellipsis(lic.full_name, 20)" title="{{lic.full_name}}" ></td> |
|---|
| 388 | + <td ng-bind="ellipsis(lic.email, 30)" title="{{lic.email}}" ></td> |
|---|
| 389 | + <td ng-bind="showStatus(lic.status)"></td> |
|---|
| 223 | 390 | <td> |
|---|
| 224 | 391 | <div class="dropdown"> |
|---|
| 225 | 392 | <a class="dropdown-toggle" data-toggle="dropdown" > |
|---|
| 226 | 393 | <span class="glyphicon glyphicon-align-justify"></span> <span class="caret"></span> |
|---|
| 227 | 394 | </a> |
|---|
| 228 | 395 | <ul class="dropdown-menu"> |
|---|
| 229 | | - <li><a ng-click="editLicense(lic)"><span class="glyphicon glyphicon-pencil"></span> <span i18n>Edit</span></a></li> |
|---|
| 230 | | - <li><a ng-click="activateLicense(lic)"><span class="glyphicon glyphicon-check"></span> <span i18n>Activate</span></a></li> |
|---|
| 231 | | - <li><a ng-click="sendEmail(lic)"><span class="glyphicon glyphicon-send"></span> <span i18n>Send email</span></a></li> |
|---|
| 232 | | - <li><a ng-click="editLicense(lic)"><span class="glyphicon glyphicon-remove"></span> <span i18n>Remove</span></a></li> |
|---|
| 396 | + <li ng-if="isActionVisible(1, lic)"><a ng-click="downloadLicense(lic)"><span class="glyphicon glyphicon-download"></span> <span i18n>Download</span></a></li> |
|---|
| 397 | + <li ng-if="isActionVisible(2, lic)"><a ng-click="editLicense(lic)"><span class="glyphicon glyphicon-pencil"></span> <span i18n>Edit</span></a></li> |
|---|
| 398 | + <li ng-if="isActionVisible(4, lic)"><a ng-click="activateLicense(lic)"><span class="glyphicon glyphicon-check"></span> <span i18n>Activate</span></a></li> |
|---|
| 399 | + <li ng-if="isActionVisible(8, lic)"><a ng-click="sendEmail(lic)"><span class="glyphicon glyphicon-send"></span> <span i18n>Send email</span></a></li> |
|---|
| 400 | + <li ng-if="isActionVisible(16, lic)"><a ng-click="deleteLicense(lic)"><span class="glyphicon glyphicon-remove"></span> <span i18n>Remove</span></a></li> |
|---|
| 233 | 401 | </ul> |
|---|
| 234 | 402 | </div> |
|---|
| 235 | 403 | </td> |
|---|