From adebb7ff6d6dd84529b5fe0d47b2c9bc10e4e8aa Mon Sep 17 00:00:00 2001 From: jendib Date: Wed, 17 Feb 2016 00:28:48 +0100 Subject: [PATCH] #70: User profiles UI --- .../webapp/src/app/docs/controller/User.js | 11 +++++++- .../src/main/webapp/src/partial/docs/tag.html | 4 +-- .../main/webapp/src/partial/docs/user.html | 27 +++++++++++++++++-- .../webapp/src/partial/docs/user.profile.html | 7 ++++- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/docs-web/src/main/webapp/src/app/docs/controller/User.js b/docs-web/src/main/webapp/src/app/docs/controller/User.js index 085e13b4..77bec639 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/User.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/User.js @@ -3,5 +3,14 @@ /** * User controller. */ -angular.module('docs').controller('User', function() { +angular.module('docs').controller('User', function(Restangular, $scope, $state) { + // Load users + Restangular.one('user/list').get({ limit: 100 }).then(function(data) { + $scope.users = data.users; + }); + + // Open a user + $scope.openUser = function(user) { + $state.go('user.profile', { username: user.username }); + }; }); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/tag.html b/docs-web/src/main/webapp/src/partial/docs/tag.html index 37a9e7c9..733ab8ee 100644 --- a/docs-web/src/main/webapp/src/partial/docs/tag.html +++ b/docs-web/src/main/webapp/src/partial/docs/tag.html @@ -17,10 +17,10 @@

- +
- +
+

-
\ No newline at end of file + + + + + + +
+ + {{ user.username }} +
+ + + +
+
+
+ \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/user.profile.html b/docs-web/src/main/webapp/src/partial/docs/user.profile.html index 38f8db32..111467a9 100644 --- a/docs-web/src/main/webapp/src/partial/docs/user.profile.html +++ b/docs-web/src/main/webapp/src/partial/docs/user.profile.html @@ -1 +1,6 @@ -{{ user }} \ No newline at end of file + + +

Documents created by {{ user.username }}

+TODO \ No newline at end of file