From 04afd774aecc70dca37559fdd8b9a716829c18cd Mon Sep 17 00:00:00 2001
From: Roberto Sánchez <roberto.sanchez@curisit.net>
Date: Fri, 17 Jan 2014 12:27:16 +0000
Subject: [PATCH] #396 feature - Added LocalStorage support and http interceptor for unauthorized access

---
 securis/src/main/resources/static/js/licenses.js |   81 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 1 deletions(-)

diff --git a/securis/src/main/resources/static/js/licenses.js b/securis/src/main/resources/static/js/licenses.js
index 286500f..3db4b48 100644
--- a/securis/src/main/resources/static/js/licenses.js
+++ b/securis/src/main/resources/static/js/licenses.js
@@ -8,8 +8,87 @@
 			'$http',
 			'toaster',
 			'Catalogs',
-			function($scope, $http, toaster, Catalogs) {
+			'$store',
+			'$L',
+			function($scope, $http, toaster, Catalogs, $store, $L) {
+				$scope.currentPack = $store.get('currentPack');
+				$scope.packs = [
+				                {id: 1,
+				                	"organization_name": "BP-Spain",
+				                	"application_name": "CurisIntegrity",
+				                	"licensetype_code": "CIBS",
+				                	"code": "BP-SA-0001",
+				                	"licenses": 50,
+				                	"lic_available": 23},
+				                {id: 2,
+				                	"organization_name": "Exxon",
+				                	"application_name": "CurisData",
+				                	"licensetype_code": "CDL1",
+				                	"code": "EX-SA-0001",
+				                	"licenses": 1,
+				                	"lic_available": 0},
+				                {id: 3,
+				                	"organization_name": "Repsol S.A. empresa con nombre muy largo",
+				                	"application_name": "CurisData",
+				                	"licensetype_code": "CDL2",
+				                	"code": "RE-SA-0001",
+				                	"licenses": 5,
+				                	"lic_available": 2},
+				                {id: 4,
+				                	"organization_name": "BP-Spain",
+				                	"application_name": "CurisIntegrity v3.0",
+				                	"code": "BP-SA-0002",
+				                	"licensetype_code": "CISA",
+				                	"licenses": 150,
+				                	"lic_available": 13},
+				                ];
 
+				$scope.licenses = [
+				                {id: 1,
+				                	"code": "BP-SA-001-AKSJMS234",
+				                	"user_fullname": "Johnny Belmonte",
+				                	"user_email": "jb@curisit.net",
+				                	"status": 3},
+					                {id: 2,
+					                	"code": "BP-SA-001-KAJSDHAJS",
+					                	"user_fullname": "Walter Simons",
+					                	"user_email": "ws@curisit.net",
+					                	"status": 1},
+					                {id: 3,
+					                	"code": "BP-SA-001-ASKDGHKA",
+					                	"user_fullname": "Frank Belmonte",
+					                	"user_email": "fb@curisit.net",
+					                	"status": 2},
+						                {id: 4,
+						                	"code": "BP-SA-001-BBBGGGG",
+						                	"user_fullname": "John Dalton",
+						                	"user_email": "jd@curisit.net",
+						                	"status": 3},
+						                {id: 5,
+						                	"code": "BP-SA-001-AKADNAJANA",
+						                	"user_fullname": "Walter Martins",
+						                	"user_email": "wm@curisit.net",
+						                	"status": 3},
+						                {id: 6,
+						                	"code": "BP-SA-001-AKANDAKS",
+						                	"user_fullname": "Joe Bolton",
+						                	"user_email": "jbol@curisit.net",
+						                	"status": 2}
+				                ];
+				
+
+				
+				$scope.ellipsis = function(txt, len) {
+					if (!txt || txt.length <= len) return txt;
+					return txt.substring(0, len) + '...';
+				}
+				
+				$scope.selectPack = function(pack) {
+					console.log('Pack selected: ' + JSON.stringify(pack));
+					$scope.currentPack = pack;
+					$store.put('currentPack', pack);
+				}
+				
 			} ]);
 
 })();

--
Gitblit v1.3.2