# HG changeset patch # User Mads Kiilerich # Date 2013-03-26 14:53:11 # Node ID 8087731920d81ee1b2f6b648592988c65b4a5212 # Parent 7d774f09dba5bb2cef583b45ba09675f20fef581 breadcrumbs: make repo names link to summary pages diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -917,7 +917,7 @@ def changed_tooltip(nodes): return ': ' + _('No Files') -def repo_link(groups_and_repos, last_url=None): +def repo_link(groups_and_repos): """ Makes a breadcrumbs link to repo within a group joins » on each group to create a fancy link @@ -928,18 +928,14 @@ def repo_link(groups_and_repos, last_url :param groups_and_repos: :param last_url: """ - groups, repo_name = groups_and_repos - last_link = link_to(repo_name, last_url) if last_url else repo_name + groups, just_name, repo_name = groups_and_repos + last_url = url('summary_home', repo_name=repo_name) + last_link = link_to(just_name, last_url) - if not groups: - if last_url: - return literal('%s' % last_link) - return literal('%s' % repo_name) - else: - def make_link(group): - return link_to(group.name, - url('repos_group_home', group_name=group.group_name)) - return literal(' » '.join(map(make_link, groups) + ['' + last_link + ''])) + def make_link(group): + return link_to(group.name, + url('repos_group_home', group_name=group.group_name)) + return literal(' » '.join(map(make_link, groups) + ['%s' % last_link])) def fancy_file_stats(stats): diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -887,7 +887,7 @@ class Repository(Base, BaseModel): @property def groups_and_repo(self): - return self.groups_with_parents, self.just_name + return self.groups_with_parents, self.just_name, self.repo_name @LazyProperty def repo_path(self): diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -240,7 +240,7 @@ class RepoModel(BaseModel): return None defaults = repo_info.get_dict() - group, repo_name = repo_info.groups_and_repo + group, repo_name, repo_name_full = repo_info.groups_and_repo defaults['repo_name'] = repo_name defaults['repo_group'] = getattr(group[-1] if group else None, 'group_id', None) diff --git a/rhodecode/templates/base/base.html b/rhodecode/templates/base/base.html --- a/rhodecode/templates/base/base.html +++ b/rhodecode/templates/base/base.html @@ -106,7 +106,7 @@
## TODO: this check feels wrong, it would be better to have a check for permissions