mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Adapt result processing from user_list to it new behaviour
This commit is contained in:
parent
914256946f
commit
db77ebf401
2 changed files with 14 additions and 16 deletions
|
@ -1064,9 +1064,9 @@ app = Sammy('#main', function (sam) {
|
|||
// Display a list of available users
|
||||
if (v.name == 'admin' || data.manifest.arguments.install[k].type == 'user') {
|
||||
data.manifest.arguments.install[k].choices = [];
|
||||
$.each(params.users, function(key, user){
|
||||
$.each(params.users, function(username, user){
|
||||
data.manifest.arguments.install[k].choices.push({
|
||||
value: user.username,
|
||||
value: username,
|
||||
label: user.fullname+' ('+user.mail+')',
|
||||
selected: false
|
||||
});
|
||||
|
@ -1239,17 +1239,17 @@ app = Sammy('#main', function (sam) {
|
|||
|
||||
// Available users
|
||||
data.users = [];
|
||||
$.each(dataUsers.users, function(key, user){
|
||||
$.each(dataUsers.users, function(username, user){
|
||||
// Do not list allowed_users in select list
|
||||
if ( data.settings.allowed_users.indexOf(user.username) === -1 ) {
|
||||
if ( data.settings.allowed_users.indexOf(username) === -1 ) {
|
||||
data.users.push({
|
||||
value: user.username,
|
||||
value: username,
|
||||
label: user.fullname+' ('+user.mail+')'
|
||||
});
|
||||
} else {
|
||||
// Complete allowed_users data
|
||||
data.settings.allowed_users[data.settings.allowed_users.indexOf(user.username)] = {
|
||||
username: user.username,
|
||||
data.settings.allowed_users[data.settings.allowed_users.indexOf(username)] = {
|
||||
username: username,
|
||||
fullname: user.fullname,
|
||||
mail: user.mail,
|
||||
}
|
||||
|
|
|
@ -12,20 +12,18 @@
|
|||
<div class="separator"></div>
|
||||
|
||||
<div class="list-group">
|
||||
{{#users}}
|
||||
<a href="#/users/{{username}}" class="list-group-item slide clearfix">
|
||||
{{#each users}}
|
||||
<a href="#/users/{{@key}}" class="list-group-item slide clearfix">
|
||||
<span class="pull-right fa-chevron-right"></span>
|
||||
<h2 class="list-group-item-heading">{{username}} <small>{{fullname}}</small></h2>
|
||||
<h2 class="list-group-item-heading">{{@key}} <small>{{fullname}}</small></h2>
|
||||
<p class="list-group-item-text">{{mail}}</p>
|
||||
<p class="list-group-item-text">{{mailbox-quota}}</p>
|
||||
</a>
|
||||
{{/users}}
|
||||
|
||||
{{^users}}
|
||||
{{else}}
|
||||
<div class="alert alert-warning">
|
||||
<span class="fa-exclamation-triangle"></span>
|
||||
{{t 'users_no'}}
|
||||
</div>
|
||||
{{/users}}
|
||||
{{/each}}
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue