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
|
// Display a list of available users
|
||||||
if (v.name == 'admin' || data.manifest.arguments.install[k].type == 'user') {
|
if (v.name == 'admin' || data.manifest.arguments.install[k].type == 'user') {
|
||||||
data.manifest.arguments.install[k].choices = [];
|
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({
|
data.manifest.arguments.install[k].choices.push({
|
||||||
value: user.username,
|
value: username,
|
||||||
label: user.fullname+' ('+user.mail+')',
|
label: user.fullname+' ('+user.mail+')',
|
||||||
selected: false
|
selected: false
|
||||||
});
|
});
|
||||||
|
@ -1239,17 +1239,17 @@ app = Sammy('#main', function (sam) {
|
||||||
|
|
||||||
// Available users
|
// Available users
|
||||||
data.users = [];
|
data.users = [];
|
||||||
$.each(dataUsers.users, function(key, user){
|
$.each(dataUsers.users, function(username, user){
|
||||||
// Do not list allowed_users in select list
|
// 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({
|
data.users.push({
|
||||||
value: user.username,
|
value: username,
|
||||||
label: user.fullname+' ('+user.mail+')'
|
label: user.fullname+' ('+user.mail+')'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Complete allowed_users data
|
// Complete allowed_users data
|
||||||
data.settings.allowed_users[data.settings.allowed_users.indexOf(user.username)] = {
|
data.settings.allowed_users[data.settings.allowed_users.indexOf(username)] = {
|
||||||
username: user.username,
|
username: username,
|
||||||
fullname: user.fullname,
|
fullname: user.fullname,
|
||||||
mail: user.mail,
|
mail: user.mail,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,29 @@
|
||||||
<div class="btn-breadcrumb">
|
<div class="btn-breadcrumb">
|
||||||
<a href="#/"><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
|
<a href="#/"><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
|
||||||
<a href="#/users" class="btn btn-default">{{t 'users'}}</a>
|
<a href="#/users" class="btn btn-default">{{t 'users'}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions-group">
|
<div class="actions-group">
|
||||||
<a href="#/users/create" class="btn btn-success slide">
|
<a href="#/users/create" class="btn btn-success slide">
|
||||||
<span class="fa-plus"></span> {{t 'users_new'}}
|
<span class="fa-plus"></span> {{t 'users_new'}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
|
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{{#users}}
|
{{#each users}}
|
||||||
<a href="#/users/{{username}}" class="list-group-item slide clearfix">
|
<a href="#/users/{{@key}}" class="list-group-item slide clearfix">
|
||||||
<span class="pull-right fa-chevron-right"></span>
|
<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">{{mail}}</p>
|
||||||
<p class="list-group-item-text">{{mailbox-quota}}</p>
|
<p class="list-group-item-text">{{mailbox-quota}}</p>
|
||||||
</a>
|
</a>
|
||||||
{{/users}}
|
{{else}}
|
||||||
|
|
||||||
{{^users}}
|
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
<span class="fa-exclamation-triangle"></span>
|
<span class="fa-exclamation-triangle"></span>
|
||||||
{{t 'users_no'}}
|
{{t 'users_no'}}
|
||||||
</div>
|
</div>
|
||||||
{{/users}}
|
{{/each}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue