Changeset - c52de8aa10e0
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2011-03-09 22:58:43
marcin@python-works.com
template fixes
2 files changed with 27 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/admin/users_groups/users_group_edit.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Edit users group')} ${c.users_group.users_group_name} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(_('Admin'),h.url('admin_home'))} 
 
    &raquo; 
 
    ${h.link_to(_('UsersGroups'),h.url('users_groups'))} 
 
    &raquo;
 
    ${_('edit')} "${c.users_group.users_group_name}"
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('admin')}
 
</%def>
 

	
 
<%def name="main()">
 
<div class="box">
 
<div class="box box-left">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}       
 
    </div>
 
    <!-- end box / title -->
 
    ${h.form(url('users_group', id=c.users_group.users_group_id),method='put', id='edit_users_group')}
 
    <div class="form">
 
        <!-- fields -->
 
	        <div class="fields">
 
	             <div class="field">
 
	                <div class="label">
 
	                    <label for="users_group_name">${_('Group name')}:</label>
 
	                </div>
 
	                <div class="input">
 
	                    ${h.text('users_group_name',class_='small')}
 
	                </div>
 
	             </div>
 
	            
 
	             <div class="field">
 
	                <div class="label label-checkbox">
 
	                    <label for="users_group_active">${_('Active')}:</label>
 
	                </div>
 
	                <div class="checkboxes">
 
	                    ${h.checkbox('users_group_active',value=True)}
 
	                </div>
 
	             </div>
 
	            <div class="field">
 
                    <div class="label">
 
                        <label for="users_group_active">${_('Members')}:</label>
 
                    </div>
 
                    <div class="select">
 
	                    <table> 
 
	                            <tr>
 
	                                <td>
 
	                                    <div>
 
	                                        <div style="float:left">
 
	                                            <div class="text" style="padding: 0px 0px 6px;">${_('Choosen group members')}</div>
 
	                                            ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,style="min-width:210px")}
 
	                                           <div  id="remove_all_elements" style="cursor:pointer;text-align:center">
 
	                                               ${_('Remove all elements')}
 
	                                               <img alt="remove" style="vertical-align:text-bottom" src="${h.url("/images/icons/arrow_right.png")}"/>
 
	                                           </div>
 
	                                        </div>
 
	                                        <div style="float:left;width:20px;padding-top:50px">
 
	                                            <img alt="add" id="add_element" 
 
	                                                style="padding:2px;cursor:pointer" 
 
	                                                src="${h.url("/images/icons/arrow_left.png")}"/>
 
	                                            <br />
 
	                                            <img alt="remove" id="remove_element" 
 
	                                                style="padding:2px;cursor:pointer" 
 
	                                                src="${h.url("/images/icons/arrow_right.png")}"/>
 
	                                        </div>
 
	                                        <div style="float:left">
 
	                                             <div class="text" style="padding: 0px 0px 6px;">${_('Available members')}</div>
 
	                                             ${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="${h.url("/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){
 
@@ -149,98 +149,122 @@ ${h.end_form()}
 
	            }
 
	            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)
 
                        }
 
                    }                    
 
                    
 
                    return [sel_cache,oth_cache]
 
                }
 
                
 
                //fill the field with given options
 
                function fill_with(field,options){
 
                	//clear firtst
 
                	field.options.length=0;
 
                    for(var i = 0;node = options[i];i++){
 
                            field.options[i]=new Option(node.text, node.value, 
 
                                    false, false);
 
                    }
 
                	
 
                }
 
                //adds to current field
 
                function add_to(field,options){
 
                    for(var i = 0;node = options[i];i++){
 
                            field.appendChild(new Option(node.text, node.value, 
 
                                    false, false));
 
                    }
 
                }
 
                
 
                // add action
 
                if (this.id=='add_element'){
 
                    var c = get_checked(available);
 
                    add_to(choosen,c[0]);
 
                    fill_with(available,c[1]);
 
                }
 
                // remove action
 
                if (this.id=='remove_element'){
 
                    var c = get_checked(choosen);
 
                    add_to(available,c[0]);
 
                    fill_with(choosen,c[1]);             
 
                }                   
 
                // add all elements
 
                if(this.id=='add_all_elements'){
 
                    for(var i=0; node = available.options[i];i++){
 
                            choosen.appendChild(new Option(node.text, 
 
                                    node.value, false, false));
 
                    }
 
                    available.options.length = 0;
 
                }
 
                //remove all elements
 
                if(this.id=='remove_all_elements'){
 
                    for(var i=0; node = choosen.options[i];i++){
 
                        available.appendChild(new Option(node.text, 
 
                                node.value, false, false));
 
                    }
 
                    choosen.options.length = 0;                	
 
                }
 
                
 
            }
 
            
 
    
 
            E.addListener(['add_element','remove_element',
 
                           'add_all_elements','remove_all_elements'],'click',
 
                           prompts_action_callback)
 

	
 
            E.addListener(form_id,'submit',function(){
 
                var choosen = D.get(selected_container);
 
                for (var i = 0; i < choosen.options.length; i++) {
 
                    choosen.options[i].selected = 'selected';
 
                }
 
            })  
 
        });
 
