##// END OF EJS Templates
ui: moved group settings outside
marcink -
r3567:3bcfa6d4 new-ui
parent child Browse files
Show More
@@ -1,48 +1,48 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('%s repository group settings') % c.repo_group.name}
5 ${_('%s repository group settings') % c.repo_group.name}
6 %if c.rhodecode_name:
6 %if c.rhodecode_name:
7 &middot; ${h.branding(c.rhodecode_name)}
7 &middot; ${h.branding(c.rhodecode_name)}
8 %endif
8 %endif
9 </%def>
9 </%def>
10
10
11 <%def name="menu_bar_nav()">
11 <%def name="menu_bar_nav()">
12 ${self.menu_items(active='admin')}
12 ${self.menu_items(active='admin')}
13 </%def>
13 </%def>
14
14
15 <%def name="menu_bar_subnav()">
15 <%def name="menu_bar_subnav()">
16 ${self.repo_group_menu(active='options')}
16 ${self.repo_group_menu(active='settings')}
17 </%def>
17 </%def>
18
18
19 <%def name="main_content()">
19 <%def name="main_content()">
20 <%include file="/admin/repo_groups/repo_group_edit_${c.active}.mako"/>
20 <%include file="/admin/repo_groups/repo_group_edit_${c.active}.mako"/>
21 </%def>
21 </%def>
22
22
23 <%def name="main()">
23 <%def name="main()">
24
24
25 <div class="box">
25 <div class="box">
26 <div class="title">
26 <div class="title">
27 ${self.repo_group_page_title(c.repo_group)}
27 ${self.repo_group_page_title(c.repo_group)}
28 </div>
28 </div>
29
29
30 <div class="sidebar-col-wrapper">
30 <div class="sidebar-col-wrapper">
31 ##main
31 ##main
32 <div class="sidebar">
32 <div class="sidebar">
33 <ul class="nav nav-pills nav-stacked">
33 <ul class="nav nav-pills nav-stacked">
34 <li class="${'active' if c.active=='settings' else ''}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
34 <li class="${'active' if c.active=='settings' else ''}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
35 <li class="${'active' if c.active=='permissions' else ''}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Permissions')}</a></li>
35 <li class="${'active' if c.active=='permissions' else ''}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Permissions')}</a></li>
36 <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
36 <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
37 <li class="${'active' if c.active=='integrations' else ''}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
37 <li class="${'active' if c.active=='integrations' else ''}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
38 </ul>
38 </ul>
39 </div>
39 </div>
40
40
41 <div class="main-content-full-width">
41 <div class="main-content-full-width">
42 ${self.main_content()}
42 ${self.main_content()}
43 </div>
43 </div>
44
44
45 </div>
45 </div>
46 </div>
46 </div>
47
47
48 </%def>
48 </%def>
@@ -1,108 +1,108 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 ##
2 ##
3 ## See also repo_settings.html
3 ## See also repo_settings.html
4 ##
4 ##
5 <%inherit file="/base/base.mako"/>
5 <%inherit file="/base/base.mako"/>
6
6
7 <%def name="title()">
7 <%def name="title()">
8 ${_('%s repository settings') % c.rhodecode_db_repo.repo_name}
8 ${_('%s repository settings') % c.rhodecode_db_repo.repo_name}
9 %if c.rhodecode_name:
9 %if c.rhodecode_name:
10 &middot; ${h.branding(c.rhodecode_name)}
10 &middot; ${h.branding(c.rhodecode_name)}
11 %endif
11 %endif
12 </%def>
12 </%def>
13
13
14 <%def name="breadcrumbs_links()">
14 <%def name="breadcrumbs_links()">
15 ${_('Settings')}
15 ${_('Settings')}
16 </%def>
16 </%def>
17
17
18 <%def name="menu_bar_nav()">
18 <%def name="menu_bar_nav()">
19 ${self.menu_items(active='repositories')}
19 ${self.menu_items(active='repositories')}
20 </%def>
20 </%def>
21
21
22 <%def name="menu_bar_subnav()">
22 <%def name="menu_bar_subnav()">
23 ${self.repo_menu(active='options')}
23 ${self.repo_menu(active='settings')}
24 </%def>
24 </%def>
25
25
26 <%def name="main_content()">
26 <%def name="main_content()">
27 % if hasattr(c, 'repo_edit_template'):
27 % if hasattr(c, 'repo_edit_template'):
28 <%include file="${c.repo_edit_template}"/>
28 <%include file="${c.repo_edit_template}"/>
29 % else:
29 % else:
30 <%include file="/admin/repos/repo_edit_${c.active}.mako"/>
30 <%include file="/admin/repos/repo_edit_${c.active}.mako"/>
31 % endif
31 % endif
32 </%def>
32 </%def>
33
33
34
34
35 <%def name="main()">
35 <%def name="main()">
36 <div class="box">
36 <div class="box">
37 <div class="title">
37 <div class="title">
38 ${self.repo_page_title(c.rhodecode_db_repo)}
38 ${self.repo_page_title(c.rhodecode_db_repo)}
39
39
40 </div>
40 </div>
41
41
42 <div class="sidebar-col-wrapper scw-small">
42 <div class="sidebar-col-wrapper scw-small">
43 <div class="sidebar">
43 <div class="sidebar">
44 <ul class="nav nav-pills nav-stacked">
44 <ul class="nav nav-pills nav-stacked">
45 <li class="${'active' if c.active=='settings' else ''}">
45 <li class="${'active' if c.active=='settings' else ''}">
46 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
46 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
47 </li>
47 </li>
48 <li class="${'active' if c.active=='permissions' else ''}">
48 <li class="${'active' if c.active=='permissions' else ''}">
49 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a>
49 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a>
50 </li>
50 </li>
51 <li class="${'active' if c.active=='permissions_branch' else ''}">
51 <li class="${'active' if c.active=='permissions_branch' else ''}">
52 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
52 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
53 </li>
53 </li>
54 <li class="${'active' if c.active=='advanced' else ''}">
54 <li class="${'active' if c.active=='advanced' else ''}">
55 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
55 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
56 </li>
56 </li>
57 <li class="${'active' if c.active=='vcs' else ''}">
57 <li class="${'active' if c.active=='vcs' else ''}">
58 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
58 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
59 </li>
59 </li>
60 <li class="${'active' if c.active=='fields' else ''}">
60 <li class="${'active' if c.active=='fields' else ''}">
61 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
61 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
62 </li>
62 </li>
63 <li class="${'active' if c.active=='issuetracker' else ''}">
63 <li class="${'active' if c.active=='issuetracker' else ''}">
64 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
64 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
65 </li>
65 </li>
66 <li class="${'active' if c.active=='caches' else ''}">
66 <li class="${'active' if c.active=='caches' else ''}">
67 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
67 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
68 </li>
68 </li>
69 %if c.rhodecode_db_repo.repo_type != 'svn':
69 %if c.rhodecode_db_repo.repo_type != 'svn':
70 <li class="${'active' if c.active=='remote' else ''}">
70 <li class="${'active' if c.active=='remote' else ''}">
71 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
71 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
72 </li>
72 </li>
73 %endif
73 %endif
74 <li class="${'active' if c.active=='statistics' else ''}">
74 <li class="${'active' if c.active=='statistics' else ''}">
75 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
75 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
76 </li>
76 </li>
77 <li class="${'active' if c.active=='integrations' else ''}">
77 <li class="${'active' if c.active=='integrations' else ''}">
78 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
78 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
79 </li>
79 </li>
80 %if c.rhodecode_db_repo.repo_type != 'svn':
80 %if c.rhodecode_db_repo.repo_type != 'svn':
81 <li class="${'active' if c.active=='reviewers' else ''}">
81 <li class="${'active' if c.active=='reviewers' else ''}">
82 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
82 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
83 </li>
83 </li>
84 %endif
84 %endif
85 <li class="${'active' if c.active=='automation' else ''}">
85 <li class="${'active' if c.active=='automation' else ''}">
86 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
86 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
87 </li>
87 </li>
88 <li class="${'active' if c.active=='maintenance' else ''}">
88 <li class="${'active' if c.active=='maintenance' else ''}">
89 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
89 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
90 </li>
90 </li>
91 <li class="${'active' if c.active=='strip' else ''}">
91 <li class="${'active' if c.active=='strip' else ''}">
92 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
92 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
93 </li>
93 </li>
94 <li class="${'active' if c.active=='audit' else ''}">
94 <li class="${'active' if c.active=='audit' else ''}">
95 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
95 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
96 </li>
96 </li>
97
97
98 </ul>
98 </ul>
99 </div>
99 </div>
100
100
101 <div class="main-content-full-width">
101 <div class="main-content-full-width">
102 ${self.main_content()}
102 ${self.main_content()}
103 </div>
103 </div>
104
104
105 </div>
105 </div>
106 </div>
106 </div>
107
107
108 </%def> No newline at end of file
108 </%def>
@@ -1,918 +1,920 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="root.mako"/>
2 <%inherit file="root.mako"/>
3
3
4 <%include file="/ejs_templates/templates.html"/>
4 <%include file="/ejs_templates/templates.html"/>
5
5
6 <div class="outerwrapper">
6 <div class="outerwrapper">
7 <!-- HEADER -->
7 <!-- HEADER -->
8 <div class="header">
8 <div class="header">
9 <div id="header-inner" class="wrapper">
9 <div id="header-inner" class="wrapper">
10 <div id="logo">
10 <div id="logo">
11 <div class="logo-wrapper">
11 <div class="logo-wrapper">
12 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
12 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
13 </div>
13 </div>
14 % if c.rhodecode_name:
14 % if c.rhodecode_name:
15 <div class="branding">
15 <div class="branding">
16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
17 </div>
17 </div>
18 % endif
18 % endif
19 </div>
19 </div>
20 <!-- MENU BAR NAV -->
20 <!-- MENU BAR NAV -->
21 ${self.menu_bar_nav()}
21 ${self.menu_bar_nav()}
22 <!-- END MENU BAR NAV -->
22 <!-- END MENU BAR NAV -->
23 </div>
23 </div>
24 </div>
24 </div>
25 ${self.menu_bar_subnav()}
25 ${self.menu_bar_subnav()}
26 <!-- END HEADER -->
26 <!-- END HEADER -->
27
27
28 <!-- CONTENT -->
28 <!-- CONTENT -->
29 <div id="content" class="wrapper">
29 <div id="content" class="wrapper">
30
30
31 <rhodecode-toast id="notifications"></rhodecode-toast>
31 <rhodecode-toast id="notifications"></rhodecode-toast>
32
32
33 <div class="main">
33 <div class="main">
34 ${next.main()}
34 ${next.main()}
35 </div>
35 </div>
36 </div>
36 </div>
37 <!-- END CONTENT -->
37 <!-- END CONTENT -->
38
38
39 </div>
39 </div>
40 <!-- FOOTER -->
40 <!-- FOOTER -->
41 <div id="footer">
41 <div id="footer">
42 <div id="footer-inner" class="title wrapper">
42 <div id="footer-inner" class="title wrapper">
43 <div>
43 <div>
44 <p class="footer-link-right">
44 <p class="footer-link-right">
45 % if c.visual.show_version:
45 % if c.visual.show_version:
46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
47 % endif
47 % endif
48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
49 % if c.visual.rhodecode_support_url:
49 % if c.visual.rhodecode_support_url:
50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
51 % endif
51 % endif
52 </p>
52 </p>
53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
54 <p class="server-instance" style="display:${sid}">
54 <p class="server-instance" style="display:${sid}">
55 ## display hidden instance ID if specially defined
55 ## display hidden instance ID if specially defined
56 % if c.rhodecode_instanceid:
56 % if c.rhodecode_instanceid:
57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
58 % endif
58 % endif
59 </p>
59 </p>
60 </div>
60 </div>
61 </div>
61 </div>
62 </div>
62 </div>
63
63
64 <!-- END FOOTER -->
64 <!-- END FOOTER -->
65
65
66 ### MAKO DEFS ###
66 ### MAKO DEFS ###
67
67
68 <%def name="menu_bar_subnav()">
68 <%def name="menu_bar_subnav()">
69 </%def>
69 </%def>
70
70
71 <%def name="breadcrumbs(class_='breadcrumbs')">
71 <%def name="breadcrumbs(class_='breadcrumbs')">
72 <div class="${class_}">
72 <div class="${class_}">
73 ${self.breadcrumbs_links()}
73 ${self.breadcrumbs_links()}
74 </div>
74 </div>
75 </%def>
75 </%def>
76
76
77 <%def name="admin_menu(active=None)">
77 <%def name="admin_menu(active=None)">
78 <div id="context-bar">
78 <div id="context-bar">
79 <div class="wrapper">
79 <div class="wrapper">
80 <ul id="context-pages" class="navigation horizontal-list">
80 <ul id="context-pages" class="navigation horizontal-list">
81 <%
81 <%
82 repositories=c.rhodecode_user.repositories_admin
82 repositories=c.rhodecode_user.repositories_admin
83 repository_groups=c.rhodecode_user.repository_groups_admin
83 repository_groups=c.rhodecode_user.repository_groups_admin
84 user_groups=c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')()
84 user_groups=c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')()
85 def is_active(selected):
85 def is_active(selected):
86 if selected == active:
86 if selected == active:
87 return "active"
87 return "active"
88 %>
88 %>
89 ## super admin case
89 ## super admin case
90 % if c.rhodecode_user.is_admin:
90 % if c.rhodecode_user.is_admin:
91 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
91 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
92 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
92 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
93 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
93 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
94 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
94 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
95 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
95 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
96 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
96 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
97 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
97 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
98 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
98 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
99 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
99 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
100 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
100 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
101
101
102 ## delegated admin
102 ## delegated admin
103 % elif repositories or repository_groups or user_groups:
103 % elif repositories or repository_groups or user_groups:
104
104
105 %if repositories:
105 %if repositories:
106 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
106 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
107 %endif
107 %endif
108 %if repository_groups:
108 %if repository_groups:
109 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
109 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
110 %endif
110 %endif
111 %if user_groups:
111 %if user_groups:
112 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
112 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
113 %endif
113 %endif
114 % endif
114 % endif
115 </ul>
115 </ul>
116 </div>
116 </div>
117 <div class="clear"></div>
117 <div class="clear"></div>
118 </div>
118 </div>
119 </%def>
119 </%def>
120
120
121
121
122 <%def name="dt_info_panel(elements)">
122 <%def name="dt_info_panel(elements)">
123 <dl class="dl-horizontal">
123 <dl class="dl-horizontal">
124 %for dt, dd, title, show_items in elements:
124 %for dt, dd, title, show_items in elements:
125 <dt>${dt}:</dt>
125 <dt>${dt}:</dt>
126 <dd title="${h.tooltip(title)}">
126 <dd title="${h.tooltip(title)}">
127 %if callable(dd):
127 %if callable(dd):
128 ## allow lazy evaluation of elements
128 ## allow lazy evaluation of elements
129 ${dd()}
129 ${dd()}
130 %else:
130 %else:
131 ${dd}
131 ${dd}
132 %endif
132 %endif
133 %if show_items:
133 %if show_items:
134 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
134 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
135 %endif
135 %endif
136 </dd>
136 </dd>
137
137
138 %if show_items:
138 %if show_items:
139 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
139 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
140 %for item in show_items:
140 %for item in show_items:
141 <dt></dt>
141 <dt></dt>
142 <dd>${item}</dd>
142 <dd>${item}</dd>
143 %endfor
143 %endfor
144 </div>
144 </div>
145 %endif
145 %endif
146
146
147 %endfor
147 %endfor
148 </dl>
148 </dl>
149 </%def>
149 </%def>
150
150
151
151
152 <%def name="gravatar(email, size=16)">
152 <%def name="gravatar(email, size=16)">
153 <%
153 <%
154 if (size > 16):
154 if (size > 16):
155 gravatar_class = 'gravatar gravatar-large'
155 gravatar_class = 'gravatar gravatar-large'
156 else:
156 else:
157 gravatar_class = 'gravatar'
157 gravatar_class = 'gravatar'
158 %>
158 %>
159 <%doc>
159 <%doc>
160 TODO: johbo: For now we serve double size images to make it smooth
160 TODO: johbo: For now we serve double size images to make it smooth
161 for retina. This is how it worked until now. Should be replaced
161 for retina. This is how it worked until now. Should be replaced
162 with a better solution at some point.
162 with a better solution at some point.
163 </%doc>
163 </%doc>
164 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
164 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
165 </%def>
165 </%def>
166
166
167
167
168 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
168 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
169 <% email = h.email_or_none(contact) %>
169 <% email = h.email_or_none(contact) %>
170 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
170 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
171 ${self.gravatar(email, size)}
171 ${self.gravatar(email, size)}
172 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
172 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
173 </div>
173 </div>
174 </%def>
174 </%def>
175
175
176
176
177 <%def name="repo_page_title(repo_instance)">
177 <%def name="repo_page_title(repo_instance)">
178 <div class="title-content">
178 <div class="title-content">
179 <div class="title-main">
179 <div class="title-main">
180 ## SVN/HG/GIT icons
180 ## SVN/HG/GIT icons
181 %if h.is_hg(repo_instance):
181 %if h.is_hg(repo_instance):
182 <i class="icon-hg"></i>
182 <i class="icon-hg"></i>
183 %endif
183 %endif
184 %if h.is_git(repo_instance):
184 %if h.is_git(repo_instance):
185 <i class="icon-git"></i>
185 <i class="icon-git"></i>
186 %endif
186 %endif
187 %if h.is_svn(repo_instance):
187 %if h.is_svn(repo_instance):
188 <i class="icon-svn"></i>
188 <i class="icon-svn"></i>
189 %endif
189 %endif
190
190
191 ## public/private
191 ## public/private
192 %if repo_instance.private:
192 %if repo_instance.private:
193 <i class="icon-repo-private"></i>
193 <i class="icon-repo-private"></i>
194 %else:
194 %else:
195 <i class="icon-repo-public"></i>
195 <i class="icon-repo-public"></i>
196 %endif
196 %endif
197
197
198 ## repo name with group name
198 ## repo name with group name
199 ${h.breadcrumb_repo_link(repo_instance)}
199 ${h.breadcrumb_repo_link(repo_instance)}
200
200
201 </div>
201 </div>
202
202
203 ## FORKED
203 ## FORKED
204 %if repo_instance.fork:
204 %if repo_instance.fork:
205 <p>
205 <p>
206 <i class="icon-code-fork"></i> ${_('Fork of')}
206 <i class="icon-code-fork"></i> ${_('Fork of')}
207 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
207 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
208 </p>
208 </p>
209 %endif
209 %endif
210
210
211 ## IMPORTED FROM REMOTE
211 ## IMPORTED FROM REMOTE
212 %if repo_instance.clone_uri:
212 %if repo_instance.clone_uri:
213 <p>
213 <p>
214 <i class="icon-code-fork"></i> ${_('Clone from')}
214 <i class="icon-code-fork"></i> ${_('Clone from')}
215 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
215 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
216 </p>
216 </p>
217 %endif
217 %endif
218
218
219 ## LOCKING STATUS
219 ## LOCKING STATUS
220 %if repo_instance.locked[0]:
220 %if repo_instance.locked[0]:
221 <p class="locking_locked">
221 <p class="locking_locked">
222 <i class="icon-repo-lock"></i>
222 <i class="icon-repo-lock"></i>
223 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
223 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
224 </p>
224 </p>
225 %elif repo_instance.enable_locking:
225 %elif repo_instance.enable_locking:
226 <p class="locking_unlocked">
226 <p class="locking_unlocked">
227 <i class="icon-repo-unlock"></i>
227 <i class="icon-repo-unlock"></i>
228 ${_('Repository not locked. Pull repository to lock it.')}
228 ${_('Repository not locked. Pull repository to lock it.')}
229 </p>
229 </p>
230 %endif
230 %endif
231
231
232 </div>
232 </div>
233 </%def>
233 </%def>
234
234
235 <%def name="repo_menu(active=None)">
235 <%def name="repo_menu(active=None)">
236 <%
236 <%
237 def is_active(selected):
237 def is_active(selected):
238 if selected == active:
238 if selected == active:
239 return "active"
239 return "active"
240 %>
240 %>
241
241
242 <!--- REPO CONTEXT BAR -->
242 <!--- REPO CONTEXT BAR -->
243 <div id="context-bar">
243 <div id="context-bar">
244 <div class="wrapper">
244 <div class="wrapper">
245
245
246 <div class="title">
246 <div class="title">
247 ${self.repo_page_title(c.rhodecode_db_repo)}
247 ${self.repo_page_title(c.rhodecode_db_repo)}
248 </div>
248 </div>
249
249
250 <ul id="context-pages" class="navigation horizontal-list">
250 <ul id="context-pages" class="navigation horizontal-list">
251 <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
251 <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
252 <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
252 <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
253 <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
253 <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
254 <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
254 <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
255
255
256 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
256 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
257 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
257 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
258 <li class="${is_active('showpullrequest')}">
258 <li class="${is_active('showpullrequest')}">
259 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
259 <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}">
260 %if c.repository_pull_requests:
260 %if c.repository_pull_requests:
261 <span class="pr_notifications">${c.repository_pull_requests}</span>
261 <span class="pr_notifications">${c.repository_pull_requests}</span>
262 %endif
262 %endif
263 <div class="menulabel">${_('Pull Requests')}</div>
263 <div class="menulabel">${_('Pull Requests')}</div>
264 </a>
264 </a>
265 </li>
265 </li>
266 %endif
266 %endif
267
267
268 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
269 <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
270 %endif
271
268 <li class="${is_active('options')}">
272 <li class="${is_active('options')}">
269 <a class="menulink dropdown">
273 <a class="menulink dropdown">
270 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
274 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
271 </a>
275 </a>
272 <ul class="submenu">
276 <ul class="submenu">
273 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
277
274 <li><a href="${h.route_path('edit_repo',repo_name=c.repo_name)}">${_('Repository Settings')}</a></li>
275 %endif
276 %if c.rhodecode_db_repo.fork:
278 %if c.rhodecode_db_repo.fork:
277 <li>
279 <li>
278 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
280 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
279 href="${h.route_path('repo_compare',
281 href="${h.route_path('repo_compare',
280 repo_name=c.rhodecode_db_repo.fork.repo_name,
282 repo_name=c.rhodecode_db_repo.fork.repo_name,
281 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
283 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
282 source_ref=c.rhodecode_db_repo.landing_rev[1],
284 source_ref=c.rhodecode_db_repo.landing_rev[1],
283 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
285 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
284 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
286 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
285 _query=dict(merge=1))}"
287 _query=dict(merge=1))}"
286 >
288 >
287 ${_('Compare fork')}
289 ${_('Compare fork')}
288 </a>
290 </a>
289 </li>
291 </li>
290 %endif
292 %endif
291
293
292 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
294 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
293 %if c.rhodecode_db_repo.locked[0]:
295 %if c.rhodecode_db_repo.locked[0]:
294 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
296 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
295 %else:
297 %else:
296 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
298 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
297 %endif
299 %endif
298 %endif
300 %endif
299 %if c.rhodecode_user.username != h.DEFAULT_USER:
301 %if c.rhodecode_user.username != h.DEFAULT_USER:
300 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
302 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
301 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
303 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
302 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
304 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
303 %endif
305 %endif
304 %endif
306 %endif
305 </ul>
307 </ul>
306 </li>
308 </li>
307 </ul>
309 </ul>
308 </div>
310 </div>
309 <div class="clear"></div>
311 <div class="clear"></div>
310 </div>
312 </div>
311 % if c.rhodecode_db_repo.archived:
313 % if c.rhodecode_db_repo.archived:
312 <div class="alert alert-warning text-center">
314 <div class="alert alert-warning text-center">
313 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
315 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
314 </div>
316 </div>
315 % endif
317 % endif
316 <!--- REPO END CONTEXT BAR -->
318 <!--- REPO END CONTEXT BAR -->
317
319
318 </%def>
320 </%def>
319
321
320 <%def name="repo_group_page_title(repo_group_instance)">
322 <%def name="repo_group_page_title(repo_group_instance)">
321 <div class="title-content">
323 <div class="title-content">
322 <div class="title-main">
324 <div class="title-main">
323 ## Repository Group icon
325 ## Repository Group icon
324 <i class="icon-folder-close"></i>
326 <i class="icon-folder-close"></i>
325
327
326 ## repo name with group name
328 ## repo name with group name
327 ${h.breadcrumb_repo_group_link(repo_group_instance)}
329 ${h.breadcrumb_repo_group_link(repo_group_instance)}
328 </div>
330 </div>
329
331
330 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
332 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
331 <div class="repo-group-desc">
333 <div class="repo-group-desc">
332 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
334 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
333 </div>
335 </div>
334
336
335 </div>
337 </div>
336 </%def>
338 </%def>
337
339
338 <%def name="repo_group_menu(active=None)">
340 <%def name="repo_group_menu(active=None)">
339 <%
341 <%
340 def is_active(selected):
342 def is_active(selected):
341 if selected == active:
343 if selected == active:
342 return "active"
344 return "active"
343
345
344 is_admin = h.HasPermissionAny('hg.admin')('can create repos index page')
346 is_admin = h.HasPermissionAny('hg.admin')('can create repos index page')
345
347
346 gr_name = c.repo_group.group_name if c.repo_group else None
348 gr_name = c.repo_group.group_name if c.repo_group else None
347 # create repositories with write permission on group is set to true
349 # create repositories with write permission on group is set to true
348 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
350 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
349 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
351 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
350 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
352 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
351
353
352 %>
354 %>
353
355
354 <!--- REPO GROUP CONTEXT BAR -->
356 <!--- REPO GROUP CONTEXT BAR -->
355 <div id="context-bar">
357 <div id="context-bar">
356 <div class="wrapper">
358 <div class="wrapper">
357 <ul id="context-pages" class="navigation horizontal-list">
359 <ul id="context-pages" class="navigation horizontal-list">
358 <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li>
360 <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li>
361 % if is_admin or group_admin:
362 <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li>
363 % endif
359
364
360 <li class="${is_active('options')}">
365 <li class="${is_active('options')}">
361 <a class="menulink dropdown">
366 <a class="menulink dropdown">
362 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
367 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
363 </a>
368 </a>
364 <ul class="submenu">
369 <ul class="submenu">
365 %if is_admin or group_admin:
366 <li><a href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}">${_('Group Settings')}</a></li>
367 %endif
368 %if is_admin or group_admin or (group_write and create_on_write):
370 %if is_admin or group_admin or (group_write and create_on_write):
369 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
371 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
370 %endif
372 %endif
371 %if is_admin or group_admin:
373 %if is_admin or group_admin:
372 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li>
374 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li>
373 %endif
375 %endif
374 </ul>
376 </ul>
375 </li>
377 </li>
376 </ul>
378 </ul>
377 </div>
379 </div>
378 <div class="clear"></div>
380 <div class="clear"></div>
379 </div>
381 </div>
380
382
381 <!--- REPO GROUP CONTEXT BAR -->
383 <!--- REPO GROUP CONTEXT BAR -->
382
384
383 </%def>
385 </%def>
384
386
385
387
386 <%def name="usermenu(active=False)">
388 <%def name="usermenu(active=False)">
387 ## USER MENU
389 ## USER MENU
388 <li id="quick_login_li" class="${'active' if active else ''}">
390 <li id="quick_login_li" class="${'active' if active else ''}">
389 % if c.rhodecode_user.username == h.DEFAULT_USER:
391 % if c.rhodecode_user.username == h.DEFAULT_USER:
390 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
392 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
391 ${gravatar(c.rhodecode_user.email, 20)}
393 ${gravatar(c.rhodecode_user.email, 20)}
392 <span class="user">
394 <span class="user">
393 <span>${_('Sign in')}</span>
395 <span>${_('Sign in')}</span>
394 </span>
396 </span>
395 </a>
397 </a>
396 % else:
398 % else:
397 ## logged in user
399 ## logged in user
398 <a id="quick_login_link" class="menulink childs">
400 <a id="quick_login_link" class="menulink childs">
399 ${gravatar(c.rhodecode_user.email, 20)}
401 ${gravatar(c.rhodecode_user.email, 20)}
400 <span class="user">
402 <span class="user">
401 <span class="menu_link_user">${c.rhodecode_user.username}</span>
403 <span class="menu_link_user">${c.rhodecode_user.username}</span>
402 <div class="show_more"></div>
404 <div class="show_more"></div>
403 </span>
405 </span>
404 </a>
406 </a>
405 ## subnav with menu for logged in user
407 ## subnav with menu for logged in user
406 <div class="user-menu submenu">
408 <div class="user-menu submenu">
407 <div id="quick_login">
409 <div id="quick_login">
408 %if c.rhodecode_user.username != h.DEFAULT_USER:
410 %if c.rhodecode_user.username != h.DEFAULT_USER:
409 <div class="">
411 <div class="">
410 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
412 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
411 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
413 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
412 <div class="email">${c.rhodecode_user.email}</div>
414 <div class="email">${c.rhodecode_user.email}</div>
413 </div>
415 </div>
414 <div class="">
416 <div class="">
415 <ol class="links">
417 <ol class="links">
416 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
418 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
417 % if c.rhodecode_user.personal_repo_group:
419 % if c.rhodecode_user.personal_repo_group:
418 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
420 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
419 % endif
421 % endif
420 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
422 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
421 ## bookmark-items
423 ## bookmark-items
422 <li class="bookmark-items">
424 <li class="bookmark-items">
423 ${_('Bookmarks')}
425 ${_('Bookmarks')}
424 <div class="pull-right">
426 <div class="pull-right">
425 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
427 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
426 </div>
428 </div>
427 </li>
429 </li>
428 % if not c.bookmark_items:
430 % if not c.bookmark_items:
429 <li>
431 <li>
430 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
432 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
431 </li>
433 </li>
432 % endif
434 % endif
433 % for item in c.bookmark_items:
435 % for item in c.bookmark_items:
434 <li>
436 <li>
435 % if item.repository:
437 % if item.repository:
436 <div>
438 <div>
437 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
439 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
438 <code>${item.position}</code>
440 <code>${item.position}</code>
439 % if item.repository.repo_type == 'hg':
441 % if item.repository.repo_type == 'hg':
440 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
442 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
441 % elif item.repository.repo_type == 'git':
443 % elif item.repository.repo_type == 'git':
442 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
444 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
443 % elif item.repository.repo_type == 'svn':
445 % elif item.repository.repo_type == 'svn':
444 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
446 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
445 % endif
447 % endif
446 ${(item.title or h.shorter(item.repository.repo_name, 30))}
448 ${(item.title or h.shorter(item.repository.repo_name, 30))}
447 </a>
449 </a>
448 </div>
450 </div>
449 % elif item.repository_group:
451 % elif item.repository_group:
450 <div>
452 <div>
451 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
453 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
452 <code>${item.position}</code>
454 <code>${item.position}</code>
453 <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i>
455 <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i>
454 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
456 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
455 </a>
457 </a>
456 </div>
458 </div>
457 % else:
459 % else:
458 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
460 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
459 <code>${item.position}</code>
461 <code>${item.position}</code>
460 ${item.title}
462 ${item.title}
461 </a>
463 </a>
462 % endif
464 % endif
463 </li>
465 </li>
464 % endfor
466 % endfor
465
467
466 <li class="logout">
468 <li class="logout">
467 ${h.secure_form(h.route_path('logout'), request=request)}
469 ${h.secure_form(h.route_path('logout'), request=request)}
468 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
470 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
469 ${h.end_form()}
471 ${h.end_form()}
470 </li>
472 </li>
471 </ol>
473 </ol>
472 </div>
474 </div>
473 %endif
475 %endif
474 </div>
476 </div>
475 </div>
477 </div>
476 ## unread counter
478 ## unread counter
477 <div class="pill_container">
479 <div class="pill_container">
478 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
480 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
479 </div>
481 </div>
480 % endif
482 % endif
481 </li>
483 </li>
482 </%def>
484 </%def>
483
485
484 <%def name="menu_items(active=None)">
486 <%def name="menu_items(active=None)">
485 <%
487 <%
486 def is_active(selected):
488 def is_active(selected):
487 if selected == active:
489 if selected == active:
488 return "active"
490 return "active"
489 return ""
491 return ""
490 %>
492 %>
491
493
492 <ul id="quick" class="main_nav navigation horizontal-list">
494 <ul id="quick" class="main_nav navigation horizontal-list">
493 ## notice box for important system messages
495 ## notice box for important system messages
494 <li style="display: none">
496 <li style="display: none">
495 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
497 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
496 <div class="menulabel-notice" >
498 <div class="menulabel-notice" >
497 0
499 0
498 </div>
500 </div>
499 </a>
501 </a>
500 </li>
502 </li>
501
503
502 ## Main filter
504 ## Main filter
503 <li>
505 <li>
504 <div class="menulabel main_filter_box">
506 <div class="menulabel main_filter_box">
505 <div class="main_filter_input_box">
507 <div class="main_filter_input_box">
506 <ul class="searchItems">
508 <ul class="searchItems">
507
509
508 % if c.template_context['search_context']['repo_id']:
510 % if c.template_context['search_context']['repo_id']:
509 <li class="searchTag searchTagFilter searchTagHidable" >
511 <li class="searchTag searchTagFilter searchTagHidable" >
510 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
512 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
511 <span class="tag">
513 <span class="tag">
512 This repo
514 This repo
513 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
515 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
514 </span>
516 </span>
515 ##</a>
517 ##</a>
516 </li>
518 </li>
517 % elif c.template_context['search_context']['repo_group_id']:
519 % elif c.template_context['search_context']['repo_group_id']:
518 <li class="searchTag searchTagFilter searchTagHidable">
520 <li class="searchTag searchTagFilter searchTagHidable">
519 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
521 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
520 <span class="tag">
522 <span class="tag">
521 This group
523 This group
522 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
524 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
523 </span>
525 </span>
524 ##</a>
526 ##</a>
525 </li>
527 </li>
526 % endif
528 % endif
527
529
528 <li class="searchTagInput">
530 <li class="searchTagInput">
529 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
531 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
530 </li>
532 </li>
531 <li class="searchTag searchTagHelp">
533 <li class="searchTag searchTagHelp">
532 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
534 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
533 </li>
535 </li>
534 </ul>
536 </ul>
535 </div>
537 </div>
536 </div>
538 </div>
537
539
538 <div id="main_filter_help" style="display: none">
540 <div id="main_filter_help" style="display: none">
539 - Use '/' key to quickly access this field.
541 - Use '/' key to quickly access this field.
540
542
541 - Enter a name of repository, or repository group for quick search.
543 - Enter a name of repository, or repository group for quick search.
542
544
543 - Prefix query to allow special search:
545 - Prefix query to allow special search:
544
546
545 user:admin, to search for usernames, always global
547 user:admin, to search for usernames, always global
546
548
547 user_group:devops, to search for user groups, always global
549 user_group:devops, to search for user groups, always global
548
550
549 commit:efced4, to search for commits, scoped to repositories or groups
551 commit:efced4, to search for commits, scoped to repositories or groups
550
552
551 file:models.py, to search for file paths, scoped to repositories or groups
553 file:models.py, to search for file paths, scoped to repositories or groups
552
554
553 % if c.template_context['search_context']['repo_id']:
555 % if c.template_context['search_context']['repo_id']:
554 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
556 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
555 % elif c.template_context['search_context']['repo_group_id']:
557 % elif c.template_context['search_context']['repo_group_id']:
556 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
558 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
557 % else:
559 % else:
558 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
560 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
559 % endif
561 % endif
560 </div>
562 </div>
561 </li>
563 </li>
562
564
563 ## ROOT MENU
565 ## ROOT MENU
564 <li class="${is_active('home')}">
566 <li class="${is_active('home')}">
565 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
567 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
566 <div class="menulabel">${_('Home')}</div>
568 <div class="menulabel">${_('Home')}</div>
567 </a>
569 </a>
568 </li>
570 </li>
569
571
570 %if c.rhodecode_user.username != h.DEFAULT_USER:
572 %if c.rhodecode_user.username != h.DEFAULT_USER:
571 <li class="${is_active('journal')}">
573 <li class="${is_active('journal')}">
572 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
574 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
573 <div class="menulabel">${_('Journal')}</div>
575 <div class="menulabel">${_('Journal')}</div>
574 </a>
576 </a>
575 </li>
577 </li>
576 %else:
578 %else:
577 <li class="${is_active('journal')}">
579 <li class="${is_active('journal')}">
578 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
580 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
579 <div class="menulabel">${_('Public journal')}</div>
581 <div class="menulabel">${_('Public journal')}</div>
580 </a>
582 </a>
581 </li>
583 </li>
582 %endif
584 %endif
583
585
584 <li class="${is_active('gists')}">
586 <li class="${is_active('gists')}">
585 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
587 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
586 <div class="menulabel">${_('Gists')}</div>
588 <div class="menulabel">${_('Gists')}</div>
587 </a>
589 </a>
588 </li>
590 </li>
589
591
590 <li class="${is_active('admin')}">
592 <li class="${is_active('admin')}">
591 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
593 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
592 <div class="menulabel">${_('Admin')} </div>
594 <div class="menulabel">${_('Admin')} </div>
593 </a>
595 </a>
594 </li>
596 </li>
595
597
596 ## render extra user menu
598 ## render extra user menu
597 ${usermenu(active=(active=='my_account'))}
599 ${usermenu(active=(active=='my_account'))}
598
600
599 % if c.debug_style:
601 % if c.debug_style:
600 <li>
602 <li>
601 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
603 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
602 <div class="menulabel">${_('[Style]')}</div>
604 <div class="menulabel">${_('[Style]')}</div>
603 </a>
605 </a>
604 </li>
606 </li>
605 % endif
607 % endif
606 </ul>
608 </ul>
607
609
608 <script type="text/javascript">
610 <script type="text/javascript">
609 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
611 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
610
612
611 var formatRepoResult = function(result, container, query, escapeMarkup) {
613 var formatRepoResult = function(result, container, query, escapeMarkup) {
612 return function(data, escapeMarkup) {
614 return function(data, escapeMarkup) {
613 if (!data.repo_id){
615 if (!data.repo_id){
614 return data.text; // optgroup text Repositories
616 return data.text; // optgroup text Repositories
615 }
617 }
616
618
617 var tmpl = '';
619 var tmpl = '';
618 var repoType = data['repo_type'];
620 var repoType = data['repo_type'];
619 var repoName = data['text'];
621 var repoName = data['text'];
620
622
621 if(data && data.type == 'repo'){
623 if(data && data.type == 'repo'){
622 if(repoType === 'hg'){
624 if(repoType === 'hg'){
623 tmpl += '<i class="icon-hg"></i> ';
625 tmpl += '<i class="icon-hg"></i> ';
624 }
626 }
625 else if(repoType === 'git'){
627 else if(repoType === 'git'){
626 tmpl += '<i class="icon-git"></i> ';
628 tmpl += '<i class="icon-git"></i> ';
627 }
629 }
628 else if(repoType === 'svn'){
630 else if(repoType === 'svn'){
629 tmpl += '<i class="icon-svn"></i> ';
631 tmpl += '<i class="icon-svn"></i> ';
630 }
632 }
631 if(data['private']){
633 if(data['private']){
632 tmpl += '<i class="icon-lock" ></i> ';
634 tmpl += '<i class="icon-lock" ></i> ';
633 }
635 }
634 else if(visualShowPublicIcon){
636 else if(visualShowPublicIcon){
635 tmpl += '<i class="icon-unlock-alt"></i> ';
637 tmpl += '<i class="icon-unlock-alt"></i> ';
636 }
638 }
637 }
639 }
638 tmpl += escapeMarkup(repoName);
640 tmpl += escapeMarkup(repoName);
639 return tmpl;
641 return tmpl;
640
642
641 }(result, escapeMarkup);
643 }(result, escapeMarkup);
642 };
644 };
643
645
644 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
646 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
645 return function(data, escapeMarkup) {
647 return function(data, escapeMarkup) {
646 if (!data.repo_group_id){
648 if (!data.repo_group_id){
647 return data.text; // optgroup text Repositories
649 return data.text; // optgroup text Repositories
648 }
650 }
649
651
650 var tmpl = '';
652 var tmpl = '';
651 var repoGroupName = data['text'];
653 var repoGroupName = data['text'];
652
654
653 if(data){
655 if(data){
654
656
655 tmpl += '<i class="icon-folder-close"></i> ';
657 tmpl += '<i class="icon-folder-close"></i> ';
656
658
657 }
659 }
658 tmpl += escapeMarkup(repoGroupName);
660 tmpl += escapeMarkup(repoGroupName);
659 return tmpl;
661 return tmpl;
660
662
661 }(result, escapeMarkup);
663 }(result, escapeMarkup);
662 };
664 };
663
665
664 var escapeRegExChars = function (value) {
666 var escapeRegExChars = function (value) {
665 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
667 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
666 };
668 };
667
669
668 var getRepoIcon = function(repo_type) {
670 var getRepoIcon = function(repo_type) {
669 if (repo_type === 'hg') {
671 if (repo_type === 'hg') {
670 return '<i class="icon-hg"></i> ';
672 return '<i class="icon-hg"></i> ';
671 }
673 }
672 else if (repo_type === 'git') {
674 else if (repo_type === 'git') {
673 return '<i class="icon-git"></i> ';
675 return '<i class="icon-git"></i> ';
674 }
676 }
675 else if (repo_type === 'svn') {
677 else if (repo_type === 'svn') {
676 return '<i class="icon-svn"></i> ';
678 return '<i class="icon-svn"></i> ';
677 }
679 }
678 return ''
680 return ''
679 };
681 };
680
682
681 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
683 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
682
684
683 if (value.split(':').length === 2) {
685 if (value.split(':').length === 2) {
684 value = value.split(':')[1]
686 value = value.split(':')[1]
685 }
687 }
686
688
687 var searchType = data['type'];
689 var searchType = data['type'];
688 var valueDisplay = data['value_display'];
690 var valueDisplay = data['value_display'];
689
691
690 var pattern = '(' + escapeRegExChars(value) + ')';
692 var pattern = '(' + escapeRegExChars(value) + ')';
691
693
692 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
694 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
693
695
694 // highlight match
696 // highlight match
695 if (searchType != 'text') {
697 if (searchType != 'text') {
696 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
698 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
697 }
699 }
698
700
699 var icon = '';
701 var icon = '';
700
702
701 if (searchType === 'hint') {
703 if (searchType === 'hint') {
702 icon += '<i class="icon-folder-close"></i> ';
704 icon += '<i class="icon-folder-close"></i> ';
703 }
705 }
704 // full text search
706 // full text search
705 else if (searchType === 'search') {
707 else if (searchType === 'search') {
706 icon += '<i class="icon-more"></i> ';
708 icon += '<i class="icon-more"></i> ';
707 }
709 }
708 // repository
710 // repository
709 else if (searchType === 'repo') {
711 else if (searchType === 'repo') {
710
712
711 var repoIcon = getRepoIcon(data['repo_type']);
713 var repoIcon = getRepoIcon(data['repo_type']);
712 icon += repoIcon;
714 icon += repoIcon;
713
715
714 if (data['private']) {
716 if (data['private']) {
715 icon += '<i class="icon-lock" ></i> ';
717 icon += '<i class="icon-lock" ></i> ';
716 }
718 }
717 else if (visualShowPublicIcon) {
719 else if (visualShowPublicIcon) {
718 icon += '<i class="icon-unlock-alt"></i> ';
720 icon += '<i class="icon-unlock-alt"></i> ';
719 }
721 }
720 }
722 }
721 // repository groups
723 // repository groups
722 else if (searchType === 'repo_group') {
724 else if (searchType === 'repo_group') {
723 icon += '<i class="icon-folder-close"></i> ';
725 icon += '<i class="icon-folder-close"></i> ';
724 }
726 }
725 // user group
727 // user group
726 else if (searchType === 'user_group') {
728 else if (searchType === 'user_group') {
727 icon += '<i class="icon-group"></i> ';
729 icon += '<i class="icon-group"></i> ';
728 }
730 }
729 // user
731 // user
730 else if (searchType === 'user') {
732 else if (searchType === 'user') {
731 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
733 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
732 }
734 }
733 // commit
735 // commit
734 else if (searchType === 'commit') {
736 else if (searchType === 'commit') {
735 var repo_data = data['repo_data'];
737 var repo_data = data['repo_data'];
736 var repoIcon = getRepoIcon(repo_data['repository_type']);
738 var repoIcon = getRepoIcon(repo_data['repository_type']);
737 if (repoIcon) {
739 if (repoIcon) {
738 icon += repoIcon;
740 icon += repoIcon;
739 } else {
741 } else {
740 icon += '<i class="icon-tag"></i>';
742 icon += '<i class="icon-tag"></i>';
741 }
743 }
742 }
744 }
743 // file
745 // file
744 else if (searchType === 'file') {
746 else if (searchType === 'file') {
745 var repo_data = data['repo_data'];
747 var repo_data = data['repo_data'];
746 var repoIcon = getRepoIcon(repo_data['repository_type']);
748 var repoIcon = getRepoIcon(repo_data['repository_type']);
747 if (repoIcon) {
749 if (repoIcon) {
748 icon += repoIcon;
750 icon += repoIcon;
749 } else {
751 } else {
750 icon += '<i class="icon-tag"></i>';
752 icon += '<i class="icon-tag"></i>';
751 }
753 }
752 }
754 }
753 // generic text
755 // generic text
754 else if (searchType === 'text') {
756 else if (searchType === 'text') {
755 icon = '';
757 icon = '';
756 }
758 }
757
759
758 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
760 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
759 return tmpl.format(icon, valueDisplay);
761 return tmpl.format(icon, valueDisplay);
760 };
762 };
761
763
762 var handleSelect = function(element, suggestion) {
764 var handleSelect = function(element, suggestion) {
763 if (suggestion.type === "hint") {
765 if (suggestion.type === "hint") {
764 // we skip action
766 // we skip action
765 $('#main_filter').focus();
767 $('#main_filter').focus();
766 }
768 }
767 else if (suggestion.type === "text") {
769 else if (suggestion.type === "text") {
768 // we skip action
770 // we skip action
769 $('#main_filter').focus();
771 $('#main_filter').focus();
770
772
771 } else {
773 } else {
772 window.location = suggestion['url'];
774 window.location = suggestion['url'];
773 }
775 }
774 };
776 };
775
777
776 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
778 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
777 if (queryLowerCase.split(':').length === 2) {
779 if (queryLowerCase.split(':').length === 2) {
778 queryLowerCase = queryLowerCase.split(':')[1]
780 queryLowerCase = queryLowerCase.split(':')[1]
779 }
781 }
780 if (suggestion.type === "text") {
782 if (suggestion.type === "text") {
781 // special case we don't want to "skip" display for
783 // special case we don't want to "skip" display for
782 return true
784 return true
783 }
785 }
784 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
786 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
785 };
787 };
786
788
787 var cleanContext = {
789 var cleanContext = {
788 repo_view_type: null,
790 repo_view_type: null,
789
791
790 repo_id: null,
792 repo_id: null,
791 repo_name: "",
793 repo_name: "",
792
794
793 repo_group_id: null,
795 repo_group_id: null,
794 repo_group_name: null
796 repo_group_name: null
795 };
797 };
796 var removeGoToFilter = function () {
798 var removeGoToFilter = function () {
797 $('.searchTagHidable').hide();
799 $('.searchTagHidable').hide();
798 $('#main_filter').autocomplete(
800 $('#main_filter').autocomplete(
799 'setOptions', {params:{search_context: cleanContext}});
801 'setOptions', {params:{search_context: cleanContext}});
800 };
802 };
801
803
802 $('#main_filter').autocomplete({
804 $('#main_filter').autocomplete({
803 serviceUrl: pyroutes.url('goto_switcher_data'),
805 serviceUrl: pyroutes.url('goto_switcher_data'),
804 params: {
806 params: {
805 "search_context": templateContext.search_context
807 "search_context": templateContext.search_context
806 },
808 },
807 minChars:2,
809 minChars:2,
808 maxHeight:400,
810 maxHeight:400,
809 deferRequestBy: 300, //miliseconds
811 deferRequestBy: 300, //miliseconds
810 tabDisabled: true,
812 tabDisabled: true,
811 autoSelectFirst: false,
813 autoSelectFirst: false,
812 formatResult: autocompleteMainFilterFormatResult,
814 formatResult: autocompleteMainFilterFormatResult,
813 lookupFilter: autocompleteMainFilterResult,
815 lookupFilter: autocompleteMainFilterResult,
814 onSelect: function (element, suggestion) {
816 onSelect: function (element, suggestion) {
815 handleSelect(element, suggestion);
817 handleSelect(element, suggestion);
816 return false;
818 return false;
817 },
819 },
818 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
820 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
819 if (jqXHR !== 'abort') {
821 if (jqXHR !== 'abort') {
820 alert("Error during search.\nError code: {0}".format(textStatus));
822 alert("Error during search.\nError code: {0}".format(textStatus));
821 window.location = '';
823 window.location = '';
822 }
824 }
823 }
825 }
824 });
826 });
825
827
826 showMainFilterBox = function () {
828 showMainFilterBox = function () {
827 $('#main_filter_help').toggle();
829 $('#main_filter_help').toggle();
828 };
830 };
829
831
830 $('#main_filter').on('keydown.autocomplete', function (e) {
832 $('#main_filter').on('keydown.autocomplete', function (e) {
831
833
832 var BACKSPACE = 8;
834 var BACKSPACE = 8;
833 var el = $(e.currentTarget);
835 var el = $(e.currentTarget);
834 if(e.which === BACKSPACE){
836 if(e.which === BACKSPACE){
835 var inputVal = el.val();
837 var inputVal = el.val();
836 if (inputVal === ""){
838 if (inputVal === ""){
837 removeGoToFilter()
839 removeGoToFilter()
838 }
840 }
839 }
841 }
840 });
842 });
841
843
842 </script>
844 </script>
843 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
845 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
844 </%def>
846 </%def>
845
847
846 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
848 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
847 <div class="modal-dialog">
849 <div class="modal-dialog">
848 <div class="modal-content">
850 <div class="modal-content">
849 <div class="modal-header">
851 <div class="modal-header">
850 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
852 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
851 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
853 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
852 </div>
854 </div>
853 <div class="modal-body">
855 <div class="modal-body">
854 <div class="block-left">
856 <div class="block-left">
855 <table class="keyboard-mappings">
857 <table class="keyboard-mappings">
856 <tbody>
858 <tbody>
857 <tr>
859 <tr>
858 <th></th>
860 <th></th>
859 <th>${_('Site-wide shortcuts')}</th>
861 <th>${_('Site-wide shortcuts')}</th>
860 </tr>
862 </tr>
861 <%
863 <%
862 elems = [
864 elems = [
863 ('/', 'Use quick search box'),
865 ('/', 'Use quick search box'),
864 ('g h', 'Goto home page'),
866 ('g h', 'Goto home page'),
865 ('g g', 'Goto my private gists page'),
867 ('g g', 'Goto my private gists page'),
866 ('g G', 'Goto my public gists page'),
868 ('g G', 'Goto my public gists page'),
867 ('g 0-9', 'Goto bookmarked items from 0-9'),
869 ('g 0-9', 'Goto bookmarked items from 0-9'),
868 ('n r', 'New repository page'),
870 ('n r', 'New repository page'),
869 ('n g', 'New gist page'),
871 ('n g', 'New gist page'),
870 ]
872 ]
871 %>
873 %>
872 %for key, desc in elems:
874 %for key, desc in elems:
873 <tr>
875 <tr>
874 <td class="keys">
876 <td class="keys">
875 <span class="key tag">${key}</span>
877 <span class="key tag">${key}</span>
876 </td>
878 </td>
877 <td>${desc}</td>
879 <td>${desc}</td>
878 </tr>
880 </tr>
879 %endfor
881 %endfor
880 </tbody>
882 </tbody>
881 </table>
883 </table>
882 </div>
884 </div>
883 <div class="block-left">
885 <div class="block-left">
884 <table class="keyboard-mappings">
886 <table class="keyboard-mappings">
885 <tbody>
887 <tbody>
886 <tr>
888 <tr>
887 <th></th>
889 <th></th>
888 <th>${_('Repositories')}</th>
890 <th>${_('Repositories')}</th>
889 </tr>
891 </tr>
890 <%
892 <%
891 elems = [
893 elems = [
892 ('g s', 'Goto summary page'),
894 ('g s', 'Goto summary page'),
893 ('g c', 'Goto changelog page'),
895 ('g c', 'Goto changelog page'),
894 ('g f', 'Goto files page'),
896 ('g f', 'Goto files page'),
895 ('g F', 'Goto files page with file search activated'),
897 ('g F', 'Goto files page with file search activated'),
896 ('g p', 'Goto pull requests page'),
898 ('g p', 'Goto pull requests page'),
897 ('g o', 'Goto repository settings'),
899 ('g o', 'Goto repository settings'),
898 ('g O', 'Goto repository permissions settings'),
900 ('g O', 'Goto repository permissions settings'),
899 ]
901 ]
900 %>
902 %>
901 %for key, desc in elems:
903 %for key, desc in elems:
902 <tr>
904 <tr>
903 <td class="keys">
905 <td class="keys">
904 <span class="key tag">${key}</span>
906 <span class="key tag">${key}</span>
905 </td>
907 </td>
906 <td>${desc}</td>
908 <td>${desc}</td>
907 </tr>
909 </tr>
908 %endfor
910 %endfor
909 </tbody>
911 </tbody>
910 </table>
912 </table>
911 </div>
913 </div>
912 </div>
914 </div>
913 <div class="modal-footer">
915 <div class="modal-footer">
914 </div>
916 </div>
915 </div><!-- /.modal-content -->
917 </div><!-- /.modal-content -->
916 </div><!-- /.modal-dialog -->
918 </div><!-- /.modal-dialog -->
917 </div><!-- /.modal -->
919 </div><!-- /.modal -->
918
920
General Comments 0
You need to be logged in to leave comments. Login now