## -*- coding: utf-8 -*-
<%inherit file="root.html"/>
${self.flash_msg()}
${next.main()}
### MAKO DEFS ###
<%def name="flash_msg()">
<%include file="/base/flash_msg.html"/>
%def>
<%def name="breadcrumbs()">
${self.breadcrumbs_links()}
%def>
<%def name="admin_menu()">
%def>
## admin menu used for people that have some admin resources
<%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
%def>
<%def name="repo_context_bar(current=None)">
<%
def follow_class():
if c.repository_following:
return h.literal('following')
else:
return h.literal('follow')
%>
<%
def is_current(selected):
if selected == current:
return h.literal('class="current"')
%>
%if h.is_hg(c.rhodecode_db_repo):
%endif
%if h.is_git(c.rhodecode_db_repo):
%endif
## public/private
%if c.rhodecode_db_repo.private:
%else:
%endif
${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
%if current == 'createfork':
- ${_('Create fork')}
%endif
${_('Summary')}
${_('Changelog')}
${_('Files')}
${_('Switch To')}
%if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
${_('Options')}
%else:
${_('Options')}
%endif
%if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
${_('Settings')}
%endif
%if c.rhodecode_db_repo.fork:
${_('Compare fork')}
%endif
${_('Compare')}
${_('Search')}
%if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
%if c.rhodecode_db_repo.locked[0]:
${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}
%else:
${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}
%endif
%endif
## TODO: this check feels wrong, it would be better to have a check for permissions
## also it feels like a job for the controller
%if c.rhodecode_user.username != 'default':
${_('Follow')}
${_('Unfollow')}
${_('Fork')}
%if h.is_hg(c.rhodecode_repo):
${_('Create Pull Request')}
%endif
%endif
${_('Pull Requests')}
%if c.repository_pull_requests:
${c.repository_pull_requests}
%endif
%def>
<%def name="usermenu()">
## USER MENU
%def>
<%def name="menu(current=None)">
<%
def is_current(selected):
if selected == current:
return h.literal('class="current"')
%>
##ROOT MENU
%if c.rhodecode_user.username != 'default':
%else:
%endif
% if h.HasPermissionAll('hg.admin')('access admin main page'):
${admin_menu()}
% elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
${admin_menu_simple(c.rhodecode_user.repositories_admin,
c.rhodecode_user.repository_groups_admin,
c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
% endif
${usermenu()}
%def>
${_('Site-wide shortcuts')}
<%
elems = [
('/', 'Open quick search box'),
('ctrl/cmd+b', 'Show main settings bar'),
('g h', 'Goto home page'),
('g g', 'Goto my private gists page'),
('g G', 'Goto my public gists page'),
('n r', 'New repository page'),
('n g', 'New gist page'),
]
%>
%for key, desc in elems:
${key}
${desc}
%endfor
${_('Repositories')}
<%
elems = [
('g s', 'Goto summary page'),
('g c', 'Goto changelog page'),
('g f', 'Goto files page'),
('g F', 'Goto files page with file search activated'),
('g o', 'Goto repository settings'),
('g O', 'Goto repository permissions settings'),
]
%>
%for key, desc in elems:
${key}
${desc}
%endfor