base.html
387 lines
| 15.4 KiB
| text/html
|
HtmlLexer
r547 | ## -*- coding: utf-8 -*- | |||
r1157 | <%inherit file="root.html"/> | |||
<!-- HEADER --> | ||||
Mads Kiilerich
|
r3299 | <div id="header-dd"></div> | ||
r1157 | <div id="header"> | |||
Mads Kiilerich
|
r3299 | <div id="header-inner" class="title"> | ||
r1157 | <div id="logo"> | |||
<h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1> | ||||
</div> | ||||
<!-- MENU --> | ||||
${self.page_nav()} | ||||
<!-- END MENU --> | ||||
${self.body()} | ||||
</div> | ||||
r1888 | </div> | |||
r1157 | <!-- END HEADER --> | |||
r1888 | ||||
r1157 | <!-- CONTENT --> | |||
r1888 | <div id="content"> | |||
r1157 | <div class="flash_msg"> | |||
<% messages = h.flash.pop_messages() %> | ||||
% if messages: | ||||
<ul id="flash-messages"> | ||||
% for message in messages: | ||||
<li class="${message.category}_msg">${message}</li> | ||||
% endfor | ||||
r547 | </ul> | |||
r1157 | % endif | |||
r1888 | </div> | |||
<div id="main"> | ||||
r1157 | ${next.main()} | |||
</div> | ||||
r1888 | </div> | |||
r1157 | <!-- END CONTENT --> | |||
r547 | ||||
r1157 | <!-- FOOTER --> | |||
<div id="footer"> | ||||
r1470 | <div id="footer-inner" class="title"> | |||
r1157 | <div> | |||
<p class="footer-link"> | ||||
<a href="${h.url('bugtracker')}">${_('Submit a bug')}</a> | ||||
</p> | ||||
Mads Kiilerich
|
r3197 | <p class="footer-link-right"> | ||
<a href="${h.url('rhodecode_official')}">RhodeCode${'-%s' % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}</a> | ||||
${c.rhodecode_version} © 2010-${h.datetime.today().year} by Marcin Kuzminski | ||||
</p> | ||||
r1157 | </div> | |||
</div> | ||||
</div> | ||||
<!-- END FOOTER --> | ||||
r547 | ||||
r1157 | ### MAKO DEFS ### | |||
<%def name="page_nav()"> | ||||
${self.menu()} | ||||
</%def> | ||||
r547 | ||||
r1157 | <%def name="breadcrumbs()"> | |||
<div class="breadcrumbs"> | ||||
${self.breadcrumbs_links()} | ||||
</div> | ||||
r547 | </%def> | |||
Leonardo
|
r3527 | <%def name="context_bar(current=None)"> | ||
%if c.repo_name: | ||||
${repo_context_bar(current)} | ||||
%endif | ||||
</%def> | ||||
leonardo
|
r3529 | <%def name="admin_menu()"> | ||
<ul class="admin_menu"> | ||||
<li>${h.link_to(_('admin journal'),h.url('admin_home'),class_='journal')}</li> | ||||
<li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | ||||
leonardo
|
r3530 | <li>${h.link_to(_('repository groups'),h.url('repos_groups'),class_='repos_groups')}</li> | ||
leonardo
|
r3529 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | ||
leonardo
|
r3530 | <li>${h.link_to(_('user groups'),h.url('users_groups'),class_='groups')}</li> | ||
leonardo
|
r3529 | <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> | ||
<li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> | ||||
<li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> | ||||
<li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | ||||
</ul> | ||||
</%def> | ||||
<%def name="admin_menu_simple()"> | ||||
<ul> | ||||
<li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> | ||||
</ul> | ||||
</%def> | ||||
Leonardo
|
r3527 | <%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"') | ||||
%> | ||||
<!--- CONTEXT BAR --> | ||||
<div id="context-bar" class="box"> | ||||
<div id="context-top"> | ||||
Leonardo
|
r3532 | <div id="breadcrumbs"> | ||
Leonardo
|
r3527 | ${h.link_to(_(u'Repositories'),h.url('home'))} | ||
» | ||||
${h.repo_link(c.rhodecode_db_repo.groups_and_repo)} | ||||
</div> | ||||
## 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': | ||||
<ul id="context-actions" class="horizontal-list"> | ||||
<li> | ||||
<button class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');"> | ||||
<!--span class="icon show-follow follow"></span> | ||||
<span class="icon show-following following"></span--> | ||||
<span class="show-follow">${_('Follow')}</span> | ||||
<span class="show-following">${_('Unfollow')}</span> | ||||
</button> | ||||
</li> | ||||
<li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}" class="fork">${_('Fork')}</a></li> | ||||
%if h.is_hg(c.rhodecode_repo): | ||||
<li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="pull-request">${_('Pull Request')}</a></li> | ||||
%endif | ||||
</ul> | ||||
%endif | ||||
</div> | ||||
<div id="context-state"> | ||||
Leonardo
|
r3528 | <!--button id="revision-changer"> | ||
Leonardo
|
r3527 | <span class="branch-name">graphics/shader-move</span> | ||
<span class="revision">@73318:8d3d6ee94072</span> | ||||
Leonardo
|
r3528 | </button--> | ||
Leonardo
|
r3527 | <ul id="context-pages" class="horizontal-list"> | ||
<li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}" class="summary">${_('Summary')}</a></li> | ||||
Leonardo
|
r3534 | <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}" class="changelogs">${_('Changelog')}</a></li> | ||
Leonardo
|
r3527 | <li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}" class="files"></span>${_('Files')}</a></li> | ||
leonardo
|
r3529 | <li ${is_current('switch-to')}> | ||
Leonardo
|
r3527 | <a href="#" id="branch_tag_switcher_2" class="dropdown switch-to"></span>${_('Switch To')}</a> | ||
<ul id="switch_to_list_2" class="switch_to submenu"> | ||||
<li><a href="#">${_('loading...')}</a></li> | ||||
</ul> | ||||
</li> | ||||
Leonardo
|
r3532 | <li ${is_current('options')}> | ||
Leonardo
|
r3527 | <a href="#" class="dropdown options"></span>Options</a> | ||
<ul> | ||||
%if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | ||||
%if h.HasPermissionAll('hg.admin')('access settings on repository'): | ||||
<li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> | ||||
%else: | ||||
<li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> | ||||
%endif | ||||
%endif | ||||
%if c.rhodecode_db_repo.fork: | ||||
<li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default'),class_='compare_request')}</li> | ||||
%endif | ||||
<li>${h.link_to(_('lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li> | ||||
<li>${h.link_to(_('search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li> | ||||
%if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | ||||
%if c.rhodecode_db_repo.locked[0]: | ||||
<li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> | ||||
%else: | ||||
<li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> | ||||
%endif | ||||
%endif | ||||
% if h.HasPermissionAll('hg.admin')('access admin main page'): | ||||
<li> | ||||
${h.link_to(_('admin'),h.url('admin_home'),class_='admin childs')} | ||||
## ADMIN MENU | ||||
${admin_menu()} | ||||
</li> | ||||
## if you're a admin of any groups, show admin menu for it | ||||
% elif c.rhodecode_user.groups_admin: | ||||
<li> | ||||
${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} | ||||
leonardo
|
r3529 | |||
Leonardo
|
r3527 | ## ADMIN MENU | ||
${admin_menu_simple()} | ||||
</li> | ||||
% endif | ||||
</ul> | ||||
</li> | ||||
<li ${is_current('showpullrequest')}><a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests')}" class="pull-request">1</a></li> | ||||
</ul> | ||||
</div> | ||||
</div> | ||||
<script type="text/javascript"> | ||||
YUE.on('branch_tag_switcher_2','mouseover',function(){ | ||||
var loaded = YUD.hasClass('branch_tag_switcher_2','loaded'); | ||||
if(!loaded){ | ||||
YUD.addClass('branch_tag_switcher_2','loaded'); | ||||
ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list_2', | ||||
function(o){}, | ||||
function(o){YUD.removeClass('branch_tag_switcher_2','loaded');} | ||||
,null); | ||||
} | ||||
return false; | ||||
}); | ||||
</script> | ||||
<!--- END CONTEXT BAR --> | ||||
</%def> | ||||
r1926 | <%def name="usermenu()"> | |||
Mads Kiilerich
|
r3206 | ## USER MENU | ||
Mads Kiilerich
|
r3205 | <li> | ||
r3207 | <a class="menu_link" id="quick_login_link"> | |||
<span class="icon" style="padding:5px 5px 0px 5px"> | ||||
<img src="${h.gravatar_url(c.rhodecode_user.email,20)}" alt="avatar"> | ||||
</span> | ||||
%if c.rhodecode_user.username != 'default': | ||||
<span class="menu_link_user">${c.rhodecode_user.username}</span> | ||||
%if c.unread_notifications != 0: | ||||
<span class="menu_link_notifications">${c.unread_notifications}</span> | ||||
%endif | ||||
%else: | ||||
<span>${_('Not logged in')}</span> | ||||
%endif | ||||
</a> | ||||
Mads Kiilerich
|
r3205 | |||
r1926 | <div class="user-menu"> | |||
Mads Kiilerich
|
r3206 | <div id="quick_login"> | ||
r1926 | %if c.rhodecode_user.username == 'default': | |||
<h4>${_('Login to your account')}</h4> | ||||
${h.form(h.url('login_home',came_from=h.url.current()))} | ||||
<div class="form"> | ||||
<div class="fields"> | ||||
<div class="field"> | ||||
<div class="label"> | ||||
<label for="username">${_('Username')}:</label> | ||||
</div> | ||||
<div class="input"> | ||||
r3422 | ${h.text('username',class_='focus')} | |||
r1926 | </div> | |||
r1944 | ||||
r1926 | </div> | |||
<div class="field"> | ||||
<div class="label"> | ||||
<label for="password">${_('Password')}:</label> | ||||
</div> | ||||
<div class="input"> | ||||
r3422 | ${h.password('password',class_='focus')} | |||
r1926 | </div> | |||
r1944 | ||||
r1926 | </div> | |||
<div class="buttons"> | ||||
<div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div> | ||||
<div class="register"> | ||||
%if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): | ||||
${h.link_to(_("Don't have an account ?"),h.url('register'))} | ||||
%endif | ||||
</div> | ||||
<div class="submit"> | ||||
r1935 | ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")} | |||
r1926 | </div> | |||
</div> | ||||
</div> | ||||
</div> | ||||
${h.end_form()} | ||||
%else: | ||||
<div class="links_left"> | ||||
r1950 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> | |||
r1926 | <div class="email">${c.rhodecode_user.email}</div> | |||
<div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div> | ||||
Mads Kiilerich
|
r3280 | <div class="notifications"><a href="${h.url('notifications')}">${_('Notifications')}</a></div> | ||
r3297 | <div class="unread"><a href="${h.url('notifications')}">${_('Unread')}: ${c.unread_notifications}</a></div> | |||
r1926 | </div> | |||
<div class="links_right"> | ||||
<ol class="links"> | ||||
<li>${h.link_to(_(u'Home'),h.url('home'))}</li> | ||||
Aras Pranckevicius
|
r1975 | <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li> | ||
r1926 | <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li> | |||
<li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li> | ||||
</ol> | ||||
</div> | ||||
%endif | ||||
r1944 | </div> | |||
Mads Kiilerich
|
r3206 | </div> | ||
</li> | ||||
r1926 | </%def> | |||
r1157 | ||||
r547 | <%def name="menu(current=None)"> | |||
Mads Kiilerich
|
r3197 | <% | ||
def is_current(selected): | ||||
if selected == current: | ||||
return h.literal('class="current"') | ||||
%> | ||||
r3209 | <ul id="quick"> | |||
<!-- repo switcher --> | ||||
Mads Kiilerich
|
r3282 | <li ${is_current('home')}> | ||
<a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="${h.url('home')}"> | ||||
r3209 | <span class="icon"> | |||
<img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" /> | ||||
</span> | ||||
<span>${_('Repositories')}</span> | ||||
</a> | ||||
<ul id="repo_switcher_list" class="repo_switcher"> | ||||
<li> | ||||
<a href="#">${_('loading...')}</a> | ||||
</li> | ||||
</ul> | ||||
</li> | ||||
leonardo
|
r3529 | ##ROOT MENU | ||
%if c.rhodecode_user.username != 'default': | ||||
<li ${is_current('journal')}> | ||||
<a class="menu_link" title="${_('Show recent activity')}" href="${h.url('journal')}"> | ||||
<span class="icon"> | ||||
<img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" /> | ||||
</span> | ||||
<span>${_('Journal')}</span> | ||||
</a> | ||||
r3209 | </li> | |||
leonardo
|
r3529 | %else: | ||
<li ${is_current('journal')}> | ||||
<a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}"> | ||||
<span class="icon"> | ||||
<img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" /> | ||||
</span> | ||||
<span>${_('Public journal')}</span> | ||||
</a> | ||||
r3209 | </li> | |||
leonardo
|
r3529 | %endif | ||
<li ${is_current('search')}> | ||||
<a class="menu_link" title="${_('Search in repositories')}" href="${h.url('search')}"> | ||||
<span class="icon"> | ||||
<img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" /> | ||||
</span> | ||||
<span>${_('Search')}</span> | ||||
</a> | ||||
</li> | ||||
% if h.HasPermissionAll('hg.admin')('access admin main page'): | ||||
<li ${is_current('admin')}> | ||||
<a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}"> | ||||
<span class="icon"> | ||||
<img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" /> | ||||
r3209 | </span> | |||
leonardo
|
r3529 | <span>${_('Admin')}</span> | ||
</a> | ||||
${admin_menu()} | ||||
r3209 | </li> | |||
leonardo
|
r3529 | % elif c.rhodecode_user.groups_admin: | ||
<li ${is_current('admin')}> | ||||
<a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}"> | ||||
r3209 | <span class="icon"> | |||
leonardo
|
r3529 | <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" /> | ||
r3209 | </span> | |||
leonardo
|
r3529 | <span>${_('Admin')}</span> | ||
</a> | ||||
${admin_menu_simple()} | ||||
</li> | ||||
% endif | ||||
${usermenu()} | ||||
r3211 | <script type="text/javascript"> | |||
YUE.on('repo_switcher','mouseover',function(){ | ||||
var target = 'q_filter_rs'; | ||||
var qfilter_activate = function(){ | ||||
var nodes = YUQ('ul#repo_switcher_list li a.repo_name'); | ||||
var func = function(node){ | ||||
return node.parentNode; | ||||
} | ||||
q_filter(target,nodes,func); | ||||
} | ||||
r3216 | ||||
r3211 | var loaded = YUD.hasClass('repo_switcher','loaded'); | |||
if(!loaded){ | ||||
YUD.addClass('repo_switcher','loaded'); | ||||
ypjax("${h.url('repo_switcher')}",'repo_switcher_list', | ||||
function(o){qfilter_activate();YUD.get(target).focus()}, | ||||
function(o){YUD.removeClass('repo_switcher','loaded');} | ||||
,null); | ||||
}else{ | ||||
Mads Kiilerich
|
r3267 | YUD.get(target).focus(); | ||
r3211 | } | |||
return false; | ||||
r3209 | }); | |||
Mads Kiilerich
|
r3299 | |||
YUE.on('header-dd', 'click',function(e){ | ||||
r3315 | YUD.addClass('header-inner', 'hover'); | |||
r3341 | YUD.addClass('content', 'hover'); | |||
Mads Kiilerich
|
r3299 | }); | ||
r3211 | </script> | |||
Augusto Herrmann
|
r1472 | </%def> | ||