##// END OF EJS Templates
templates: use a single helper to select activated menu entries in templates.
marcink -
r4062:42f2ce8c default
parent child Browse files
Show More
@@ -2124,3 +2124,15 b' def get_repo_view_type(request):'
2124 }
2124 }
2125
2125
2126 return route_to_view_type.get(route_name)
2126 return route_to_view_type.get(route_name)
2127
2128
2129 def is_active(menu_entry, selected):
2130 """
2131 Returns active class for selecting menus in templates
2132 <li class=${h.is_active('settings', current_active)}></li>
2133 """
2134 if not isinstance(menu_entry, list):
2135 menu_entry = [menu_entry]
2136
2137 if selected in menu_entry:
2138 return "active"
@@ -29,7 +29,7 b''
29 <div class="sidebar-col-wrapper">
29 <div class="sidebar-col-wrapper">
30 <div class="sidebar">
30 <div class="sidebar">
31 <ul class="nav nav-pills nav-stacked">
31 <ul class="nav nav-pills nav-stacked">
32 <li class="${'active' if c.active=='repositories' else ''}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Repository')}</a></li>
32 <li class="${h.is_active('repositories', c.active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Repository')}</a></li>
33 </ul>
33 </ul>
34 </div>
34 </div>
35
35
@@ -27,13 +27,13 b''
27
27
28 <ul class="button-links">
28 <ul class="button-links">
29 % if c.is_super_admin:
29 % if c.is_super_admin:
30 <li class="btn ${('active' if c.active=='all' else '')}"><a href="${h.route_path('gists_show', _query={'all': 1})}">${_('All gists')}</a></li>
30 <li class="btn ${h.is_active('all', c.active)}"><a href="${h.route_path('gists_show', _query={'all': 1})}">${_('All gists')}</a></li>
31 %endif
31 %endif
32 <li class="btn ${('active' if c.active=='public' else '')}"><a href="${h.route_path('gists_show')}">${_('All public')}</a></li>
32 <li class="btn ${h.is_active('public', c.active)}"><a href="${h.route_path('gists_show')}">${_('All public')}</a></li>
33 %if c.rhodecode_user.username != h.DEFAULT_USER:
33 %if c.rhodecode_user.username != h.DEFAULT_USER:
34 <li class="btn ${('active' if c.active=='my_all' else '')}"><a href="${h.route_path('gists_show', _query={'public':1, 'private': 1})}">${_('My gists')}</a></li>
34 <li class="btn ${h.is_active('my_all', c.active)}"><a href="${h.route_path('gists_show', _query={'public':1, 'private': 1})}">${_('My gists')}</a></li>
35 <li class="btn ${('active' if c.active=='my_private' else '')}"><a href="${h.route_path('gists_show', _query={'private': 1})}">${_('My private')}</a></li>
35 <li class="btn ${h.is_active('my_private', c.active)}"><a href="${h.route_path('gists_show', _query={'private': 1})}">${_('My private')}</a></li>
36 <li class="btn ${('active' if c.active=='my_public' else '')}"><a href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
36 <li class="btn ${h.is_active('my_public', c.active)}"><a href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
37 %endif
37 %endif
38 </ul>
38 </ul>
39
39
@@ -26,25 +26,25 b''
26 ##main
26 ##main
27 <div class="sidebar">
27 <div class="sidebar">
28 <ul class="nav nav-pills nav-stacked">
28 <ul class="nav nav-pills nav-stacked">
29 <li class="${'active' if c.active=='profile' or c.active=='profile_edit' else ''}"><a href="${h.route_path('my_account_profile')}">${_('Profile')}</a></li>
29 <li class="${h.is_active(['profile', 'profile_edit'], c.active)}"><a href="${h.route_path('my_account_profile')}">${_('Profile')}</a></li>
30 <li class="${'active' if c.active=='emails' else ''}"><a href="${h.route_path('my_account_emails')}">${_('Emails')}</a></li>
30 <li class="${h.is_active('emails', c.active)}"><a href="${h.route_path('my_account_emails')}">${_('Emails')}</a></li>
31 <li class="${'active' if c.active=='password' else ''}"><a href="${h.route_path('my_account_password')}">${_('Password')}</a></li>
31 <li class="${h.is_active('password', c.active)}"><a href="${h.route_path('my_account_password')}">${_('Password')}</a></li>
32 <li class="${'active' if c.active=='bookmarks' else ''}"><a href="${h.route_path('my_account_bookmarks')}">${_('Bookmarks')}</a></li>
32 <li class="${h.is_active('bookmarks', c.active)}"><a href="${h.route_path('my_account_bookmarks')}">${_('Bookmarks')}</a></li>
33 <li class="${'active' if c.active=='auth_tokens' else ''}"><a href="${h.route_path('my_account_auth_tokens')}">${_('Auth Tokens')}</a></li>
33 <li class="${h.is_active('auth_tokens', c.active)}"><a href="${h.route_path('my_account_auth_tokens')}">${_('Auth Tokens')}</a></li>
34 <li class="${'active' if c.active in ['ssh_keys', 'ssh_keys_generate'] else ''}"><a href="${h.route_path('my_account_ssh_keys')}">${_('SSH Keys')}</a></li>
34 <li class="${h.is_active(['ssh_keys', 'ssh_keys_generate'], c.active)}"><a href="${h.route_path('my_account_ssh_keys')}">${_('SSH Keys')}</a></li>
35 <li class="${'active' if c.active=='user_group_membership' else ''}"><a href="${h.route_path('my_account_user_group_membership')}">${_('User Group Membership')}</a></li>
35 <li class="${h.is_active('user_group_membership', c.active)}"><a href="${h.route_path('my_account_user_group_membership')}">${_('User Group Membership')}</a></li>
36
36
37 ## TODO: Find a better integration of oauth/saml views into navigation.
37 ## TODO: Find a better integration of oauth/saml views into navigation.
38 <% my_account_external_url = h.route_path_or_none('my_account_external_identity') %>
38 <% my_account_external_url = h.route_path_or_none('my_account_external_identity') %>
39 % if my_account_external_url:
39 % if my_account_external_url:
40 <li class="${'active' if c.active=='external_identity' else ''}"><a href="${my_account_external_url}">${_('External Identities')}</a></li>
40 <li class="${h.is_active('external_identity', c.active)}"><a href="${my_account_external_url}">${_('External Identities')}</a></li>
41 % endif
41 % endif
42
42
43 <li class="${'active' if c.active=='repos' else ''}"><a href="${h.route_path('my_account_repos')}">${_('Repositories')}</a></li>
43 <li class="${h.is_active('repos', c.active)}"><a href="${h.route_path('my_account_repos')}">${_('Repositories')}</a></li>
44 <li class="${'active' if c.active=='watched' else ''}"><a href="${h.route_path('my_account_watched')}">${_('Watched')}</a></li>
44 <li class="${h.is_active('watched', c.active)}"><a href="${h.route_path('my_account_watched')}">${_('Watched')}</a></li>
45 <li class="${'active' if c.active=='pullrequests' else ''}"><a href="${h.route_path('my_account_pullrequests')}">${_('Pull Requests')}</a></li>
45 <li class="${h.is_active('pullrequests', c.active)}"><a href="${h.route_path('my_account_pullrequests')}">${_('Pull Requests')}</a></li>
46 <li class="${'active' if c.active=='perms' else ''}"><a href="${h.route_path('my_account_perms')}">${_('Permissions')}</a></li>
46 <li class="${h.is_active('perms', c.active)}"><a href="${h.route_path('my_account_perms')}">${_('Permissions')}</a></li>
47 <li class="${'active' if c.active=='my_notifications' else ''}"><a href="${h.route_path('my_account_notifications')}">${_('Live Notifications')}</a></li>
47 <li class="${h.is_active('my_notifications', c.active)}"><a href="${h.route_path('my_account_notifications')}">${_('Live Notifications')}</a></li>
48 </ul>
48 </ul>
49 </div>
49 </div>
50
50
@@ -29,28 +29,28 b''
29 ##main
29 ##main
30 <div class="sidebar">
30 <div class="sidebar">
31 <ul class="nav nav-pills nav-stacked">
31 <ul class="nav nav-pills nav-stacked">
32 <li class="${'active' if c.active=='application' else ''}">
32 <li class="${h.is_active('application', c.active)}">
33 <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a>
33 <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a>
34 </li>
34 </li>
35 <li class="${'active' if c.active=='global' else ''}">
35 <li class="${h.is_active('global', c.active)}">
36 <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a>
36 <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a>
37 </li>
37 </li>
38 <li class="${'active' if c.active=='objects' else ''}">
38 <li class="${h.is_active('objects', c.active)}">
39 <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a>
39 <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a>
40 </li>
40 </li>
41 <li class="${'active' if c.active=='branch' else ''}">
41 <li class="${h.is_active('branch', c.active)}">
42 <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a>
42 <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a>
43 </li>
43 </li>
44 <li class="${'active' if c.active=='ips' else ''}">
44 <li class="${h.is_active('ips', c.active)}">
45 <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a>
45 <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a>
46 </li>
46 </li>
47 <li class="${'active' if c.active=='auth_token_access' else ''}">
47 <li class="${h.is_active('auth_token_access', c.active)}">
48 <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a>
48 <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a>
49 </li>
49 </li>
50 <li class="${'active' if c.active=='ssh_keys' else ''}">
50 <li class="${h.is_active('ssh_keys', c.active)}">
51 <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a>
51 <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a>
52 </li>
52 </li>
53 <li class="${'active' if c.active=='perms' else ''}">
53 <li class="${h.is_active('perms', c.active)}">
54 <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a>
54 <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a>
55 </li>
55 </li>
56 </ul>
56 </ul>
@@ -27,10 +27,10 b''
27 ##main
27 ##main
28 <div class="sidebar">
28 <div class="sidebar">
29 <ul class="nav nav-pills nav-stacked">
29 <ul class="nav nav-pills nav-stacked">
30 <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>
30 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name)}">${_('Settings')}</a></li>
31 <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>
31 <li class="${h.is_active('permissions', c.active)}"><a href="${h.route_path('edit_repo_group_perms', repo_group_name=c.repo_group.group_name)}">${_('Permissions')}</a></li>
32 <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>
32 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_repo_group_advanced', repo_group_name=c.repo_group.group_name)}">${_('Advanced')}</a></li>
33 <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>
33 <li class="${h.is_active('integrations', c.active)}"><a href="${h.route_path('repo_group_integrations_home', repo_group_name=c.repo_group.group_name)}">${_('Integrations')}</a></li>
34 </ul>
34 </ul>
35 </div>
35 </div>
36
36
@@ -5,7 +5,7 b''
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 ${_('{} repository settings').format(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
@@ -38,56 +38,56 b''
38 <div class="sidebar-col-wrapper scw-small">
38 <div class="sidebar-col-wrapper scw-small">
39 <div class="sidebar">
39 <div class="sidebar">
40 <ul class="nav nav-pills nav-stacked">
40 <ul class="nav nav-pills nav-stacked">
41 <li class="${'active' if c.active=='settings' else ''}">
41 <li class="${h.is_active('settings', c.active)}">
42 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
42 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
43 </li>
43 </li>
44 <li class="${'active' if c.active=='permissions' else ''}">
44 <li class="${h.is_active('permissions', c.active)}">
45 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a>
45 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Access Permissions')}</a>
46 </li>
46 </li>
47 <li class="${'active' if c.active=='permissions_branch' else ''}">
47 <li class="${h.is_active('permissions_branch', c.active)}">
48 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
48 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
49 </li>
49 </li>
50 <li class="${'active' if c.active=='advanced' else ''}">
50 <li class="${h.is_active('advanced', c.active)}">
51 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
51 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
52 </li>
52 </li>
53 <li class="${'active' if c.active=='vcs' else ''}">
53 <li class="${h.is_active('vcs', c.active)}">
54 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
54 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
55 </li>
55 </li>
56 <li class="${'active' if c.active=='fields' else ''}">
56 <li class="${h.is_active('fields', c.active)}">
57 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
57 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
58 </li>
58 </li>
59 <li class="${'active' if c.active=='issuetracker' else ''}">
59 <li class="${h.is_active('issuetracker', c.active)}">
60 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
60 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
61 </li>
61 </li>
62 <li class="${'active' if c.active=='caches' else ''}">
62 <li class="${h.is_active('caches', c.active)}">
63 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
63 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
64 </li>
64 </li>
65 %if c.rhodecode_db_repo.repo_type != 'svn':
65 %if c.rhodecode_db_repo.repo_type != 'svn':
66 <li class="${'active' if c.active=='remote' else ''}">
66 <li class="${h.is_active('remote', c.active)}">
67 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
67 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
68 </li>
68 </li>
69 %endif
69 %endif
70 <li class="${'active' if c.active=='statistics' else ''}">
70 <li class="${h.is_active('statistics', c.active)}">
71 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
71 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
72 </li>
72 </li>
73 <li class="${'active' if c.active=='integrations' else ''}">
73 <li class="${h.is_active('integrations', c.active)}">
74 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
74 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
75 </li>
75 </li>
76 %if c.rhodecode_db_repo.repo_type != 'svn':
76 %if c.rhodecode_db_repo.repo_type != 'svn':
77 <li class="${'active' if c.active=='reviewers' else ''}">
77 <li class="${h.is_active('reviewers', c.active)}">
78 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
78 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
79 </li>
79 </li>
80 %endif
80 %endif
81 <li class="${'active' if c.active=='automation' else ''}">
81 <li class="${h.is_active('automation', c.active)}">
82 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
82 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
83 </li>
83 </li>
84 <li class="${'active' if c.active=='maintenance' else ''}">
84 <li class="${h.is_active('maintenance', c.active)}">
85 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
85 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
86 </li>
86 </li>
87 <li class="${'active' if c.active=='strip' else ''}">
87 <li class="${h.is_active('strip', c.active)}">
88 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
88 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
89 </li>
89 </li>
90 <li class="${'active' if c.active=='audit' else ''}">
90 <li class="${h.is_active('audit', c.active)}">
91 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
91 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
92 </li>
92 </li>
93
93
@@ -24,7 +24,7 b''
24
24
25 <%def name="side_bar_nav()">
25 <%def name="side_bar_nav()">
26 % for navitem in c.navlist:
26 % for navitem in c.navlist:
27 <li class="${'active' if c.active in navitem.active_list else ''}">
27 <li class="${h.is_active(navitem.active_list, c.active)}">
28 <a href="${navitem.url}">${navitem.name}</a>
28 <a href="${navitem.url}">${navitem.name}</a>
29 </li>
29 </li>
30 % endfor
30 % endfor
@@ -2,7 +2,7 b''
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('%s user group settings') % c.user_group.users_group_name}
5 ${_('{} user group settings').format(c.user_group.users_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
@@ -31,11 +31,11 b''
31 <div class="sidebar-col-wrapper">
31 <div class="sidebar-col-wrapper">
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_user_group', user_group_id=c.user_group.users_group_id)}">${_('Settings')}</a></li>
34 <li class="${h.is_active('settings', c.active)}"><a href="${h.route_path('edit_user_group', user_group_id=c.user_group.users_group_id)}">${_('Settings')}</a></li>
35 <li class="${'active' if c.active=='perms' else ''}"><a href="${h.route_path('edit_user_group_perms', user_group_id=c.user_group.users_group_id)}">${_('Permissions')}</a></li>
35 <li class="${h.is_active('perms', c.active)}"><a href="${h.route_path('edit_user_group_perms', user_group_id=c.user_group.users_group_id)}">${_('Permissions')}</a></li>
36 <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.route_path('edit_user_group_advanced', user_group_id=c.user_group.users_group_id)}">${_('Advanced')}</a></li>
36 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('edit_user_group_advanced', user_group_id=c.user_group.users_group_id)}">${_('Advanced')}</a></li>
37 <li class="${'active' if c.active=='global_perms' else ''}"><a href="${h.route_path('edit_user_group_global_perms', user_group_id=c.user_group.users_group_id)}">${_('Global permissions')}</a></li>
37 <li class="${h.is_active('global_perms', c.active)}"><a href="${h.route_path('edit_user_group_global_perms', user_group_id=c.user_group.users_group_id)}">${_('Global permissions')}</a></li>
38 <li class="${'active' if c.active=='perms_summary' else ''}"><a href="${h.route_path('edit_user_group_perms_summary', user_group_id=c.user_group.users_group_id)}">${_('Permissions summary')}</a></li>
38 <li class="${h.is_active('perms_summary', c.active)}"><a href="${h.route_path('edit_user_group_perms_summary', user_group_id=c.user_group.users_group_id)}">${_('Permissions summary')}</a></li>
39 </ul>
39 </ul>
40 </div>
40 </div>
41
41
@@ -2,7 +2,7 b''
2 <%inherit file="/base/base.mako"/>
2 <%inherit file="/base/base.mako"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('%s user settings') % c.user.username}
5 ${_('{} user settings').format(c.user.username)}
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
@@ -36,17 +36,17 b''
36 <div class="sidebar-col-wrapper">
36 <div class="sidebar-col-wrapper">
37 <div class="sidebar">
37 <div class="sidebar">
38 <ul class="nav nav-pills nav-stacked">
38 <ul class="nav nav-pills nav-stacked">
39 <li class="${'active' if c.active=='profile' else ''}"><a href="${h.route_path('user_edit', user_id=c.user.user_id)}">${_('User Profile')}</a></li>
39 <li class="${h.is_active('profile', c.active)}"><a href="${h.route_path('user_edit', user_id=c.user.user_id)}">${_('User Profile')}</a></li>
40 <li class="${'active' if c.active=='auth_tokens' else ''}"><a href="${h.route_path('edit_user_auth_tokens', user_id=c.user.user_id)}">${_('Auth tokens')}</a></li>
40 <li class="${h.is_active('auth_tokens', c.active)}"><a href="${h.route_path('edit_user_auth_tokens', user_id=c.user.user_id)}">${_('Auth tokens')}</a></li>
41 <li class="${'active' if c.active in ['ssh_keys','ssh_keys_generate'] else ''}"><a href="${h.route_path('edit_user_ssh_keys', user_id=c.user.user_id)}">${_('SSH Keys')}</a></li>
41 <li class="${h.is_active(['ssh_keys','ssh_keys_generate'], c.active)}"><a href="${h.route_path('edit_user_ssh_keys', user_id=c.user.user_id)}">${_('SSH Keys')}</a></li>
42 <li class="${'active' if c.active=='advanced' else ''}"><a href="${h.route_path('user_edit_advanced', user_id=c.user.user_id)}">${_('Advanced')}</a></li>
42 <li class="${h.is_active('advanced', c.active)}"><a href="${h.route_path('user_edit_advanced', user_id=c.user.user_id)}">${_('Advanced')}</a></li>
43 <li class="${'active' if c.active=='global_perms' else ''}"><a href="${h.route_path('user_edit_global_perms', user_id=c.user.user_id)}">${_('Global permissions')}</a></li>
43 <li class="${h.is_active('global_perms', c.active)}"><a href="${h.route_path('user_edit_global_perms', user_id=c.user.user_id)}">${_('Global permissions')}</a></li>
44 <li class="${'active' if c.active=='perms_summary' else ''}"><a href="${h.route_path('edit_user_perms_summary', user_id=c.user.user_id)}">${_('Permissions summary')}</a></li>
44 <li class="${h.is_active('perms_summary', c.active)}"><a href="${h.route_path('edit_user_perms_summary', user_id=c.user.user_id)}">${_('Permissions summary')}</a></li>
45 <li class="${'active' if c.active=='emails' else ''}"><a href="${h.route_path('edit_user_emails', user_id=c.user.user_id)}">${_('Emails')}</a></li>
45 <li class="${h.is_active('emails', c.active)}"><a href="${h.route_path('edit_user_emails', user_id=c.user.user_id)}">${_('Emails')}</a></li>
46 <li class="${'active' if c.active=='ips' else ''}"><a href="${h.route_path('edit_user_ips', user_id=c.user.user_id)}">${_('Ip Whitelist')}</a></li>
46 <li class="${h.is_active('ips', c.active)}"><a href="${h.route_path('edit_user_ips', user_id=c.user.user_id)}">${_('Ip Whitelist')}</a></li>
47 <li class="${'active' if c.active=='groups' else ''}"><a href="${h.route_path('edit_user_groups_management', user_id=c.user.user_id)}">${_('User Groups Management')}</a></li>
47 <li class="${h.is_active('groups', c.active)}"><a href="${h.route_path('edit_user_groups_management', user_id=c.user.user_id)}">${_('User Groups Management')}</a></li>
48 <li class="${'active' if c.active=='audit' else ''}"><a href="${h.route_path('edit_user_audit_logs', user_id=c.user.user_id)}">${_('Audit logs')}</a></li>
48 <li class="${h.is_active('audit', c.active)}"><a href="${h.route_path('edit_user_audit_logs', user_id=c.user.user_id)}">${_('Audit logs')}</a></li>
49 <li class="${'active' if c.active=='caches' else ''}"><a href="${h.route_path('edit_user_caches', user_id=c.user.user_id)}">${_('Caches')}</a></li>
49 <li class="${h.is_active('caches', c.active)}"><a href="${h.route_path('edit_user_caches', user_id=c.user.user_id)}">${_('Caches')}</a></li>
50 </ul>
50 </ul>
51 </div>
51 </div>
52
52
@@ -1,7 +1,7 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2
2
3 ## base64 filter
4 <%!
3 <%!
4 ## base64 filter e.g ${ example | base64 }
5 def base64(text):
5 def base64(text):
6 import base64
6 import base64
7 from rhodecode.lib.helpers import safe_str
7 from rhodecode.lib.helpers import safe_str
@@ -84,11 +84,6 b''
84 </%def>
84 </%def>
85
85
86 <%def name="admin_menu(active=None)">
86 <%def name="admin_menu(active=None)">
87 <%
88 def is_active(selected):
89 if selected == active:
90 return "active"
91 %>
92
87
93 <div id="context-bar">
88 <div id="context-bar">
94 <div class="wrapper">
89 <div class="wrapper">
@@ -108,16 +103,16 b''
108
103
109 ## super admin case
104 ## super admin case
110 % if c.is_super_admin:
105 % if c.is_super_admin:
111 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
106 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
112 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
107 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
113 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
108 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
114 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
109 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
115 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
110 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
116 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
111 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
117 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
112 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
118 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
113 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
119 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
114 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
120 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
115 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
121
116
122 ## delegated admin
117 ## delegated admin
123 % elif c.is_delegated_admin:
118 % elif c.is_delegated_admin:
@@ -128,13 +123,13 b''
128 %>
123 %>
129
124
130 %if repositories:
125 %if repositories:
131 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
126 <li class="${h.is_active('repositories', active)} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
132 %endif
127 %endif
133 %if repository_groups:
128 %if repository_groups:
134 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
129 <li class="${h.is_active('repository_groups', active)} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
135 %endif
130 %endif
136 %if user_groups:
131 %if user_groups:
137 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
132 <li class="${h.is_active('user_groups', active)} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
138 %endif
133 %endif
139 % endif
134 % endif
140 </ul>
135 </ul>
@@ -347,9 +342,6 b''
347
342
348 <%def name="repo_menu(active=None)">
343 <%def name="repo_menu(active=None)">
349 <%
344 <%
350 def is_active(selected):
351 if selected == active:
352 return "active"
353 ## determine if we have "any" option available
345 ## determine if we have "any" option available
354 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
346 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
355 has_actions = can_lock
347 has_actions = can_lock
@@ -370,14 +362,14 b''
370 </div>
362 </div>
371
363
372 <ul id="context-pages" class="navigation horizontal-list">
364 <ul id="context-pages" class="navigation horizontal-list">
373 <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>
365 <li class="${h.is_active('summary', active)}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
374 <li class="${is_active('commits')}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
366 <li class="${h.is_active('commits', active)}"><a class="menulink" href="${h.route_path('repo_commits', repo_name=c.repo_name)}"><div class="menulabel">${_('Commits')}</div></a></li>
375 <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>
367 <li class="${h.is_active('files', active)}"><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>
376 <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>
368 <li class="${h.is_active('compare', active)}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li>
377
369
378 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
370 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
379 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
371 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
380 <li class="${is_active('showpullrequest')}">
372 <li class="${h.is_active('showpullrequest', active)}">
381 <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)}">
373 <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)}">
382 <div class="menulabel">
374 <div class="menulabel">
383 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
375 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
@@ -386,7 +378,7 b''
386 </li>
378 </li>
387 %endif
379 %endif
388
380
389 <li class="${is_active('artifacts')}">
381 <li class="${h.is_active('artifacts', active)}">
390 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
382 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
391 <div class="menulabel">
383 <div class="menulabel">
392 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
384 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
@@ -395,10 +387,10 b''
395 </li>
387 </li>
396
388
397 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
389 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
398 <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>
390 <li class="${h.is_active('settings', active)}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li>
399 %endif
391 %endif
400
392
401 <li class="${is_active('options')}">
393 <li class="${h.is_active('options', active)}">
402 % if has_actions:
394 % if has_actions:
403 <a class="menulink dropdown">
395 <a class="menulink dropdown">
404 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
396 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
@@ -449,10 +441,6 b''
449
441
450 <%def name="repo_group_menu(active=None)">
442 <%def name="repo_group_menu(active=None)">
451 <%
443 <%
452 def is_active(selected):
453 if selected == active:
454 return "active"
455
456 gr_name = c.repo_group.group_name if c.repo_group else None
444 gr_name = c.repo_group.group_name if c.repo_group else None
457 # create repositories with write permission on group is set to true
445 # create repositories with write permission on group is set to true
458 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
446 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
@@ -468,11 +456,11 b''
468 </div>
456 </div>
469
457
470 <ul id="context-pages" class="navigation horizontal-list">
458 <ul id="context-pages" class="navigation horizontal-list">
471 <li class="${is_active('home')}">
459 <li class="${h.is_active('home', active)}">
472 <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>
460 <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>
473 </li>
461 </li>
474 % if c.is_super_admin or group_admin:
462 % if c.is_super_admin or group_admin:
475 <li class="${is_active('settings')}">
463 <li class="${h.is_active('settings', active)}">
476 <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>
464 <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>
477 </li>
465 </li>
478 % endif
466 % endif
@@ -703,12 +691,6 b''
703 </%def>
691 </%def>
704
692
705 <%def name="menu_items(active=None)">
693 <%def name="menu_items(active=None)">
706 <%
707 def is_active(selected):
708 if selected == active:
709 return "active"
710 return ""
711 %>
712
694
713 <ul id="quick" class="main_nav navigation horizontal-list">
695 <ul id="quick" class="main_nav navigation horizontal-list">
714 ## notice box for important system messages
696 ## notice box for important system messages
@@ -782,34 +764,34 b''
782 </li>
764 </li>
783
765
784 ## ROOT MENU
766 ## ROOT MENU
785 <li class="${is_active('home')}">
767 <li class="${h.is_active('home', active)}">
786 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
768 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
787 <div class="menulabel">${_('Home')}</div>
769 <div class="menulabel">${_('Home')}</div>
788 </a>
770 </a>
789 </li>
771 </li>
790
772
791 %if c.rhodecode_user.username != h.DEFAULT_USER:
773 %if c.rhodecode_user.username != h.DEFAULT_USER:
792 <li class="${is_active('journal')}">
774 <li class="${h.is_active('journal', active)}">
793 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
775 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
794 <div class="menulabel">${_('Journal')}</div>
776 <div class="menulabel">${_('Journal')}</div>
795 </a>
777 </a>
796 </li>
778 </li>
797 %else:
779 %else:
798 <li class="${is_active('journal')}">
780 <li class="${h.is_active('journal', active)}">
799 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
781 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
800 <div class="menulabel">${_('Public journal')}</div>
782 <div class="menulabel">${_('Public journal')}</div>
801 </a>
783 </a>
802 </li>
784 </li>
803 %endif
785 %endif
804
786
805 <li class="${is_active('gists')}">
787 <li class="${h.is_active('gists', active)}">
806 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
788 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
807 <div class="menulabel">${_('Gists')}</div>
789 <div class="menulabel">${_('Gists')}</div>
808 </a>
790 </a>
809 </li>
791 </li>
810
792
811 % if c.is_super_admin or c.is_delegated_admin:
793 % if c.is_super_admin or c.is_delegated_admin:
812 <li class="${is_active('admin')}">
794 <li class="${h.is_active('admin', active)}">
813 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
795 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
814 <div class="menulabel">${_('Admin')} </div>
796 <div class="menulabel">${_('Admin')} </div>
815 </a>
797 </a>
@@ -1,7 +1,7 b''
1 <%inherit file="/base/base.mako"/>
1 <%inherit file="/base/base.mako"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${_('%s Pull Requests') % c.repo_name}
4 ${_('{} Pull Requests').format(c.repo_name)}
5 %if c.rhodecode_name:
5 %if c.rhodecode_name:
6 &middot; ${h.branding(c.rhodecode_name)}
6 &middot; ${h.branding(c.rhodecode_name)}
7 %endif
7 %endif
@@ -24,12 +24,12 b''
24 <div class="box">
24 <div class="box">
25 <div class="title">
25 <div class="title">
26 <ul class="button-links">
26 <ul class="button-links">
27 <li class="btn ${('active' if c.active=='open' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0})}">${_('Opened')}</a></li>
27 <li class="btn ${h.is_active('open', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0})}">${_('Opened')}</a></li>
28 <li class="btn ${('active' if c.active=='my' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'my':1})}">${_('Opened by me')}</a></li>
28 <li class="btn ${h.is_active('my', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'my':1})}">${_('Opened by me')}</a></li>
29 <li class="btn ${('active' if c.active=='awaiting' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_review':1})}">${_('Awaiting review')}</a></li>
29 <li class="btn ${h.is_active('awaiting', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_review':1})}">${_('Awaiting review')}</a></li>
30 <li class="btn ${('active' if c.active=='awaiting_my' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_my_review':1})}">${_('Awaiting my review')}</a></li>
30 <li class="btn ${h.is_active('awaiting_my', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'awaiting_my_review':1})}">${_('Awaiting my review')}</a></li>
31 <li class="btn ${('active' if c.active=='closed' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'closed':1})}">${_('Closed')}</a></li>
31 <li class="btn ${h.is_active('closed', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':0,'closed':1})}">${_('Closed')}</a></li>
32 <li class="btn ${('active' if c.active=='source' else '')}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':1})}">${_('From this repo')}</a></li>
32 <li class="btn ${h.is_active('source', c.active)}"><a href="${h.route_path('pullrequest_show_all',repo_name=c.repo_name, _query={'source':1})}">${_('From this repo')}</a></li>
33 </ul>
33 </ul>
34
34
35 <ul class="links">
35 <ul class="links">
General Comments 0
You need to be logged in to leave comments. Login now