From eed7d2472d6610b9249c0c89514f3c037dbbed53 Mon Sep 17 00:00:00 2001
From: Mirco Nasuti <mirco.nasuti@chuv.ch>
Date: Fri, 5 Feb 2016 12:02:10 +0100
Subject: [PATCH] Fixed fullname bug + add authors views

---
 README.md                                     |  2 -
 .../scripts/app/profile/profile.controller.js | 18 ++++-----
 .../app/scripts/app/users/users.controller.js | 18 ++++-----
 .../app/scripts/app/users/users.module.js     | 40 +++++++++----------
 4 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/README.md b/README.md
index 9eba89a87..d60331bf3 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,6 @@ The API documentation is available at `<BASE URL>/swagger-ui.html`. A JSON versi
 ## TODO
 
 * Fix bugs;
-* Add author's view if needed;
 * Implement delete methods if needed;
 * Externalize configuration (DB parameters, security enabled/disabled, ...);
 * Implement SoapUI tests;
@@ -23,7 +22,6 @@ The API documentation is available at `<BASE URL>/swagger-ui.html`. A JSON versi
 
 ## BUGS
 
-* In the profile view, we shouldn't see the '+' between firstname and lastname;
 * Export PDF;
 
 ### Maintenance
diff --git a/src/main/resources/static/frontend/app/scripts/app/profile/profile.controller.js b/src/main/resources/static/frontend/app/scripts/app/profile/profile.controller.js
index b4b5011c0..db3d879f0 100644
--- a/src/main/resources/static/frontend/app/scripts/app/profile/profile.controller.js
+++ b/src/main/resources/static/frontend/app/scripts/app/profile/profile.controller.js
@@ -1,9 +1,9 @@
-/**
- * Created by Michael DESIGAUD on 09/09/2015.
- */
-angular.module('chuvApp.profile').controller('ProfileController', ['$scope', '$translatePartialLoader', '$translate', '$stateParams','User',
-  function ($scope, $translatePartialLoader, $translate, $stateParams, User) {
-
-    $scope.user = User.current();
-
-}]);
+/**
+ * Created by Michael DESIGAUD on 09/09/2015.
+ */
+angular.module('chuvApp.profile').controller('ProfileController', ['$scope', '$translatePartialLoader', '$translate', '$stateParams','User','$http',
+  function ($scope, $translatePartialLoader, $translate, $stateParams, User, $http) {
+
+    $http.get("/users/"+User.current().username).success(function(data) {$scope.user = data;});
+
+}]);
diff --git a/src/main/resources/static/frontend/app/scripts/app/users/users.controller.js b/src/main/resources/static/frontend/app/scripts/app/users/users.controller.js
index de1c4fb76..5fdc12e00 100644
--- a/src/main/resources/static/frontend/app/scripts/app/users/users.controller.js
+++ b/src/main/resources/static/frontend/app/scripts/app/users/users.controller.js
@@ -1,9 +1,9 @@
-/**
- * Created by Michael DESIGAUD on 09/09/2015.
- */
-angular.module('chuvApp.users').controller('UserController', ['$scope', '$translatePartialLoader', '$translate', '$stateParams','User',
-  function ($scope, $translatePartialLoader, $translate, $stateParams, User) {
-
-    $scope.user = User.get($stateParams.login);
-
-}]);
+/**
+ * Created by Michael DESIGAUD on 09/09/2015.
+ */
+angular.module('chuvApp.users').controller('UserController', ['$scope', '$translatePartialLoader', '$translate', '$stateParams','User','$http',
+  function ($scope, $translatePartialLoader, $translate, $stateParams, User, $http) {
+
+    $http.get("/users/"+$stateParams.username).success(function(data) {$scope.user = data;});
+
+}]);
diff --git a/src/main/resources/static/frontend/app/scripts/app/users/users.module.js b/src/main/resources/static/frontend/app/scripts/app/users/users.module.js
index 75439ff93..bdf4ff003 100644
--- a/src/main/resources/static/frontend/app/scripts/app/users/users.module.js
+++ b/src/main/resources/static/frontend/app/scripts/app/users/users.module.js
@@ -1,20 +1,20 @@
-/**
- * Created by Florent PERINEL on 14/08/2015.
- */
-'use strict';
-
-angular.module('chuvApp.users',
-
-  // Module requirements
-  ['ngResource', 'pascalprecht.translate', 'ui.router'])
-
-  // Module configuration
-  .config(['$stateProvider', function ($stateProvider) {
-    $stateProvider
-      .state('user-show', {
-        url: '/users/:login',
-        templateUrl: 'scripts/app/profile/profile.html',
-        controller: 'UserController'
-      })
-  }]);
-
+/**
+ * Created by Florent PERINEL on 14/08/2015.
+ */
+'use strict';
+
+angular.module('chuvApp.users',
+
+  // Module requirements
+  ['ngResource', 'pascalprecht.translate', 'ui.router'])
+
+  // Module configuration
+  .config(['$stateProvider', function ($stateProvider) {
+    $stateProvider
+      .state('user-show', {
+        url: '/users/:username',
+        templateUrl: 'scripts/app/profile/profile.html',
+        controller: 'UserController'
+      })
+  }]);
+
-- 
GitLab