diff --git a/js/app.js b/js/app.js index e06eb10..2b48113 100644 --- a/js/app.js +++ b/js/app.js @@ -11,8 +11,6 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider data: { requiresLogin: false }, url: '/splash-page', templateUrl: '/templates/splash-page.html', - controller: 'loginCtrl', - controllerAs: 'vm' }) .state('app',{ data: { requiresLogin: true }, @@ -20,8 +18,6 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'header': { templateUrl: '/templates/partials/header.html', - controller: 'loginCtrl', - controllerAs: 'vm' }, 'menu': { templateUrl: '/templates/partials/menu.html' @@ -36,8 +32,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/home.html', - controller: 'loginCtrl', - controllerAs: 'vm' + controller: 'loginCtrl as vm' } } }) @@ -46,8 +41,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/bolt.html', - controller: 'boltCtrl', - controllerAs: 'vm' + controller: 'boltCtrl as vm', } } }) @@ -56,8 +50,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/files.html', - controller: 'fileCtrl', - controllerAs: 'vm' + controller: 'fileCtrl as vm', } } }) @@ -66,8 +59,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/contacts.html', - controller: 'contactCtrl', - controllerAs: 'vm' + controller: 'contactCtrl as vm', } } }) @@ -76,8 +68,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/music.html', - controller: 'musicCtrl', - controllerAs: 'vm' + controller: 'musicCtrl as vm', } } }) @@ -86,8 +77,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/email.html', - controller: 'emailCtrl', - controllerAs: 'vm' + controller: 'emailCtrl as vm', } } }) @@ -96,8 +86,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/website.html', - controller: 'websiteCtrl', - controllerAs: 'vm' + controller: 'websiteCtrl as vm', } } }) @@ -107,7 +96,6 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider 'content@': { templateUrl: 'templates/dns.html', controller: 'dnsCtrl', - controllerAs: 'vm' } } }) @@ -116,8 +104,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/account-settings.html', - controller: 'loginCtrl', - controllerAs: 'vm' + controller: 'loginCtrl as vm', } } }); diff --git a/js/controllers/login-controller.js b/js/controllers/login-controller.js index 18012b1..7f64d81 100644 --- a/js/controllers/login-controller.js +++ b/js/controllers/login-controller.js @@ -4,7 +4,6 @@ app.controller('loginCtrl', [ var vm = this; - vm.currentPath = $location.url().substr(1); vm.independentIssuer = false; vm.oauth3 = Oauth3.oauth3 = Oauth3.oauth3 || Oauth3.create(location); vm.timers = {}; @@ -124,9 +123,14 @@ app.controller('loginCtrl', [ vm.setIssuer(vm.defaultIssuer); vm.getSession = function() { + console.log('asdf'); return Auth.select(Auth.session); }; + $scope.$watch('vm.session', function (newValue, oldValue) { + vm.session = newValue; + }); + vm.initListLoggedInProfiles = function () { vm.activeProfiles = Auth.getActiveSessions(); }; @@ -153,4 +157,5 @@ app.controller('loginCtrl', [ }); }; + }]); diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index eeea18a..3911950 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -32,7 +32,7 @@ app.controller('websiteCtrl', [ return $q.all(Auth.sessions.map(function (session) { return Auth.select(session).then(function (oauth3) { - console.log('asdf'); + return oauth3.api(apiname, {}).then(function (collection) { if (collection.error) { diff --git a/templates/account-settings.html b/templates/account-settings.html index 1e0510c..0c41387 100644 --- a/templates/account-settings.html +++ b/templates/account-settings.html @@ -1,7 +1,5 @@ -

Account Settings

-
avatar @@ -9,7 +7,6 @@
-

Personal Info

diff --git a/templates/files.html b/templates/files.html index ecddc2d..2a2924d 100644 --- a/templates/files.html +++ b/templates/files.html @@ -44,7 +44,7 @@ --> - + {{ shared_artist }} December 23, 2016 @@ -61,7 +61,7 @@ --> - + {{ artist }} June 13, 2017 diff --git a/templates/home.html b/templates/home.html index 463c64c..66aed66 100644 --- a/templates/home.html +++ b/templates/home.html @@ -7,7 +7,7 @@
-
System Message > Jane Smith {{ vm.userName() }}
+
System Message > Jane Smith {{ vm.session }}

diff --git a/templates/partials/header.html b/templates/partials/header.html index fb4afac..35985f8 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -1,4 +1,4 @@ -