Changeset - 07e664871e98
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 5 years ago 2020-11-09 16:17:26
mads@kiilerich.com
Grafted from: 45cf4b3667c5
templates: pass repo type to repolabel as str

Keep it simple and avoid passing complex repo objects around.
2 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/base/base.html
Show inline comments
 
@@ -81,11 +81,11 @@
 
  </ul>
 
</%def>
 

	
 
<%def name="repolabel(repo)">
 
  %if h.is_hg(repo):
 
<%def name="repolabel(repo_type)">
 
  %if repo_type == 'hg':
 
    <span class="label label-repo" title="${_('Mercurial repository')}">hg</span>
 
  %endif
 
  %if h.is_git(repo):
 
  %if repo_type == 'git':
 
    <span class="label label-repo" title="${_('Git repository')}">git</span>
 
  %endif
 
</%def>
 
@@ -97,7 +97,7 @@
 
    <div class="container-fluid">
 
    <div class="navbar-header">
 
      <div class="navbar-brand">
 
        ${repolabel(c.db_repo)}
 
        ${repolabel(c.db_repo.repo_type)}
 

	
 
        ## public/private
 
        %if c.db_repo.private:
kallithea/templates/summary/summary.html
Show inline comments
 
@@ -55,7 +55,7 @@ ${self.repo_context_bar('summary')}
 
                <label>${_('Clone URL')}:</label>
 
                <div id="clone-url">
 
                  <div id="clone_by_name" class="input-group" style="${'display:none' if c.ssh_repo_url else ''}">
 
                    <span class="input-group-addon">${self.repolabel(c.db_repo)}</span>
 
                    <span class="input-group-addon">${self.repolabel(c.db_repo.repo_type)}</span>
 
                    <input class="form-control" size="80" readonly="readonly" value="${c.clone_repo_url}"/>
 
                    <span class="input-group-addon btn use-id">${_('Use ID')}</span>
 
                    %if c.ssh_repo_url:
 
@@ -63,7 +63,7 @@ ${self.repo_context_bar('summary')}
 
                    %endif
 
                  </div>
 
                  <div id="clone_by_id" class="input-group" style="display:none">
 
                    <span class="input-group-addon">${self.repolabel(c.db_repo)}</span>
 
                    <span class="input-group-addon">${self.repolabel(c.db_repo.repo_type)}</span>
 
                    <input class="form-control" size="80" readonly="readonly" value="${c.clone_repo_url_id}"/>
 
                    <span class="input-group-addon btn use-name">${_('Use Name')}</span>
 
                    %if c.ssh_repo_url:
 
@@ -72,7 +72,7 @@ ${self.repo_context_bar('summary')}
 
                  </div>
 
                  %if c.ssh_repo_url:
 
                  <div id="clone_ssh" class="input-group">
 
                    <span class="input-group-addon">${self.repolabel(c.db_repo)}</span>
 
                    <span class="input-group-addon">${self.repolabel(c.db_repo.repo_type)}</span>
 
                    <input id="ssh_url" class="form-control" size="80" readonly="readonly" value="${c.ssh_repo_url}"/>
 
                    <span class="input-group-addon btn use-name">${_('Use HTTP')}</span>
 
                  </div>
0 comments (0 inline, 0 general)