From 67d9dc40c216b538b97a3bb7564d50813868fc40 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 23 Dec 2016 17:38:00 +0530 Subject: [PATCH] login and other html are on same page. used ng-show. error in modules showing. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js | 17 ++++++++++++++++- 400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html | 4 +++- 400-SOURCECODE/AIAHTML5.Web/index.html | 994 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4 files changed, 565 insertions(+), 529 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 4016108..caf6656 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -1,7 +1,7 @@ 'use strict'; -AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", - function ($rootScope, Modules, $log, $location, $timeout, DataService) { +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService","AuthenticationService", +function ($rootScope, Modules, $log, $location, $timeout, DataService,AuthenticationService) { //$scope.pageToOpen = { // name: 'MainMenu' @@ -65,6 +65,81 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.isEraseToolSelected = false; $rootScope.isMousedownOnPaintCanvas = false; + $rootScope.initializeAIA = function () { + $rootScope.isLoading = false; + $rootScope.isVisibleLogin = true; + $rootScope.isVisibleIndex = false; + + } + + $rootScope.userInfo = { + username: null, + password: null + }; + + $rootScope.AuthenticateUser = function (userInfo) { + AuthenticationService.authenticateUser(userInfo) + .then( + + function (result) { + + if (result.length > 0) { + angular.forEach(result, function (value, key) { + + if (value.Name == "modules") { + $rootScope.modules = value.Value; + var moduleList = [] + angular.forEach($rootScope.modules, function (value, key) { + + + moduleList.push( + + { + + "ModuleName": value[0].Value, + "ModuleSlug": value[1].Value + + } + + ); + }); + localStorage.setItem("modules", moduleList); + + // $scope.name = "HELLO"; + $rootScope.isVisibleLogin = false; + $rootScope.isVisibleIndex = true; + // $location.url('/index.html') + // $window.location.assign('/index.html'); + + } + + + + // if ((value._id == 1) + }) + } + //alert('user authentication = ' + result) + }, + function (error) { + // handle errors here + console.log(' $rootScope.BodyLayerData= ' + error.statusText); + }); + //.success(function (data) { + + // alert('user authentication= '+data) + + // }) + // .error(function () { + // alert('issue in authentocation') + // }) + } + + + $rootScope.showModules = function () { + $scope.modules = localStorage.getItem("modules"); + + } + $rootScope.$on("$locationChangeSuccess", function () { if (($location.url() == "/da-body-view") || ($location.url() == "/clinical-illustrations-detail") || ($location.url() == "/clinical-animations-detail")) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js index 7860ce4..aa044cd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js @@ -19,7 +19,22 @@ function ($scope, $rootScope,$location, $window, AuthenticationService) { if (value.Name == "modules") { $scope.modules = value.Value; - localStorage.setItem("modules", value.Value); + var moduleList = [] + angular.forEach($scope.modules, function (value, key) { + + + moduleList.push( + + { + + "ModuleName": value[0].Value, + "ModuleSlug": value[1].Value + + } + + ); + }); + localStorage.setItem("modules", moduleList); $scope.name = "HELLO"; // $location.url('/index.html') diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html index de1c4e1..1c9fb88 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html @@ -25,7 +25,7 @@ - > + + - -