diff --git a/admin/tools/users.tool b/admin/tools/users.tool index 95f0bb891bb8d42d6763e8cdf7dc43188ce7b69d..3c162ffc143e5b14a2ce94670d6aa2fbcb76f15d 100644 --- a/admin/tools/users.tool +++ b/admin/tools/users.tool @@ -1,12 +1,12 @@ <div class="users-table-wrapper"> <div class="tools-full-height"> <table class="table table-hover users-table"> - <thead> - <tr> - </tr> - </thead> - <tbody> - </tbody> + <thead> + <tr> + </tr> + </thead> + <tbody> + </tbody> </table> </div> </div> @@ -15,6 +15,7 @@ .users-table-wrapper { position: relative; } + .users-table-wrapper>div { overflow: auto; } @@ -24,25 +25,37 @@ } </style> <script type="text/javascript"> + tools.ui.menu({ + 'Add User': { + callback: function(){ + console.log('noice'); + } + } + }); + var showInTable = ['firstname', 'lastname', 'email', 'membership']; - amivcore.users.GET({data:{'max_results':'50'}}, function(ret){ + amivcore.users.GET({ + data: { + 'max_results': '50' + } + }, function(ret) { - if(!ret || ret['_items'].length == 0){ + if (!ret || ret['_items'].length == 0) { tools.log('No Data', 'w'); return; } - showInTable.forEach(function(i){ - $('.users-table thead tr').append('<th>'+ i +'</th>'); + showInTable.forEach(function(i) { + $('.users-table thead tr').append('<th>' + i + '</th>'); }); - for(var n in ret['_items']){ + for (var n in ret['_items']) { var tmp = ''; - showInTable.forEach(function(i){ - tmp += '<td>'+ ret['_items'][n][i] +'</td>'; + showInTable.forEach(function(i) { + tmp += '<td>' + ret['_items'][n][i] + '</td>'; }); - $('.users-table tbody').append('<tr>'+tmp+'</tr>'); - //$('.users-table tbody').append('<tr><td>'+ret['_items'][n].firstname+'</td></tr>'); - } - }); + $('.users-table tbody').append('<tr>' + tmp + '</tr>'); + //$('.users-table tbody').append('<tr><td>'+ret['_items'][n].firstname+'</td></tr>'); + } + }); </script>