# HG changeset patch # User Marcin Kuzminski # Date 2012-11-17 23:38:35 # Node ID 58f3bba0ddc16579f95c765428682e7ecfae75c1 # Parent 25d77aef2729b8848370d239772ed943c8f629c1 extend helper for better breadcrumbs for repo groups diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -45,7 +45,7 @@ from rhodecode.lib.utils2 import str2boo get_changeset_safe, datetime_to_time, time_to_datetime, AttributeDict from rhodecode.lib.markup_renderer import MarkupRenderer from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError -from rhodecode.lib.vcs.backends.base import BaseChangeset +from rhodecode.lib.vcs.backends.base import BaseChangeset, EmptyChangeset from rhodecode.config.conf import DATE_FORMAT, DATETIME_FORMAT from rhodecode.model.changeset_status import ChangesetStatusModel from rhodecode.model.db import URL_SEP, Permission @@ -881,7 +881,7 @@ def changed_tooltip(nodes): return ': ' + _('No Files') -def repo_link(groups_and_repos): +def repo_link(groups_and_repos, last_url=None): """ Makes a breadcrumbs link to repo within a group joins » on each group to create a fancy link @@ -890,17 +890,20 @@ def repo_link(groups_and_repos): group >> subgroup >> repo :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 if not groups: + if last_url: + return last_link return 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)) + \ - " » " + repo_name) + return link_to(group.name, + url('repos_group_home', group_name=group.group_name)) + return literal(' » '.join(map(make_link, groups) + [last_link])) def fancy_file_stats(stats):