Changeset - eee3cb592099
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2011-06-24 16:00:12
marcin@python-works.com
Fixed issue with dashboard displaying count on repositories that you don't have permission
2 files changed with 7 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/home.py
Show inline comments
 
@@ -56,14 +56,10 @@ class HomeController(BaseController):
 

	
 
        sort_key = current_sort_slug + '_sort'
 

	
 

	
 
        c.repos_list = self.scm_model.get_repos(sort_key=sort_key)
 

	
 
        c.repo_cnt = len(c.repos_list)
 

	
 
        c.groups = Group.query().filter(Group.group_parent_id == None).all()
 

	
 

	
 
        return render('/index.html')
 

	
 
    def repo_switcher(self):
rhodecode/templates/index.html
Show inline comments
 
@@ -32,7 +32,7 @@
 
	                    id="q_filter" size="15" type="text" name="filter" 
 
	                    value="${_('quick filter...')}"/>
 
	        
 
	        ${_('Dashboard')}  - <span id="repo_count">${c.repo_cnt}</span> ${_('repositories')} 
 
	        ${_('Dashboard')}  - <span id="repo_count"></span> ${_('repositories')} 
 
	        </h5>
 
	        %if c.rhodecode_user.username != 'default':
 
		        %if h.HasPermissionAny('hg.admin','hg.create.repository')():
 
@@ -70,7 +70,7 @@
 
                      <td>${gr.group_description}</td>
 
                      <td><b>${gr.repositories.count()}</b></td>
 
                  </tr>
 
                % endfor            
 
                % endfor
 
                
 
            </table>
 
            <div style="height: 20px"></div>
 
@@ -176,12 +176,15 @@
 

	
 
     F.filterTimeout = null;
 
     
 
     //set initial count for repos
 
     var nodes = S.query('div.table tr td div a.repo_name');
 
     YUD.get('repo_count').innerHTML = nodes.length;
 
     F.updateFilter  = function() { 
 
    	// Reset timeout 
 
        F.filterTimeout = null;
 
    	
 
        var obsolete = [];
 
        var nodes = S.query('div.table tr td div a.repo_name');
 
        nodes = S.query('div.table tr td div a.repo_name');
 
        var req = q_filter.value.toLowerCase();
 
        for (n in nodes){
 
            D.setStyle(nodes[n].parentNode.parentNode.parentNode,'display','')
 
@@ -199,7 +202,7 @@
 
	        }
 
        }
 
        // set new count into dashboard
 
        YUD.get('repo_count').innerHTML = nodes.length - obsolete.length;        
 
        YUD.get('repo_count').innerHTML = nodes.length - obsolete.length;      
 
     }
 
     
 
     E.on(q_filter,'keyup',function(e){
0 comments (0 inline, 0 general)