allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 03/03: Repo sidebar: no Browse Commits if repo is empty; add Browse Files for SVN which has no branches links
Date Tue, 28 Jan 2020 15:12:20 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 0f274c149ef0fb49e9f6c09a697883147002ac09
Author: Dave Brondsema <dave@brondsema.net>
AuthorDate: Tue Jan 28 10:06:14 2020 -0500

    Repo sidebar: no Browse Commits if repo is empty; add Browse Files for SVN which has no
branches links
---
 Allura/allura/lib/repository.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index f05206c..1de7045 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -125,8 +125,10 @@ class RepositoryApp(Application):
     def sidebar_menu(self):
         if not self.repo or self.repo.status != 'ready':
             return []
-        links = [SitemapEntry('Browse Commits', c.app.url +
-                              'commit_browser', ui_icon=g.icons['browse_commits'])]
+        links = []
+        if not self.repo.is_empty():
+            links.append(SitemapEntry('Browse Commits', c.app.url + 'commit_browser',
+                                      ui_icon=g.icons['browse_commits']))
         if self.forkable and self.repo.status == 'ready' and not self.repo.is_empty():
             links.append(
                 SitemapEntry('Fork', c.app.url + 'fork', ui_icon=g.icons['fork']))
@@ -196,6 +198,12 @@ class RepositoryApp(Application):
                         'More Branches',
                         ref_url + 'branches/',
                     ))
+        elif not self.repo.is_empty():
+            # SVN repos, for example, should have a sidebar link to get to the main view
+            links.append(
+                SitemapEntry('Browse Files', c.app.url)
+            )
+
         tags = self.repo.get_tags()
         if tags:
             links.append(SitemapEntry('Tags'))


Mime
View raw message