v1.18.x
psychobunny 11 years ago
parent 58580bd866
commit 7be16eab06

@ -269,22 +269,21 @@ define(['uploader'], function(uploader) {
// User Groups and privileges // User Groups and privileges
socket.emit('api:admin.categories.groupsearch', cid, function(err, results) { socket.emit('api:admin.categories.groupsearch', cid, function(err, results) {
var groupsFrag = document.createDocumentFragment(), var groupsFrag = document.createDocumentFragment(),
liEl = document.createElement('li'); trEl = document.createElement('tr');
var numResults = results.length, var numResults = results.length,
resultObj; resultObj;
for(var x=0;x<numResults;x++) { for(var x=0;x<numResults;x++) {
resultObj = results[x]; resultObj = results[x];
liEl.setAttribute('data-gid', resultObj.gid); trEl.setAttribute('data-gid', resultObj.gid);
liEl.innerHTML = '<div class="pull-right">' + trEl.innerHTML = '<td><h4>' + resultObj.name + '</h4></td><td>' +
'<div class="btn-group">' + '<div class="btn-group pull-right">' +
'<button type="button" data-gpriv="+gr" class="btn btn-default' + (resultObj.privileges['+gr'] ? ' active' : '') + '">Read</button>' + '<button type="button" data-gpriv="+gr" class="btn btn-default' + (resultObj.privileges['+gr'] ? ' active' : '') + '">Read</button>' +
'<button type="button" data-gpriv="+gw" class="btn btn-default' + (resultObj.privileges['+gw'] ? ' active' : '') + '">Write</button>' + '<button type="button" data-gpriv="+gw" class="btn btn-default' + (resultObj.privileges['+gw'] ? ' active' : '') + '">Write</button>' +
'</div>' + '</div>' +
'</div>' + '</td>';
' '+resultObj.name;
groupsFrag.appendChild(liEl.cloneNode(true)); groupsFrag.appendChild(trEl.cloneNode(true));
} }
groupsResultsEl.html(groupsFrag); groupsResultsEl.html(groupsFrag);

@ -175,12 +175,15 @@
</div> </div>
</form> </form>
<ul class="search-results"></ul> <ul class="search-results"></ul>
<hr />
<form role="form"> <form role="form">
<div class="form-group"> <div class="form-group">
<label for="permission-group-pick">User Groups</label> <label for="permission-group-pick">User Groups</label>
</div> </div>
</form> </form>
<ul class="groups-results"></ul> <table class="table table-striped groups-results"></table>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save