##// END OF EJS Templates
Import some of the files from Select2 3.5.0 Javascript system....
Import some of the files from Select2 3.5.0 Javascript system. RhodeCode 2.2.5 used a version of Select2. Herein, we bring into Kallithea only a few files directly from Select2 3.5.0 (6ef7155) upstream, using the commands indicated below: (cd /tmp; \ git clone https://github.com/ivaynberg/select2.git; \ cd select2; \ git checkout 3.5.0 \ ) mkdir rhodecode/public/js/select2 cp -pa /tmp/select2/select2.{js,css,png} rhodecode/public/js/select2/ cp -pa /tmp/select2/select2x2.png rhodecode/public/js/select2/ cp -pa /tmp/select2/select2-spinner.gif rhodecode/public/js/select2/ hg add rhodecode/public/js/select2/

File last commit:

r4116:ffd45b18 rhodecode-2.2.5-gpl
r4128:bbbb013a rhodecode-2.2.5-gpl
Show More
base.html
589 lines | 23.9 KiB | text/html | HtmlLexer
renamed project to rhodecode
r547 ## -*- coding: utf-8 -*-
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <%inherit file="root.html"/>
<!-- HEADER -->
<div id="header">
Mads Kiilerich
header: don't use fixed position...
r3299 <div id="header-inner" class="title">
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <div id="logo">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <div class="header">
<a href="${h.url('home')}"><img src="${h.url('/images/rhodecode-logo-white-216x60.png')}" alt="RhodeCode"/></a>
</div>
%if c.rhodecode_name:
<div class="branding">- ${c.rhodecode_name}</div>
%endif
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 </div>
<!-- MENU -->
${self.page_nav()}
<!-- END MENU -->
${self.body()}
</div>
White-space cleanup
r1888 </div>
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <!-- END HEADER -->
White-space cleanup
r1888
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <!-- CONTENT -->
White-space cleanup
r1888 <div id="content">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 ${self.flash_msg()}
White-space cleanup
r1888 <div id="main">
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 ${next.main()}
</div>
White-space cleanup
r1888 </div>
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <!-- END CONTENT -->
renamed project to rhodecode
r547
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <!-- FOOTER -->
<div id="footer">
beatify !
r1470 <div id="footer-inner" class="title">
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <div>
<p class="footer-link">
Mads Kiilerich
html: move "Submit a bug" to make it more clear that it is for RhodeCode, not the repo...
r3779 ${_('Server instance: %s') % c.rhodecode_instanceid if c.rhodecode_instanceid else ''}
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 </p>
Mads Kiilerich
html: don't use tabs
r3197 <p class="footer-link-right">
Implements #842 RhodeCode version disclosure....
r3910 RhodeCode
%if c.visual.show_version:
${c.rhodecode_version}
%endif
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 &copy; 2010-${h.datetime.today().year}, <a href="${h.url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
Jonathan Sternberg
Allow RhodeCode maintainers to specify a custom bug tracker....
r4006 %if c.rhodecode_bugtracker:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 &ndash; <a href="${c.rhodecode_bugtracker}" target="_blank">${_('Support')}</a>
Jonathan Sternberg
Allow RhodeCode maintainers to specify a custom bug tracker....
r4006 %endif
Mads Kiilerich
html: don't use tabs
r3197 </p>
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 </div>
</div>
</div>
update footer instance id and copyrights
r3667
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <!-- END FOOTER -->
renamed project to rhodecode
r547
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 ### MAKO DEFS ###
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116
<%def name="flash_msg()">
<%include file="/base/flash_msg.html"/>
</%def>
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157 <%def name="breadcrumbs()">
<div class="breadcrumbs">
${self.breadcrumbs_links()}
</div>
renamed project to rhodecode
r547 </%def>
leonardo
Addding context bar to more repo related pages....
r3529 <%def name="admin_menu()">
<ul class="admin_menu">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('admin_home')}"><i class="icon-book"></i> ${_('Admin journal')}</a></li>
<li><a href="${h.url('repos')}"><i class="icon-archive"></i> ${_('Repositories')}</a></li>
<li><a href="${h.url('repos_groups')}"><i class="icon-folder-close"></i> ${_('Repository groups')}</a></li>
<li><a href="${h.url('users')}"><i class="icon-user"></i> ${_('Users')}</a></li>
<li><a href="${h.url('users_groups')}"><i class="icon-group"></i> ${_('User groups')}</a></li>
<li><a href="${h.url('admin_permissions')}"><i class="icon-ban-circle"></i> ${_('Permissions')}</a></li>
<li><a href="${h.url('auth_home')}"><i class="icon-key"></i> ${_('Authentication')}</a></li>
<li><a href="${h.url('defaults')}"><i class="icon-wrench"></i> ${_('Defaults')}</a></li>
<li class="last"><a href="${h.url('admin_settings')}"><i class="icon-cog"></i> ${_('Settings')}</a></li>
leonardo
Addding context bar to more repo related pages....
r3529 </ul>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116
leonardo
Addding context bar to more repo related pages....
r3529 </%def>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116
## admin menu used for people that have some admin resources
show admin menu and list for users who are admins of repos....
r3865 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
leonardo
Addding context bar to more repo related pages....
r3529 <ul>
show admin menu and list for users who are admins of repos....
r3865 %if repositories:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('repos')}"><i class="icon-archive"></i> ${_('Repositories')}</a></li>
show admin menu and list for users who are admins of repos....
r3865 %endif
- Manage User’s Groups: create, delete, rename, add/remove users inside....
r3714 %if repository_groups:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('repos_groups')}"><i class="icon-folder-close"></i> ${_('Repository groups')}</a></li>
show admin menu and list for users who are admins of repos....
r3865 %endif
- Manage User’s Groups: create, delete, rename, add/remove users inside....
r3714 %if user_groups:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('users_groups')}"><i class="icon-group"></i> ${_('User groups')}</a></li>
- Manage User’s Groups: create, delete, rename, add/remove users inside....
r3714 %endif
leonardo
Addding context bar to more repo related pages....
r3529 </ul>
</%def>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 <%def name="repo_context_bar(current=None)">
<%
def follow_class():
if c.repository_following:
return h.literal('following')
else:
Mads Kiilerich
move repo actions from their own menu line to Options menu
r3611 return h.literal('follow')
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 %>
<%
def is_current(selected):
if selected == current:
return h.literal('class="current"')
%>
<!--- CONTEXT BAR -->
<div id="context-bar" class="box">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <h2>
%if h.is_hg(c.rhodecode_db_repo):
<i class="icon-hg" style="color: #316293; font-size: 24px"></i>
%endif
%if h.is_git(c.rhodecode_db_repo):
<i class="icon-git" style="color: #e85634; font-size: 24px"></i>
%endif
## public/private
%if c.rhodecode_db_repo.private:
<i class="icon-lock"></i>
%else:
<i class="icon-unlock-alt"></i>
%endif
${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
%if current == 'createfork':
- ${_('Create fork')}
%endif
</h2>
<!--
Leonardo
Fixing missing icons....
r3532 <div id="breadcrumbs">
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 ${h.link_to(_(u'Repositories'),h.url('home'))}
Mads Kiilerich
breadcrumbs: make repo names link to summary pages
r3599 &raquo;
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
</div>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 -->
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 <ul id="context-pages" class="horizontal-list">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-file-text"></i> ${_('Summary')}</a></li>
<li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}"><i class="icon-time"></i> ${_('Changelog')}</a></li>
<li ${is_current('files')}><a href="${h.url('files_home', repo_name=c.repo_name)}"><i class="icon-file"></i> ${_('Files')}</a></li>
leonardo
Addding context bar to more repo related pages....
r3529 <li ${is_current('switch-to')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a href="#" id="branch_tag_switcher_2" class="dropdown"><i class="icon-random"></i> ${_('Switch To')}</a>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 <ul id="switch_to_list_2" class="switch_to submenu">
Mads Kiilerich
uppercase "Loading..."
r3986 <li><a href="#">${_('Loading...')}</a></li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 </ul>
</li>
Leonardo Carneiro
Style clean up, and comments removal.
r3539 <li ${is_current('options')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
<a href="${h.url('edit_repo',repo_name=c.repo_name)}" class="dropdown"><i class="icon-cogs"></i> ${_('Options')}</a>
%else:
<a href="#" class="dropdown"><i class="icon-cogs"></i> ${_('Options')}</a>
%endif
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 <ul>
%if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('edit_repo',repo_name=c.repo_name)}"><i class="icon-cog"></i> ${_('Settings')}</a></li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 %endif
%if c.rhodecode_db_repo.fork:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type=c.rhodecode_db_repo.landing_rev[0],org_ref=c.rhodecode_db_repo.landing_rev[1], other_repo=c.repo_name,other_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],other_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], merge=1)}">
<i class="icon-loop"></i> ${_('Compare fork')}</a></li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 %endif
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('compare_home',repo_name=c.repo_name)}"><i class="icon-loop"></i> ${_('Compare')}</a></li>
<li><a href="${h.url('search_repo',repo_name=c.repo_name)}"><i class="icon-search"></i> ${_('Search')}</a></li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527
%if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
%if c.rhodecode_db_repo.locked[0]:
Leonardo Carneiro
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
r3538 <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 %else:
Leonardo Carneiro
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
r3538 <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 %endif
%endif
added super simple cache_key paster function for showing and cleaning cache keys
r3616 ## 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':
<li>
<a class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.rhodecode_db_repo.repo_id},'${str(h.get_token())}');">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <span class="show-follow"><i class="icon-heart-empty"></i> ${_('Follow')}</span>
<span class="show-following"><i class="icon-heart"></i> ${_('Unfollow')}</span>
added super simple cache_key paster function for showing and cleaning cache keys
r3616 </a>
</li>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}"><i class="icon-code-fork"></i> ${_('Fork')}</a></li>
added super simple cache_key paster function for showing and cleaning cache keys
r3616 %if h.is_hg(c.rhodecode_repo):
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-code-fork"></i> ${_('Create Pull Request')}</a></li>
added super simple cache_key paster function for showing and cleaning cache keys
r3616 %endif
%endif
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 </ul>
</li>
Leonardo Carneiro
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
r3538 <li ${is_current('showpullrequest')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}"> <i class="icon-code-fork"></i> ${_('Pull Requests')}
Leonardo Carneiro
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
r3538 %if c.repository_pull_requests:
<span>${c.repository_pull_requests}</span>
%endif
</a>
</li>
Leonardo
Adding the context bar too all pages related to a Repository....
r3527 </ul>
</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>
removed upper menu to save space and did little rip off menu similar to G+
r1926 <%def name="usermenu()">
Mads Kiilerich
top menu: show user menu when hovering instead of using js - like other menus
r3206 ## USER MENU
Mads Kiilerich
top menu: show user menu as a menu option like others, now also with login name...
r3205 <li>
Leonardo Carneiro
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
r3538 <a class="menu_link childs" id="quick_login_link">
<span class="icon">
make gravatar icon little bit bigger, re-use same img src like on other menu items,...
r3207 <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
top menu: show user menu as a menu option like others, now also with login name...
r3205
removed upper menu to save space and did little rip off menu similar to G+
r1926 <div class="user-menu">
Mads Kiilerich
top menu: show user menu when hovering instead of using js - like other menus
r3206 <div id="quick_login">
removed upper menu to save space and did little rip off menu similar to G+
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">
fixed login input sizes
r3422 ${h.text('username',class_='focus')}
removed upper menu to save space and did little rip off menu similar to G+
r1926 </div>
white space cleanup
r1944
removed upper menu to save space and did little rip off menu similar to G+
r1926 </div>
<div class="field">
<div class="label">
<label for="password">${_('Password')}:</label>
</div>
<div class="input">
fixed login input sizes
r3422 ${h.password('password',class_='focus')}
removed upper menu to save space and did little rip off menu similar to G+
r1926 </div>
white space cleanup
r1944
removed upper menu to save space and did little rip off menu similar to G+
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">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 ${h.submit('sign_in',_('Log In'),class_="btn btn-mini")}
removed upper menu to save space and did little rip off menu similar to G+
r1926 </div>
</div>
</div>
</div>
${h.end_form()}
%else:
<div class="links_left">
usermenu...
r3658 <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
#344 optional firstname lastname on user creation...
r1950 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
removed upper menu to save space and did little rip off menu similar to G+
r1926 <div class="email">${c.rhodecode_user.email}</div>
</div>
<div class="links_right">
<ol class="links">
usermenu...
r3658 <li><a href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a></li>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li>${h.link_to(_(u'My account'),h.url('my_account'))}</li>
removed upper menu to save space and did little rip off menu similar to G+
r1926 <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
</ol>
</div>
%endif
white space cleanup
r1944 </div>
Mads Kiilerich
top menu: show user menu when hovering instead of using js - like other menus
r3206 </div>
</li>
removed upper menu to save space and did little rip off menu similar to G+
r1926 </%def>
rewrote templates, all small pages will inherit from root for easier changes and controll
r1157
renamed project to rhodecode
r547 <%def name="menu(current=None)">
Mads Kiilerich
html: don't use tabs
r3197 <%
def is_current(selected):
if selected == current:
return h.literal('class="current"')
%>
Leonardo Carneiro
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
r3538 <ul id="quick" class="horizontal-list">
Implements #734 repo switcher should be available in all views
r3209 <!-- repo switcher -->
Mads Kiilerich
use valid options for the top menu: repositories, journal, search and admin
r3603 <li ${is_current('repositories')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <input id="repo_switcher" name="repo_switcher" type="hidden">
Implements #734 repo switcher should be available in all views
r3209 </li>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116
leonardo
Addding context bar to more repo related pages....
r3529 ##ROOT MENU
%if c.rhodecode_user.username != 'default':
<li ${is_current('journal')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a class="menu_link" title="${_('Show recent activity')}" href="${h.url('journal')}">
<i class="icon-book"></i> ${_('Journal')}
leonardo
Addding context bar to more repo related pages....
r3529 </a>
Implements #734 repo switcher should be available in all views
r3209 </li>
leonardo
Addding context bar to more repo related pages....
r3529 %else:
<li ${is_current('journal')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}">
<i class="icon-book"></i> ${_('Public journal')}
leonardo
Addding context bar to more repo related pages....
r3529 </a>
Implements #734 repo switcher should be available in all views
r3209 </li>
leonardo
Addding context bar to more repo related pages....
r3529 %endif
Implemented simple gist functionality ref #530....
r3840 <li ${is_current('gists')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a class="menu_link childs" title="${_('Show public gists')}" href="${h.url('gists')}">
<i class="icon-file-2"></i> ${_('Gists')}
Implemented simple gist functionality ref #530....
r3840 </a>
<ul class="admin_menu">
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('new_gist', public=1)}"><i class="icon-file-alt"></i> ${_('Create new gist')}</a></li>
<li><a href="${h.url('gists')}"><i class="icon-copy"></i> ${_('All public gists')}</a></li>
Implemented simple gist functionality ref #530....
r3840 %if c.rhodecode_user.username != 'default':
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <li><a href="${h.url('gists', public=1)}"><i class="icon-copy"></i> ${_('My public gists')}</a></li>
<li><a href="${h.url('gists', private=1)}"><i class="icon-file-text"></i> ${_('My private gists')}</a></li>
Implemented simple gist functionality ref #530....
r3840 %endif
</ul>
</li>
leonardo
Addding context bar to more repo related pages....
r3529 <li ${is_current('search')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a class="menu_link" title="${_('Search in repositories')}" href="${h.url('search')}">
<i class="icon-search"></i> ${_('Search')}
leonardo
Addding context bar to more repo related pages....
r3529 </a>
</li>
% if h.HasPermissionAll('hg.admin')('access admin main page'):
<li ${is_current('admin')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a class="menu_link childs" title="${_('Admin')}" href="${h.url('admin_home')}">
<i class="icon-cog"></i> ${_('Admin')}
leonardo
Addding context bar to more repo related pages....
r3529 </a>
${admin_menu()}
Implements #734 repo switcher should be available in all views
r3209 </li>
show admin menu and list for users who are admins of repos....
r3865 % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
leonardo
Addding context bar to more repo related pages....
r3529 <li ${is_current('admin')}>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a class="menu_link childs" title="${_('Admin')}">
<i class="icon-cog"></i> ${_('Admin')}
leonardo
Addding context bar to more repo related pages....
r3529 </a>
show admin menu and list for users who are admins of repos....
r3865 ${admin_menu_simple(c.rhodecode_user.repositories_admin,
c.rhodecode_user.repository_groups_admin,
show link to usergroups if we have a create usergroup permission
r3790 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
leonardo
Addding context bar to more repo related pages....
r3529 </li>
% endif
${usermenu()}
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116
<script type="text/javascript">
var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
var cache = {}
/*format the look of items in the list*/
var format = function(state){
if (!state.id){
return state.text; // optgroup
}
var obj_dict = state.obj;
var tmpl = '';
if(obj_dict && state.type == 'repo'){
if(obj_dict['repo_type'] === 'hg'){
tmpl += '<i class="icon-hg"></i> ';
}
else if(obj_dict['repo_type'] === 'git'){
tmpl += '<i class="icon-git"></i> ';
}
if(obj_dict['private']){
tmpl += '<i class="icon-lock" style="color: #e85634;"></i> ';
}
else if(visual_show_public_icon){
tmpl += '<i class="icon-unlock-alt"></i> ';
}
}
if(obj_dict && state.type == 'group'){
tmpl += '<i class="icon-folder-close"></i> ';
}
tmpl += state.text;
return tmpl;
}
$("#repo_switcher").select2({
placeholder: '<i class="icon-archive"></i> ${_('Repositories')} <i class="icon-caret-down"></i>',
dropdownAutoWidth: true,
formatResult: format,
formatSelection: format,
formatNoMatches: function(term){
return "${_('No matches found')}";
},
containerCssClass: "repo-switcher",
dropdownCssClass: "repo-switcher-dropdown",
escapeMarkup: function(m){
// don't escape our custom placeholder
if(m.substr(0,28) == '<i class="icon-archive"></i>'){
return m;
}
return Select2.util.escapeMarkup(m);
},
query: function(query){
var key = 'cache';
var cached = cache[key] ;
if(cached) {
var data = {results: []};
//filter results
$.each(cached.results, function(){
var section = this.text;
var children = [];
$.each(this.children, function(){
if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
children.push({'id': this.id, 'text': this.text, 'type': this.type, 'obj': this.obj})
}
})
if(children.length !== 0){
data.results.push({'text': section, 'children': children})
}
});
query.callback(data);
}else{
$.ajax({
url: "${h.url('repo_switcher_data')}",
data: {},
dataType: 'json',
type: 'GET',
success: function(data) {
cache[key] = data;
query.callback({results: data.results});
}
})
}
},
});
$("#repo_switcher").on('select2-selecting', function(e){
e.preventDefault();
window.location = pyroutes.url('summary_home', {'repo_name': e.val})
})
## Global mouse bindings ##
// general help "?"
Mousetrap.bind(['?'], function(e) {
$('#help_kb').modal({})
});
// / open the quick filter
Mousetrap.bind(['/'], function(e) {
$("#repo_switcher").select2("open");
// return false to prevent default browser behavior
// and stop event from bubbling
return false;
});
whitespace cleanup
r3216
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 // ctrl/command+b, show the the main bar
Mousetrap.bind(['command+b', 'ctrl+b'], function(e) {
if($('#header-inner').hasClass('hover') && $('#content').hasClass('hover')){
$('#header-inner').removeClass('hover');
$('#content').removeClass('hover');
}
else{
$('#header-inner').addClass('hover');
$('#content').addClass('hover');
}
return false;
});
// general nav g + action
Mousetrap.bind(['g h'], function(e) {
window.location = pyroutes.url('home');
});
Mousetrap.bind(['g g'], function(e) {
window.location = pyroutes.url('gists', {'private':1});
});
Mousetrap.bind(['g G'], function(e) {
window.location = pyroutes.url('gists', {'public':1});
});
Mousetrap.bind(['n g'], function(e) {
window.location = pyroutes.url('new_gist');
});
Mousetrap.bind(['n r'], function(e) {
window.location = pyroutes.url('new_repo');
});
% if hasattr(c, 'repo_name') and hasattr(c, 'rhodecode_db_repo'):
// nav in repo context
Mousetrap.bind(['g s'], function(e) {
window.location = pyroutes.url('summary_home', {'repo_name': REPO_NAME});
});
Mousetrap.bind(['g c'], function(e) {
window.location = pyroutes.url('changelog_home', {'repo_name': REPO_NAME});
});
Mousetrap.bind(['g F'], function(e) {
window.location = pyroutes.url('files_home', {'repo_name': REPO_NAME, 'revision': '${c.rhodecode_db_repo.landing_rev[1]}', 'f_path': '', 'search': '1'});
});
Mousetrap.bind(['g f'], function(e) {
window.location = pyroutes.url('files_home', {'repo_name': REPO_NAME, 'revision': '${c.rhodecode_db_repo.landing_rev[1]}', 'f_path': ''});
});
Mousetrap.bind(['g o'], function(e) {
window.location = pyroutes.url('edit_repo', {'repo_name': REPO_NAME});
});
Mousetrap.bind(['g O'], function(e) {
window.location = pyroutes.url('edit_repo_perms', {'repo_name': REPO_NAME});
});
% endif
</script>
</%def>
Mads Kiilerich
header: don't use fixed position...
r3299
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">${_('Keyboard shortcuts')}</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-5">
<table class="keyboard-mappings">
<tbody>
<tr>
<th></th>
<th>${_('Site-wide shortcuts')}</th>
</tr>
<%
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:
<tr>
<td class="keys">
<span class="key">${key}</span>
</td>
<td>${desc}</td>
</tr>
%endfor
</tbody>
</table>
</div>
<div class="col-md-offset-5">
<table class="keyboard-mappings">
<tbody>
<tr>
<th></th>
<th>${_('Repositories')}</th>
</tr>
<%
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:
<tr>
<td class="keys">
<span class="key">${key}</span>
</td>
<td>${desc}</td>
</tr>
%endfor
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->