user roles edit display roles from templates/resources

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1230555 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-12 14:12:32 +00:00
parent 82e113d72f
commit 4812edab08
2 changed files with 34 additions and 2 deletions

View File

@ -206,4 +206,11 @@ mapStringArray=function(data){
}
}
return null;
}
}
// extends jquery tmpl to support var def
$.extend($.tmpl.tag, {
"var": {
open: "var $1;"
}
});

View File

@ -109,9 +109,34 @@
</blockquote>
<ul>
{{each $value.globalRoles}}
<li><div><input type="checkbox" value="${$value}" data-bind="checked: user.assignedRoles" />&nbsp;${$value}</div></li>
<li><input type="checkbox" value="${$value}" data-bind="checked: user.assignedRoles">&nbsp;${$value}</input></li>
{{/each}}
</ul>
{{if roleTemplates}}
<table class="bordered-table">
<thead>
<tr>
<th>&nbsp;</th>
{{each roleTemplates}}
<th>${$value.namePrefix}</th>
{{/each}}
</tr>
</thead>
<tbody>
{{each resources}}
{{var curResource = $value}}
<tr>
<td>${curResource}</td>
{{each roleTemplates}}
<td><input type="checkbox" value="${$value.namePrefix}${$value.delimiter}${curResource}" data-bind="checked: user.assignedRoles"/></td>
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
{{/if}}
{{/each}}
<button class="btn" data-bind="click:updateUserRoles">${$.i18n.prop('update')}</button>