changeset 1754:d0effbe1acb1 beta

banned git-repos to use bookmarks views
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 04 Dec 2011 23:44:25 +0200
parents 1d1ccb873d00
children 1088ded6e602
files rhodecode/controllers/bookmarks.py rhodecode/templates/switch_to_list.html
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/bookmarks.py	Sun Dec 04 23:39:32 2011 +0200
+++ b/rhodecode/controllers/bookmarks.py	Sun Dec 04 23:44:25 2011 +0200
@@ -29,6 +29,7 @@
 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
 from rhodecode.lib.base import BaseRepoController, render
 from rhodecode.lib.compat import OrderedDict
+from webob.exc import HTTPNotFound
 
 log = logging.getLogger(__name__)
 
@@ -42,6 +43,9 @@
         super(BookmarksController, self).__before__()
 
     def index(self):
+        if c.rhodecode_repo.alias != 'hg':
+            raise HTTPNotFound()
+        
         c.repo_bookmarks = OrderedDict()
 
         bookmarks = [(name, c.rhodecode_repo.get_changeset(hash_)) for \
--- a/rhodecode/templates/switch_to_list.html	Sun Dec 04 23:39:32 2011 +0200
+++ b/rhodecode/templates/switch_to_list.html	Sun Dec 04 23:44:25 2011 +0200
@@ -23,6 +23,7 @@
     %endif
     </ul>                        
 </li>
+%if c.rhodecode_repo.alias == 'hg': 
 <li>
     ${h.link_to('%s (%s)' % (_('bookmarks'),len(c.rhodecode_repo.bookmarks.values()),),h.url('bookmarks_home',repo_name=c.repo_name),class_='bookmarks childs')}
     <ul>
@@ -34,4 +35,5 @@
         <li>${h.link_to(_('There are no bookmarks yet'),'#')}</li>
     %endif
     </ul>                        
-</li>  
\ No newline at end of file
+</li>  
+%endif
\ No newline at end of file