diff --git a/static/moderator.js b/static/moderator.js index b6907c9945aab05fd7acab0946e2be53c60afc42..5b96afb355860c39de62581e3a891a6eb02a0029 100644 --- a/static/moderator.js +++ b/static/moderator.js @@ -129,11 +129,32 @@ var moderator = { perm.param2 = moderator.acleditor.acls[i]['param2']; perm.id = moderator.acleditor.acls[i]['id']; idlist[idlist.length] = perm.id; - html += '<option data-auth_id="'+perm.id+'">#'+perm.id+' '+perm.type+' '+ ( perm.type == "password" ? ' ("'+perm.param1+'":"'+perm.param2+'")' : '' ) +'</option>'; + + permstring = ''; + switch (perm.type) { + case 'password': + permstring = ' ("'+perm.param1+'":"'+perm.param2+'")' + break; + case 'public': + permstring = ''; + break; + case 'rwth': + permstring = ' ( rwth intern ) ' + break; + case 'l2p': + permstring = ' ( ' + perm.param1 + ' ) ' + break; + } + html += '<option data-auth_id="'+perm.id+'">#'+perm.id+' '+perm.type+' '+ permstring +'</option>'; } } html += '</select>'; - html += '<select class="col-xs-12 authtype" onchange="moderator.acleditor.acltypechange(this)"><option value="public">public</option><option selected value="password">password</option></select>'; + html += '<select class="col-xs-12 authtype" onchange="moderator.acleditor.acltypechange(this)">'; + html += '<option value="public">Öffentlich</option>'; + html += '<option selected value="password">Password</option>'; + html += '<option value="rwth">RWTH intern</option>'; + html += '<option value="l2p">L2P Lernraum</option>'; + html += '</select>'; html += '<input class="col-xs-12 passwordinput authuser" type="text" placeholder="username">'; html += '<input class="col-xs-12 passwordinput authpassword" type="text" placeholder="password">'; html += '<button class="col-xs-6" onclick="moderator.acleditor.addbtnclick(this)">Add</button>'; @@ -149,7 +170,7 @@ var moderator = { }, delbtnclick: function (element) { - moderator.api.set("perm."+$(".acllist option:selected", element.parentElement).data('id')+".deleted",1,true); + moderator.api.set("perm."+$(".acllist option:selected", element.parentElement).data('auth_id')+".deleted",1,true); }, addbtnclick: function (element) { var perm = {};