Changeset - d1009f6bbc9c
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-02-11 15:25:29
marcin@python-works.com
small fix for users groups choose dialog
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/admin/users_groups/users_group_edit.html
Show inline comments
 
@@ -76,102 +76,102 @@
 
	                                             ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")}
 
	                                             <div id="add_all_elements" style="cursor:pointer;text-align:center">
 
	                                                   <img alt="add" style="vertical-align:text-bottom" src="/images/icons/arrow_left.png"/>
 
	                                                    ${_('Add all elements')}
 
	                                             </div>	                                        
 
	                                        </div>
 
	                                    </div>
 
	                                </td>           
 
	                            </tr>       
 
	                    </table>                    
 
                    </div>	            
 

	
 
                </div>			        
 
                <div class="buttons">
 
                  ${h.submit('save','save',class_="ui-button")}
 
                </div>             
 
            </div>          
 
    </div>        
 
${h.end_form()}        
 
</div>
 
    
 
<script type="text/javascript">
 
    YAHOO.util.Event.onDOMReady(function(){
 
            var D = YAHOO.util.Dom;
 
            var E = YAHOO.util.Event;
 
            
 
            //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
 
            c.options.length = 0;
 
            //c.options.length = 0;
 

	
 
            //fill it with remembered options
 
            for(var i = 0;node = cache[i];i++){
 
                c.options[i]=new Option(node.text, node.value, false, false);
 
            }
 
            //for(var i = 0;node = cache[i];i++){
 
            //   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);  
 
                var available = D.get(available_container);
 
                
 
                //get checked and unchecked options from field
 
                function get_checked(from_field){
 
                    //temp container for storage.
 
                    var sel_cache = new Array();
 
                    var oth_cache = new Array();
 
                    
 
                    for(var i = 0;node = from_field.options[i];i++){
 
                        if(node.selected){
 
                            //push selected fields :)
 
                            sel_cache.push(node);
 
                        }
 
                        else{
 
                        	oth_cache.push(node)
 
                        }
0 comments (0 inline, 0 general)