Mercurial > kallithea
changeset 1030:6b37f08de732 beta
#56 available options from users groups are now self avare of choosen options and doesn't display.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 11 Feb 2011 13:07:26 +0100 |
parents | 3bf8898ce66d |
children | d1009f6bbc9c |
files | rhodecode/templates/admin/users_groups/users_group_edit.html |
diffstat | 1 files changed, 32 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/templates/admin/users_groups/users_group_edit.html Fri Feb 11 11:32:10 2011 +0100 +++ b/rhodecode/templates/admin/users_groups/users_group_edit.html Fri Feb 11 13:07:26 2011 +0100 @@ -102,19 +102,22 @@ //definition of containers ID's var available_container = 'available_members'; var selected_container = 'users_group_members'; + //form containing containers id var form_id = 'edit_users_group'; //temp container for selected storage. var cache = new Array(); + var av_cache = new Array(); var c = D.get(selected_container); + var ac = D.get(available_container); //get only selected options for further fullfilment for(var i = 0;node =c.options[i];i++){ if(node.selected){ //push selected to my temp storage left overs :) cache.push(node); - } + } } //clear 'selected' select @@ -125,6 +128,34 @@ c.options[i]=new Option(node.text, node.value, false, false); } + + //get all available options to cache + for(var i = 0;node =ac.options[i];i++){ + //push selected to my temp storage left overs :) + av_cache.push(node); + } + + //fill available only with those not in choosen + ac.options.length=0; + tmp_cache = new Array(); + + for(var i = 0;node = av_cache[i];i++){ + var add = true; + for(var i2 = 0;node_2 = cache[i2];i2++){ + if(node.value == node_2.value){ + add=false; + break; + } + } + if(add){ + tmp_cache.push(new Option(node.text, node.value, false, false)); + } + } + + for(var i = 0;node = tmp_cache[i];i++){ + ac.options[i] = node; + } + function prompts_action_callback(e){ var choosen = D.get(selected_container);