Marcin Kuzminski avatar Marcin Kuzminski committed e1a54d6

#402 removed group prefix from repository name when listing repositories inside a group

Comments (0)

Files changed (5)


   inside a repository group
 - added alternative HTTP 403 response when client failed to authenticate. Helps 
   solving issues with Mercurial and LDAP
+- #402 removed group prefix from repository name when listing repositories 
+  inside a group


-<%def name="repo_name(name,rtype,private,fork_of)">
+<%def name="repo_name(name,rtype,private,fork_of,short_name=False)">
+    <%
+    def get_name(name,short_name=short_name):
+      if short_name:
+        return name.split('/')[-1]
+      else:
+        return name
+    %>
   <div style="white-space: nowrap">
    %if h.is_hg(rtype):
-   ${h.link_to(name,h.url('summary_home',repo_name=name),class_="repo_name")}
+   ${h.link_to(get_name(name),h.url('summary_home',repo_name=name),class_="repo_name")}
    %if fork_of:
         <a href="${h.url('summary_home',repo_name=fork_of)}">
         <img class="icon" alt="${_('fork')}" title="${_('Fork of')} ${fork_of}" src="${h.url('/images/icons/arrow_divide.png')}"/></a>


 <%def name="main()">
-        <%include file="/index_base.html" args="parent=self"/>
+        <%include file="/index_base.html" args="parent=self,short_repo_names=True"/>


 <%def name="breadcrumbs()"></%def>
 <%def name="page_nav()">${'home')}</%def>
 <%def name="main()">
-    	<%include file="index_base.html" args="parent=self"/>
+   <%include file="index_base.html" args="parent=self"/>


                     ##REPO NAME AND ICONS
                     <td class="reponame">
-                      ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'))}
+                      ${dt.repo_name(repo['name'],repo['dbrepo']['repo_type'],repo['dbrepo']['private'],repo['dbrepo_fork'].get('repo_name'),pageargs.get('short_repo_names'))}
                     <td><span class="tooltip" title="${h.tooltip(repo['description'])}">
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.