# HG changeset patch # User domruf # Date 2016-09-26 17:11:02 # Node ID 44e6e66c185547f073d2655a7cf7877db8b41e0e # Parent d39a579a4c60726bb5f82da84fd6d3879d61f909 templates: get rid of repo_breadcrumbs Generate the the breadcrumbs directly in the templates. That is what templates are for, generating html code. diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -1132,21 +1132,6 @@ def changed_tooltip(nodes): return ': ' + _('No files') -def repo_breadcrumbs(groups_and_repos, link_class=None): - """ - Makes breadcrumb links to a repo within its groups, like 'group >> subgroup >> repo'. - """ - 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, class_=link_class) - - def make_link(group): - return link_to(group.name, - url('repos_group_home', group_name=group.group_name), - class_=link_class) - return literal(' » '.join(map(make_link, groups) + ['%s' % last_link])) - - def fancy_file_stats(stats): """ Displays a fancy two colored bar for number of added/deleted diff --git a/kallithea/templates/base/base.html b/kallithea/templates/base/base.html --- a/kallithea/templates/base/base.html +++ b/kallithea/templates/base/base.html @@ -113,19 +113,16 @@ %else: %endif - ${h.repo_breadcrumbs(c.db_repo.groups_and_repo)} + %for group in c.db_repo.groups_with_parents: + ${h.link_to(group.name, url('repos_group_home', group_name=group.group_name))} + » + %endfor + ${h.link_to(c.db_repo.just_name, url('summary_home', repo_name=c.db_repo.repo_name))} %if current == 'createfork': - ${_('Create Fork')} %endif -