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 />
 
@@ -197,50 +197,74 @@ ${h.end_form()}
 
                                    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
 
@@ -124,97 +124,97 @@
 
			  </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>";	
0 comments (0 inline, 0 general)