Changeset - 44e6e66c1855
[Not reviewed]
default
0 2 0
domruf - 9 years ago 2016-09-26 17:11:02
dominikruf@gmail.com
templates: get rid of repo_breadcrumbs

Generate the the breadcrumbs directly in the templates.
That is what templates are for, generating html code.
2 files changed with 5 insertions and 23 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -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(' &raquo; '.join(map(make_link, groups) + ['<span>%s</span>' % last_link]))
 

	
 

	
 
def fancy_file_stats(stats):
 
    """
 
    Displays a fancy two colored bar for number of added/deleted
kallithea/templates/base/base.html
Show inline comments
 
@@ -113,19 +113,16 @@
 
        %else:
 
          <i class="icon-globe"></i>
 
        %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))}
 
          &raquo;
 
        %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
 
      </h2>
 
      <!--
 
      <div id="breadcrumbs">
 
        ${h.link_to(_('Repositories'),h.url('home'))}
 
        &raquo;
 
        ${h.repo_breadcrumbs(c.db_repo.groups_and_repo)}
 
      </div>
 
      -->
 
      <ul id="context-pages" class="horizontal-list">
 
        <li ${is_current('summary')} data-context="summary"><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-doc-text"></i> ${_('Summary')}</a></li>
 
        %if rev:
0 comments (0 inline, 0 general)