# HG changeset patch # User domruf # Date 2016-09-15 18:50:30 # Node ID bcdcdd576e0a46f9659b6290a5d2d0a652161fec # Parent fa85c3df571bc688d5f3b4616f2072f8386c52d3 helpers: allow to set class for repo_link breadcrumb links This helps Bootstrap support. (Since this is a high level function that returns several links and not just a single html element, the patch has been modified to only allow specifying a class that is used for all the links.) diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -1131,7 +1131,7 @@ def changed_tooltip(nodes): return ': ' + _('No files') -def repo_link(groups_and_repos): +def repo_link(groups_and_repos, link_class=None): """ Makes a breadcrumbs link to repo within a group joins » on each group to create a fancy link @@ -1144,11 +1144,12 @@ def repo_link(groups_and_repos): """ 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) + 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)) + url('repos_group_home', group_name=group.group_name), + class_=link_class) return literal(' » '.join(map(make_link, groups) + ['%s' % last_link]))