mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 23:27:57 +01:00
#70: Init user profiles UI
This commit is contained in:
parent
ef3a592807
commit
6fbcd46a76
@ -484,7 +484,6 @@ public class UserResource extends BaseResource {
|
|||||||
if (!authenticate()) {
|
if (!authenticate()) {
|
||||||
throw new ForbiddenClientException();
|
throw new ForbiddenClientException();
|
||||||
}
|
}
|
||||||
checkBaseFunction(BaseFunction.ADMIN);
|
|
||||||
|
|
||||||
UserDao userDao = new UserDao();
|
UserDao userDao = new UserDao();
|
||||||
User user = userDao.getActiveByUsername(username);
|
User user = userDao.getActiveByUsername(username);
|
||||||
@ -519,7 +518,6 @@ public class UserResource extends BaseResource {
|
|||||||
if (!authenticate()) {
|
if (!authenticate()) {
|
||||||
throw new ForbiddenClientException();
|
throw new ForbiddenClientException();
|
||||||
}
|
}
|
||||||
checkBaseFunction(BaseFunction.ADMIN);
|
|
||||||
|
|
||||||
JsonArrayBuilder users = Json.createArrayBuilder();
|
JsonArrayBuilder users = Json.createArrayBuilder();
|
||||||
PaginatedList<UserDto> paginatedList = PaginatedLists.create(limit, offset);
|
PaginatedList<UserDto> paginatedList = PaginatedLists.create(limit, offset);
|
||||||
|
@ -216,6 +216,24 @@ angular.module('docs',
|
|||||||
controller: 'Login'
|
controller: 'Login'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.state('user', {
|
||||||
|
url: '/user',
|
||||||
|
views: {
|
||||||
|
'page': {
|
||||||
|
templateUrl: 'partial/docs/user.html',
|
||||||
|
controller: 'User'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('user.profile', {
|
||||||
|
url: '/:username',
|
||||||
|
views: {
|
||||||
|
'user': {
|
||||||
|
templateUrl: 'partial/docs/user.profile.html',
|
||||||
|
controller: 'UserProfile'
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Configuring Restangular
|
// Configuring Restangular
|
||||||
|
7
docs-web/src/main/webapp/src/app/docs/controller/User.js
Normal file
7
docs-web/src/main/webapp/src/app/docs/controller/User.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User controller.
|
||||||
|
*/
|
||||||
|
angular.module('docs').controller('User', function() {
|
||||||
|
});
|
@ -0,0 +1,11 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User profile controller.
|
||||||
|
*/
|
||||||
|
angular.module('docs').controller('UserProfile', function($stateParams, Restangular, $scope) {
|
||||||
|
// Load user
|
||||||
|
Restangular.one('user', $stateParams.username).get().then(function(data) {
|
||||||
|
$scope.user = data;
|
||||||
|
});
|
||||||
|
});
|
@ -61,6 +61,8 @@
|
|||||||
<script src="app/docs/controller/SettingsUser.js" type="text/javascript"></script>
|
<script src="app/docs/controller/SettingsUser.js" type="text/javascript"></script>
|
||||||
<script src="app/docs/controller/SettingsUserEdit.js" type="text/javascript"></script>
|
<script src="app/docs/controller/SettingsUserEdit.js" type="text/javascript"></script>
|
||||||
<script src="app/docs/controller/SettingsVocabulary.js" type="text/javascript"></script>
|
<script src="app/docs/controller/SettingsVocabulary.js" type="text/javascript"></script>
|
||||||
|
<script src="app/docs/controller/User.js" type="text/javascript"></script>
|
||||||
|
<script src="app/docs/controller/UserProfile.js" type="text/javascript"></script>
|
||||||
<script src="app/docs/service/User.js" type="text/javascript"></script>
|
<script src="app/docs/service/User.js" type="text/javascript"></script>
|
||||||
<script src="app/docs/service/Tag.js" type="text/javascript"></script>
|
<script src="app/docs/service/Tag.js" type="text/javascript"></script>
|
||||||
<script src="app/docs/filter/Newline.js" type="text/javascript"></script>
|
<script src="app/docs/filter/Newline.js" type="text/javascript"></script>
|
||||||
@ -104,6 +106,9 @@
|
|||||||
<li ng-class="{active: $uiRoute}" ui-route="/tag.*">
|
<li ng-class="{active: $uiRoute}" ui-route="/tag.*">
|
||||||
<a href="#/tag"><span class="glyphicon glyphicon-tags"></span> Tags</a>
|
<a href="#/tag"><span class="glyphicon glyphicon-tags"></span> Tags</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li ng-class="{active: $uiRoute}" ui-route="/user.*">
|
||||||
|
<a href="#/user"><span class="glyphicon glyphicon-user"></span> Users</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="nav navbar-nav navbar-right" ng-show="!userInfo.anonymous">
|
<ul class="nav navbar-nav navbar-right" ng-show="!userInfo.anonymous">
|
||||||
|
3
docs-web/src/main/webapp/src/partial/docs/user.html
Normal file
3
docs-web/src/main/webapp/src/partial/docs/user.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
User
|
||||||
|
|
||||||
|
<div ui-view="user"></div>
|
@ -0,0 +1 @@
|
|||||||
|
{{ user }}
|
Loading…
Reference in New Issue
Block a user