add buttons to switch from users assigned role view to update view

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1227083 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-04 08:50:59 +00:00
parent f922429f2f
commit 25140af4f0
2 changed files with 26 additions and 10 deletions

View File

@ -67,6 +67,15 @@ $(function() {
}
);
}
this.updateMode=function(){
$("#main-content #role-list-users").hide();
$("#main-content #role-edit-users").show();
}
this.viewMode=function(){
$("#main-content #role-edit-users").hide();
$("#main-content #role-list-users").show();
}
}
/**

View File

@ -119,7 +119,7 @@
<div class="page-header">
<h3>${$.i18n.prop('role.edit.users.defined.in.current.role')}</h3>
</div>
<div id="role-list-users">
{{if $data.users}}
<ul>
{{each users}}
@ -130,7 +130,12 @@
${$.i18n.prop('role.edit.no.user.defined')}
{{/if}}
<div id="role-edit-users" class="clearfix ar-multiselect">
<button class="btn" data-bind="click:updateMode">${$.i18n.prop('role.update.mode')}</button>
</div>
<div id="role-edit-users" class="clearfix ar-multiselect" style="display:none">
<div class="ar-multiselect-column ar-multiselect-left">
<select data-bind="options: otherUsers ,optionsText: 'username',selectedOptions:selectedOtherUsers" multiple="true" id="role-edit-available-users"></select>
</div>
@ -144,6 +149,8 @@
<select data-bind="options: users ,optionsText: 'username',selectedOptions:selectedUsers" multiple="true" id="role-edit-affected-users"></select>
</div>
<button class="btn" data-bind="click: saveUsers">${$.i18n.prop('save')}</button>
<br/>
<button class="btn" data-bind="click:viewMode">${$.i18n.prop('role.view.mode')}</button>
</div>
</script>