Changeset - bcdcdd576e0a
[Not reviewed]
default
0 1 0
domruf - 9 years ago 2016-09-15 18:50:30
dominikruf@gmail.com
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.)
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -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(' &raquo; '.join(map(make_link, groups) + ['<span>%s</span>' % last_link]))
 

	
 

	
0 comments (0 inline, 0 general)