mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
Users viewing
This commit is contained in:
parent
f328aedccd
commit
990884137b
@ -45,6 +45,8 @@
|
|||||||
<script src="js/controller/SettingsAccount.js" type="text/javascript"></script>
|
<script src="js/controller/SettingsAccount.js" type="text/javascript"></script>
|
||||||
<script src="js/controller/SettingsSession.js" type="text/javascript"></script>
|
<script src="js/controller/SettingsSession.js" type="text/javascript"></script>
|
||||||
<script src="js/controller/SettingsLog.js" type="text/javascript"></script>
|
<script src="js/controller/SettingsLog.js" type="text/javascript"></script>
|
||||||
|
<script src="js/controller/SettingsUser.js" type="text/javascript"></script>
|
||||||
|
<script src="js/controller/SettingsUserEdit.js" type="text/javascript"></script>
|
||||||
<script src="js/service/User.js" type="text/javascript"></script>
|
<script src="js/service/User.js" type="text/javascript"></script>
|
||||||
<script src="js/service/Tag.js" type="text/javascript"></script>
|
<script src="js/service/Tag.js" type="text/javascript"></script>
|
||||||
<script src="js/filter/Newline.js" type="text/javascript"></script>
|
<script src="js/filter/Newline.js" type="text/javascript"></script>
|
||||||
|
@ -75,6 +75,24 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.state('settings.user', {
|
||||||
|
url: '/user',
|
||||||
|
views: {
|
||||||
|
'settings': {
|
||||||
|
templateUrl: 'partial/settings.user.html',
|
||||||
|
controller: 'SettingsUser'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('settings.user.edit', {
|
||||||
|
url: '/:username',
|
||||||
|
views: {
|
||||||
|
'user': {
|
||||||
|
templateUrl: 'partial/settings.user.edit.html',
|
||||||
|
controller: 'SettingsUserEdit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
.state('document', {
|
.state('document', {
|
||||||
url: '/document',
|
url: '/document',
|
||||||
abstract: true,
|
abstract: true,
|
||||||
|
18
docs-web/src/main/webapp/js/controller/SettingsUser.js
Normal file
18
docs-web/src/main/webapp/js/controller/SettingsUser.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Settings user page controller.
|
||||||
|
*/
|
||||||
|
App.controller('SettingsUser', function($scope, $state, Restangular) {
|
||||||
|
// Load users from server
|
||||||
|
Restangular.one('user/list').get({ limit: 100 }).then(function(data) {
|
||||||
|
$scope.users = data.users;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit a user.
|
||||||
|
*/
|
||||||
|
$scope.editUser = function(user) {
|
||||||
|
$state.transitionTo('settings.user.edit', { username: user.username });
|
||||||
|
};
|
||||||
|
});
|
@ -0,0 +1,8 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Settings user edition page controller.
|
||||||
|
*/
|
||||||
|
App.controller('SettingsUserEdit', function($scope, $stateParams, Restangular) {
|
||||||
|
$scope.user = Restangular.one('user', $stateParams.username).get();
|
||||||
|
});
|
@ -7,6 +7,7 @@
|
|||||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/session"><a href="#/settings/session">Opened sessions</a></li>
|
<li ng-class="{active: $uiRoute}" ui-route="/settings/session"><a href="#/settings/session">Opened sessions</a></li>
|
||||||
|
|
||||||
<li class="nav-header">General settings</li>
|
<li class="nav-header">General settings</li>
|
||||||
|
<li ng-class="{active: $uiRoute}" ui-route="/settings/user.*" ng-show="userInfo.base_functions.indexOf('ADMIN') != -1"><a href="#/settings/user">Users</a></li>
|
||||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/log"><a href="#/settings/log">Server logs</a></li>
|
<li ng-class="{active: $uiRoute}" ui-route="/settings/log"><a href="#/settings/log">Server logs</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
13
docs-web/src/main/webapp/partial/settings.user.edit.html
Normal file
13
docs-web/src/main/webapp/partial/settings.user.edit.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<h2>{{ user.username }}</h2>
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>E-mail</dt>
|
||||||
|
<dd>{{ user.email }}</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>Theme</dt>
|
||||||
|
<dd>{{ user.theme }}</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>Locale</dt>
|
||||||
|
<dd>{{ user.locale }}</dd>
|
||||||
|
</dl>
|
26
docs-web/src/main/webapp/partial/settings.user.html
Normal file
26
docs-web/src/main/webapp/partial/settings.user.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<h1>Users <small>management</small></h1>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span4 well">
|
||||||
|
<table class="table table-striped table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Username</th>
|
||||||
|
<th>Create date</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="user in users" ng-click="editUser(user)">
|
||||||
|
<td>{{ user.username }}</td>
|
||||||
|
<td>{{ user.create_date | date: 'yyyy-MM-dd' }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="span8">
|
||||||
|
<div ui-view="user"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user