</script>    
 

	
 
<div class="box box-right">
 
    <!-- box / title -->
 
    <div class="title">
 
        <h5>${_('Permissions')}</h5>       
 
    </div>
 
    ${h.form(url('user', id=''),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="fields">
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label for="">${_('Create repositories')}:</label>
 
                </div>
 
                <div class="checkboxes">
 
                    ${h.checkbox('create',value=True)}
 
                </div>
 
             </div>
 
            <div class="buttons">
 
              ${h.submit('save','Save',class_="ui-button")}
 
              ${h.reset('reset','Reset',class_="ui-button")}
 
            </div>             
 
        </div>    
 
    </div>
 
    ${h.end_form()}    
 
</div>
 
</%def>  
 
\ No newline at end of file
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -76,193 +76,193 @@
 
                        </a>
 
                        </span>					
 
					%endif		            		      
 
			  </div>
 
			 </div>
 
			
 
			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Description')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			      ${c.dbrepo.description}
 
			  </div>
 
			 </div>
 
			
 
			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Contact')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			  	<div class="gravatar">
 
			  		<img alt="gravatar" src="${h.gravatar_url(c.dbrepo.user.email)}"/>
 
			  	</div>
 
			  		${_('Username')}: ${c.dbrepo.user.username}<br/>
 
			  		${_('Name')}: ${c.dbrepo.user.name} ${c.dbrepo.user.lastname}<br/>
 
			  		${_('Email')}: <a href="mailto:${c.dbrepo.user.email}">${c.dbrepo.user.email}</a>
 
			  </div>
 
			 </div>
 
			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Last change')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			      ${h.age(c.repo.last_change)} - ${c.repo.last_change} 
 
			      ${_('by')} ${h.get_changeset_safe(c.repo,'tip').author} 
 
			      
 
			  </div>
 
			 </div>
 
			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Clone url')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			      <input type="text" id="clone_url" readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/>
 
			  </div>
 
			 </div>
 
			 
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Trending source files')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			    <div id="lang_stats"></div> 			   
 
			  </div>
 
			 </div>
 
			 			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Download')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
		        %if len(c.repo.revisions) == 0:
 
		          ${_('There are no downloads yet')}
 
		        %elif c.enable_downloads is False:
 
		          ${_('Downloads are disabled for this repository')}
 
                    %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
 
                        [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}]
 
                    %endif  		          
 
		        %else:
 
			        ${h.select('download_options',c.repo.get_changeset().raw_id,c.download_options)}
 
			        %for cnt,archive in enumerate(c.repo._get_archives()):
 
			             %if cnt >=1:
 
			             |
 
			             %endif
 
			             <span class="tooltip" title="${_('Download %s as %s') %('tip',archive['type'])}" 
 
			                  id="${archive['type']+'_link'}">${h.link_to(archive['type'],
 
			                h.url('files_archive_home',repo_name=c.repo.name,
 
			                fname='tip'+archive['extension']),class_="archive_icon")}</span>
 
			        %endfor
 
			    %endif
 
			  </div>
 
			 </div>
 
			 
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Feeds')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			   %if c.rhodecode_user.username != 'default':
 
	            ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo.name,api_key=c.rhodecode_user.api_key),class_='rss_icon')}
 
	            ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo.name,api_key=c.rhodecode_user.api_key),class_='atom_icon')}
 
	           %else:
 
                ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo.name,class_='rss_icon')}
 
                ${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo.name),class_='rss_icon')}
 
                ${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo.name),class_='atom_icon')}	           
 
	           %endif 
 
			  </div>
 
			 </div>				 			 			 
 
	  </div>		 
 
	</div>
 
  	<script type="text/javascript">
 
	  	YUE.onDOMReady(function(e){
 
	  	    id = 'clone_url';
 
	  	    YUE.on(id,'click',function(e){
 
	  	        YUD.get('clone_url').select();
 
	  	    })
 
	  	})
 
  		var data = ${c.trending_languages|n};
 
  		var total = 0;
 
  		var no_data = true;
 
  		for (k in data){
 
  		    total += data[k];
 
  		    no_data = false;
 
  		} 
 
		var tbl = document.createElement('table');
 
		tbl.setAttribute('class','trending_language_tbl');
 
		var cnt =0;
 
  		for (k in data){
 
  			cnt+=1;
 
  			var hide = cnt>2;
 
	  		var tr = document.createElement('tr');
 
	  		if (hide){
 
	  			tr.setAttribute('style','display:none');
 
	  			tr.setAttribute('class','stats_hidden');
 
	  		}
 
	  		var percentage = Math.round((data[k]/total*100),2);
 
			var value = data[k];
 
	  		var td1 = document.createElement('td');
 
	  		td1.width=150;
 
	  		var trending_language_label = document.createElement('div');
 
	  		trending_language_label.innerHTML = k;
 
	  		td1.appendChild(trending_language_label);
 

	
 
	  		var td2 = document.createElement('td');
 
	  		td2.setAttribute('style','padding-right:14px !important');
 
  		    var trending_language = document.createElement('div');
 
  		    var nr_files = value+" ${_('files')}";
 
  		    
 
  		    trending_language.title = k+" "+nr_files;
 
  		    
 
  		    if (percentage>20){
 
  		    	trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";	
 
  		    }
 
  		    else{
 
  		    	trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
 
  		    }
 
  		    
 
  		    trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
 
  		    trending_language.style.width=percentage+"%";
 
			td2.appendChild(trending_language);
 
			
 
			tr.appendChild(td1);
 
			tr.appendChild(td2);
 
  		    tbl.appendChild(tr);
 
  		    if(cnt == 2){
 
  		    	var show_more = document.createElement('tr');
 
  		    	var td=document.createElement('td');
 
  		    	lnk = document.createElement('a');
 
  		    	lnk.href='#';
 
  		    	lnk.innerHTML = "${_("show more")}";
 
  		    	lnk.id='code_stats_show_more';
 
  		        td.appendChild(lnk);
 
  		    	show_more.appendChild(td);
 
  		    	show_more.appendChild(document.createElement('td'));
 
  		    	tbl.appendChild(show_more);
 
  		    }
 
  		    
 
  		}
 
  		if(no_data){
 
  			var tr = document.createElement('tr');
 
  			var td1 = document.createElement('td');
 
  			td1.innerHTML = "${c.no_data_msg}";
 
  			tr.appendChild(td1);
 
  			tbl.appendChild(tr);
 
		}
 
  		YUD.get('lang_stats').appendChild(tbl);
 
  		YUE.on('code_stats_show_more','click',function(){
 
  			l = YUD.getElementsByClassName('stats_hidden')
 
  			for (e in l){
 
  			    YUD.setStyle(l[e],'display','');
 
  			};
 
  			YUD.setStyle(YUD.get('code_stats_show_more'),
 
  					'display','none');
 
  		})
 
  	
 
             
 
             YUE.on('download_options','change',function(e){
 
                 var new_cs = e.target.options[e.target.selectedIndex];
 
                 var tmpl_links = {}
 
                 %for cnt,archive in enumerate(c.repo._get_archives()):
0 comments (0 inline, 0 general)