Mercurial > kallithea
changeset 1395:eee3cb592099 beta
Fixed issue with dashboard displaying count on repositories that you don't have permission
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 24 Jun 2011 16:00:12 +0200 |
parents | 416dacac46bf |
children | 069ee86e85ad |
files | rhodecode/controllers/home.py rhodecode/templates/index.html |
diffstat | 2 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/controllers/home.py Thu Jun 23 23:41:14 2011 +0200 +++ b/rhodecode/controllers/home.py Fri Jun 24 16:00:12 2011 +0200 @@ -56,14 +56,10 @@ 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):
--- a/rhodecode/templates/index.html Thu Jun 23 23:41:14 2011 +0200 +++ b/rhodecode/templates/index.html Fri Jun 24 16:00:12 2011 +0200 @@ -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){