Commits

Marcin Kuzminski committed b2a7058

fixed base.html. and missing lib str2bool function

  • Participants
  • Parent commits 136af52

Comments (0)

Files changed (2)

File rhodecode/lib/__init__.py

+# -*- coding: utf-8 -*-
+"""
+    rhodecode.lib.__init__
+    ~~~~~~~~~~~~~~~~~~~~~~~
+
+    Some simple helper functions
+    
+    :created_on: Jan 5, 2011
+    :author: marcink
+    :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>    
+    :license: GPLv3, see COPYING for more details.
+"""
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2
+# of the License or (at your opinion) any later version of the license.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+
+def str2bool(v):
+    return v.lower() in ["yes", "true", "t", "1"] if v else None

File rhodecode/templates/base/base.html

                    </a>
                    <ul>
                    %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
-                   	<li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
+                     %if h.HasPermissionAll('hg.admin')('access settings on repository'):
+                         <li>${h.link_to(_('settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
+                     %else:
+                         <li>${h.link_to(_('settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li>
+                     %endif
                    	<li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li>
                    %endif  
                    	<li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li>
 
 function toggleFollowingUser(fallows_user_id,token){
     args = 'follows_user_id='+fallows_user_id;
-    args+= '&auth_token='+token;
+    args+= '&amp;auth_token='+token;
     YUC.asyncRequest('POST',base_url,{
         success:function(o){
         	onSuccess();
 
 function toggleFollowingRepo(fallows_repo_id,token){
     args = 'follows_repo_id='+fallows_repo_id;
-    args+= '&auth_token='+token;
+    args+= '&amp;auth_token='+token;
     YUC.asyncRequest('POST',base_url,{
         success:function(o){
         	onSuccess();