Roberto Sánchez
2014-01-17 c487a57f5fa692b7f5d1b1b7b4d0ca3839261cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
   <div ng-include="'header.html'" ></div>
   <div class="container">
       <div class="col-md-12">&nbsp;</div>
       <div id="packs_section" class="col-md-6">
                       <nav class="navbar navbar-default navbar-static-top">
                   <!-- Brand and toggle get grouped for better mobile display -->
                   <div class="navbar-header">
                       <a class="navbar-brand" i18n >Packs</a>
                   </div>
                   <!-- Collect the nav links, forms, and other content for toggling -->
                   <div class="collapse navbar-collapse"
                       id="bs-example-navbar-collapse-1">
                       <ul class="nav navbar-nav">
                           <li><a i18n ng-click="editNew()"><span class="glyphicon glyphicon-plus"></span>
                                   New</a></li>
                           <li><a i18n ng-click="cancel()"> <span
                                   class="glyphicon glyphicon-ban-circle"></span> Cancel
                           </a></li>
                       </ul>
                       <div class="navbar-form navbar-right">
                       <div class="input-group input-group-sm">
                             <span class="input-group-addon glyphicon glyphicon-search" style="top: 0px;"></span>
                         <input type="text" class="form-control" placeholder="Search" ng-model="$parent.searchText" >
                               <span class="btn input-group-addon glyphicon glyphicon-remove" ng-click="$parent.searchText = ''" style="top: 0px;"></span>
                       </div>
                       </div>
                   </div>
               </nav>
           <div class="panel panel-default" >
               <div class="panel-heading">
                   Packs <span class="badge pull-right" ng-bind="packs.length || 0"></span>
               </div>
               <table class="table table-hover table-condensed">
                   <thead>
                       <tr>
                           <th i18n >Organization</th>
                           <th i18n >Application</th>
                           <th i18n >Code</th>
                           <th i18n >Licenses</th>
                           <th></th>
                       </tr>
                   </thead>
                   <tbody>
                       <tr ng-repeat="pack in packs | filter:searchText" ng-dblclick="editPack(row)" ng-class="{success: currentPack.id === pack.id}" ng-click="selectPack(pack)">
                           <td ng-bind="ellipsis(pack.organization_name, 20)" title="{{pack.organization_name}}" ></td>
                           <td ng-bind="pack.application_name"></td>
                           <td style="white-space: nowrap;" ng-bind="pack.code"></td>
                           <td title="Total: {{pack.licenses}}, avaliable: {{pack.lic_available}}">{{pack.licenses}} ({{pack.lic_available}})</td>
                           <td><span ng-click="editPack(row)"
                               class="glyphicon glyphicon-pencil"></span>
                               <span ng-click="deletePack(row)"
                               class="glyphicon glyphicon-remove"></span>
                               </td>
                       </tr>
                   </tbody>
                   <tfoot>
                   </tfoot>
               </table>
           </div>
       
       </div>
       <div id="licenses_section" class="col-md-6" >
               <nav class="navbar navbar-default navbar-static-top" ng-disabled="!!currentPack">
                   <!-- Brand and toggle get grouped for better mobile display -->
                   <div class="navbar-header success">
                       <a class="navbar-brand" i18n>Licenses</a>
                   </div>
                   <!-- Collect the nav links, forms, and other content for toggling -->
                   <div class="collapse navbar-collapse"
                       id="bs-example-navbar-collapse-1">
                       <ul class="nav navbar-nav">
                           <li><a i18n ng-click="editNewLicense()"><span class="glyphicon glyphicon-plus"></span>
                                   New</a></li>
                           <li><a i18n ng-click="cancelEditionLicense()"> <span
                                   class="glyphicon glyphicon-ban-circle"></span> Cancel
                           </a></li>
                       </ul>
                       <div class="navbar-form navbar-right">
                       <div class="input-group input-group-sm">
                             <span class="input-group-addon glyphicon glyphicon-search" style="top: 0px;"></span>
                         <input type="text" class="form-control" placeholder="Search" ng-model="$searchPacksText" >
                               <span class="btn input-group-addon glyphicon glyphicon-remove" ng-click="$searchPacksText = ''" style="top: 0px;"></span>
                       </div>
                       </div>
                   </div>
               </nav>
               
               <div ng-if="!currentPack" class="well well-lg">
                 <h4 i18n>No pack selected</h4>
                 <p i18n>Please, select a pack to manage its licenses</p>
               </div>
               <div class="panel panel-default" ng-if="currentPack">
                   <div class="panel-heading">
                       <span i18n>Licenses for pack: </span>{{currentPack.code}} 
                       <span style="color: lightgreen;" class="badge pull-right" ng-bind="currentPack.lic_available || 0"></span>
                       <span class="badge pull-right" ng-bind="licenses.length || 0"></span>
                   </div>
                   
               
                   <table class="table table-hover table-condensed" >
                   <thead>
                       <tr>
                           <th i18n >License code</th>
                           <th i18n >User fullname</th>
                           <th i18n >Email</th>
                           <th i18n >Status</th>
                           <th></th>
                       </tr>
                   </thead>
                   <tbody>
                       <tr ng-repeat="lic in licenses | filter:searchLicenseText" ng-dblclick="editLicense(lic)" >
                           <td style="white-space: nowrap;" ng-bind="lic.code"></td>
                           <td ng-bind="ellipsis(lic.user_fullname, 20)" title="{{lic.user_fullname}}" ></td>
                           <td ng-bind="ellipsis(lic.user_email, 30)" title="{{lic.user_email}}" ></td>
                           <td ng-bind="lic.status"></td>
                           <td>
                           <div class="dropdown">
                               <a class="dropdown-toggle" data-toggle="dropdown" >
                                 <span class="glyphicon glyphicon-align-justify"></span> <span class="caret"></span>
                               </a>
                               <ul class="dropdown-menu">
                                 <li><a ng-click="editLicense(lic)"><span class="glyphicon glyphicon-pencil"></span> <span i18n>Edit</span></a></li>
                                 <li><a ng-click="activateLicense(lic)"><span class="glyphicon glyphicon-check"></span> <span i18n>Activate</span></a></li>
                                 <li><a ng-click="sendEmail(lic)"><span class="glyphicon glyphicon-send"></span> <span i18n>Send email</span></a></li>
                                 <li><a ng-click="editLicense(lic)"><span class="glyphicon glyphicon-remove"></span> <span i18n>Remove</span></a></li>
                               </ul>
                             </div>
                           </td>
                       </tr>
                   </tbody>
                   <tfoot>
                   </tfoot>
               </table>
           </div>
       
       </div>
   </div>