Roberto Sánchez
2014-01-17 04afd774aecc70dca37559fdd8b9a716829c18cd
securis/src/main/resources/static/js/licenses.js
....@@ -8,8 +8,87 @@
88 '$http',
99 'toaster',
1010 'Catalogs',
11
- function($scope, $http, toaster, Catalogs) {
11
+ '$store',
12
+ '$L',
13
+ function($scope, $http, toaster, Catalogs, $store, $L) {
14
+ $scope.currentPack = $store.get('currentPack');
15
+ $scope.packs = [
16
+ {id: 1,
17
+ "organization_name": "BP-Spain",
18
+ "application_name": "CurisIntegrity",
19
+ "licensetype_code": "CIBS",
20
+ "code": "BP-SA-0001",
21
+ "licenses": 50,
22
+ "lic_available": 23},
23
+ {id: 2,
24
+ "organization_name": "Exxon",
25
+ "application_name": "CurisData",
26
+ "licensetype_code": "CDL1",
27
+ "code": "EX-SA-0001",
28
+ "licenses": 1,
29
+ "lic_available": 0},
30
+ {id: 3,
31
+ "organization_name": "Repsol S.A. empresa con nombre muy largo",
32
+ "application_name": "CurisData",
33
+ "licensetype_code": "CDL2",
34
+ "code": "RE-SA-0001",
35
+ "licenses": 5,
36
+ "lic_available": 2},
37
+ {id: 4,
38
+ "organization_name": "BP-Spain",
39
+ "application_name": "CurisIntegrity v3.0",
40
+ "code": "BP-SA-0002",
41
+ "licensetype_code": "CISA",
42
+ "licenses": 150,
43
+ "lic_available": 13},
44
+ ];
1245
46
+ $scope.licenses = [
47
+ {id: 1,
48
+ "code": "BP-SA-001-AKSJMS234",
49
+ "user_fullname": "Johnny Belmonte",
50
+ "user_email": "jb@curisit.net",
51
+ "status": 3},
52
+ {id: 2,
53
+ "code": "BP-SA-001-KAJSDHAJS",
54
+ "user_fullname": "Walter Simons",
55
+ "user_email": "ws@curisit.net",
56
+ "status": 1},
57
+ {id: 3,
58
+ "code": "BP-SA-001-ASKDGHKA",
59
+ "user_fullname": "Frank Belmonte",
60
+ "user_email": "fb@curisit.net",
61
+ "status": 2},
62
+ {id: 4,
63
+ "code": "BP-SA-001-BBBGGGG",
64
+ "user_fullname": "John Dalton",
65
+ "user_email": "jd@curisit.net",
66
+ "status": 3},
67
+ {id: 5,
68
+ "code": "BP-SA-001-AKADNAJANA",
69
+ "user_fullname": "Walter Martins",
70
+ "user_email": "wm@curisit.net",
71
+ "status": 3},
72
+ {id: 6,
73
+ "code": "BP-SA-001-AKANDAKS",
74
+ "user_fullname": "Joe Bolton",
75
+ "user_email": "jbol@curisit.net",
76
+ "status": 2}
77
+ ];
78
+
79
+
80
+
81
+ $scope.ellipsis = function(txt, len) {
82
+ if (!txt || txt.length <= len) return txt;
83
+ return txt.substring(0, len) + '...';
84
+ }
85
+
86
+ $scope.selectPack = function(pack) {
87
+ console.log('Pack selected: ' + JSON.stringify(pack));
88
+ $scope.currentPack = pack;
89
+ $store.put('currentPack', pack);
90
+ }
91
+
1392 } ]);
1493
1594 })();