From 63eae631d6af59d4ee6a52ea597b0309ea8a95cd Mon Sep 17 00:00:00 2001
From: CupCakeArmy <nicco.borgioli@gmail.com>
Date: Fri, 22 Apr 2016 12:27:47 +0200
Subject: [PATCH] Fixes

---
 admin/tools/users.tool | 47 +++++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/admin/tools/users.tool b/admin/tools/users.tool
index 95f0bb8..3c162ff 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>
-- 
GitLab