From cd10ee2e0a9a6c66843fc0dbc2c9dcd79ed9065b Mon Sep 17 00:00:00 2001 From: Athou Date: Wed, 1 May 2013 16:21:52 +0200 Subject: [PATCH] open settings and profile on the feeds page --- src/main/webapp/js/controllers.js | 4 ++-- src/main/webapp/js/main.js | 22 ++++++++++------------ src/main/webapp/templates/profile.html | 8 +++++++- src/main/webapp/templates/settings.html | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 2740060e..3f2ab2a3 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -410,10 +410,10 @@ function($scope, $http, $state, $stateParams, $route, $location, $location.path('admin'); }; $scope.toSettings = function() { - $location.path('settings'); + $state.transitionTo('feeds.settings'); }; $scope.toProfile = function() { - $location.path('profile'); + $state.transitionTo('feeds.profile'); }; $scope.toHelp = function() { $state.transitionTo('feeds.help'); diff --git a/src/main/webapp/js/main.js b/src/main/webapp/js/main.js index 05827708..4140d0b8 100644 --- a/src/main/webapp/js/main.js +++ b/src/main/webapp/js/main.js @@ -39,6 +39,16 @@ app.config([ '$routeProvider', '$stateProvider', '$urlRouterProvider', templateUrl : 'templates/feeds.help.html', controller : trackCtrl }); + $stateProvider.state('feeds.settings', { + url : '/settings', + templateUrl : 'templates/settings.html', + controller : 'SettingsCtrl' + }); + $stateProvider.state('feeds.profile', { + url : '/profile', + templateUrl : 'templates/profile.html', + controller : 'ProfileCtrl' + }); $stateProvider.state('admin', { 'abstract' : true, @@ -66,18 +76,6 @@ app.config([ '$routeProvider', '$stateProvider', '$urlRouterProvider', controller : 'ManageSettingsCtrl' }); - $stateProvider.state('settings', { - url : '/settings', - templateUrl : 'templates/settings.html', - controller : 'SettingsCtrl' - }); - - $stateProvider.state('profile', { - url : '/profile', - templateUrl : 'templates/profile.html', - controller : 'ProfileCtrl' - }); - $urlRouterProvider.when('/', '/feeds/view/category/all'); $urlRouterProvider.when('/admin', '/admin/settings'); $urlRouterProvider.otherwise('/'); diff --git a/src/main/webapp/templates/profile.html b/src/main/webapp/templates/profile.html index f2e63c6a..fb5a2075 100644 --- a/src/main/webapp/templates/profile.html +++ b/src/main/webapp/templates/profile.html @@ -1,8 +1,14 @@ -
+
+
+ +
+ {{user.name}} +
+
diff --git a/src/main/webapp/templates/settings.html b/src/main/webapp/templates/settings.html index 58346653..4e257850 100644 --- a/src/main/webapp/templates/settings.html +++ b/src/main/webapp/templates/settings.html @@ -1,4 +1,4 @@ -
+