##// 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 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 29 <div class="sidebar-col-wrapper">
30 30 <div class="sidebar">
31 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 33 </ul>
34 34 </div>
35 35
@@ -27,13 +27,13 b''
27 27
28 28 <ul class="button-links">
29 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 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 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>
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>
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>
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 ${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 ${h.is_active('my_public', c.active)}"><a href="${h.route_path('gists_show', _query={'public': 1})}">${_('My public')}</a></li>
37 37 %endif
38 38 </ul>
39 39
@@ -26,25 +26,25 b''
26 26 ##main
27 27 <div class="sidebar">
28 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>
30 <li class="${'active' if c.active=='emails' else ''}"><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>
32 <li class="${'active' if c.active=='bookmarks' else ''}"><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>
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>
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>
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="${h.is_active('emails', c.active)}"><a href="${h.route_path('my_account_emails')}">${_('Emails')}</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="${h.is_active('bookmarks', c.active)}"><a href="${h.route_path('my_account_bookmarks')}">${_('Bookmarks')}</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="${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="${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 37 ## TODO: Find a better integration of oauth/saml views into navigation.
38 38 <% my_account_external_url = h.route_path_or_none('my_account_external_identity') %>
39 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 41 % endif
42 42
43 <li class="${'active' if c.active=='repos' else ''}"><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>
45 <li class="${'active' if c.active=='pullrequests' else ''}"><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>
47 <li class="${'active' if c.active=='my_notifications' else ''}"><a href="${h.route_path('my_account_notifications')}">${_('Live Notifications')}</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="${h.is_active('watched', c.active)}"><a href="${h.route_path('my_account_watched')}">${_('Watched')}</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="${h.is_active('perms', c.active)}"><a href="${h.route_path('my_account_perms')}">${_('Permissions')}</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 48 </ul>
49 49 </div>
50 50
@@ -29,28 +29,28 b''
29 29 ##main
30 30 <div class="sidebar">
31 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 33 <a href="${h.route_path('admin_permissions_application')}">${_('Application')}</a>
34 34 </li>
35 <li class="${'active' if c.active=='global' else ''}">
35 <li class="${h.is_active('global', c.active)}">
36 36 <a href="${h.route_path('admin_permissions_global')}">${_('Global')}</a>
37 37 </li>
38 <li class="${'active' if c.active=='objects' else ''}">
38 <li class="${h.is_active('objects', c.active)}">
39 39 <a href="${h.route_path('admin_permissions_object')}">${_('Object')}</a>
40 40 </li>
41 <li class="${'active' if c.active=='branch' else ''}">
41 <li class="${h.is_active('branch', c.active)}">
42 42 <a href="${h.route_path('admin_permissions_branch')}">${_('Branch')}</a>
43 43 </li>
44 <li class="${'active' if c.active=='ips' else ''}">
44 <li class="${h.is_active('ips', c.active)}">
45 45 <a href="${h.route_path('admin_permissions_ips')}">${_('IP Whitelist')}</a>
46 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 48 <a href="${h.route_path('admin_permissions_auth_token_access')}">${_('AuthToken Access')}</a>
49 49 </li>
50 <li class="${'active' if c.active=='ssh_keys' else ''}">
50 <li class="${h.is_active('ssh_keys', c.active)}">
51 51 <a href="${h.route_path('admin_permissions_ssh_keys')}">${_('SSH Keys')}</a>
52 52 </li>
53 <li class="${'active' if c.active=='perms' else ''}">
53 <li class="${h.is_active('perms', c.active)}">
54 54 <a href="${h.route_path('admin_permissions_overview')}">${_('Overview')}</a>
55 55 </li>
56 56 </ul>
@@ -27,10 +27,10 b''
27 27 ##main
28 28 <div class="sidebar">
29 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>
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>
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>
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>
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="${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="${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="${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 34 </ul>
35 35 </div>
36 36
@@ -5,7 +5,7 b''
5 5 <%inherit file="/base/base.mako"/>
6 6
7 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 9 %if c.rhodecode_name:
10 10 &middot; ${h.branding(c.rhodecode_name)}
11 11 %endif
@@ -38,56 +38,56 b''
38 38 <div class="sidebar-col-wrapper scw-small">
39 39 <div class="sidebar">
40 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 42 <a href="${h.route_path('edit_repo', repo_name=c.repo_name)}">${_('Settings')}</a>
43 43 </li>
44 <li class="${'active' if c.active=='permissions' else ''}">
45 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Permissions')}</a>
44 <li class="${h.is_active('permissions', c.active)}">
45 <a href="${h.route_path('edit_repo_perms', repo_name=c.repo_name)}">${_('Access Permissions')}</a>
46 46 </li>
47 <li class="${'active' if c.active=='permissions_branch' else ''}">
47 <li class="${h.is_active('permissions_branch', c.active)}">
48 48 <a href="${h.route_path('edit_repo_perms_branch', repo_name=c.repo_name)}">${_('Branch Permissions')}</a>
49 49 </li>
50 <li class="${'active' if c.active=='advanced' else ''}">
50 <li class="${h.is_active('advanced', c.active)}">
51 51 <a href="${h.route_path('edit_repo_advanced', repo_name=c.repo_name)}">${_('Advanced')}</a>
52 52 </li>
53 <li class="${'active' if c.active=='vcs' else ''}">
53 <li class="${h.is_active('vcs', c.active)}">
54 54 <a href="${h.route_path('edit_repo_vcs', repo_name=c.repo_name)}">${_('VCS')}</a>
55 55 </li>
56 <li class="${'active' if c.active=='fields' else ''}">
56 <li class="${h.is_active('fields', c.active)}">
57 57 <a href="${h.route_path('edit_repo_fields', repo_name=c.repo_name)}">${_('Extra Fields')}</a>
58 58 </li>
59 <li class="${'active' if c.active=='issuetracker' else ''}">
59 <li class="${h.is_active('issuetracker', c.active)}">
60 60 <a href="${h.route_path('edit_repo_issuetracker', repo_name=c.repo_name)}">${_('Issue Tracker')}</a>
61 61 </li>
62 <li class="${'active' if c.active=='caches' else ''}">
62 <li class="${h.is_active('caches', c.active)}">
63 63 <a href="${h.route_path('edit_repo_caches', repo_name=c.repo_name)}">${_('Caches')}</a>
64 64 </li>
65 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 67 <a href="${h.route_path('edit_repo_remote', repo_name=c.repo_name)}">${_('Remote sync')}</a>
68 68 </li>
69 69 %endif
70 <li class="${'active' if c.active=='statistics' else ''}">
70 <li class="${h.is_active('statistics', c.active)}">
71 71 <a href="${h.route_path('edit_repo_statistics', repo_name=c.repo_name)}">${_('Statistics')}</a>
72 72 </li>
73 <li class="${'active' if c.active=='integrations' else ''}">
73 <li class="${h.is_active('integrations', c.active)}">
74 74 <a href="${h.route_path('repo_integrations_home', repo_name=c.repo_name)}">${_('Integrations')}</a>
75 75 </li>
76 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 78 <a href="${h.route_path('repo_reviewers', repo_name=c.repo_name)}">${_('Reviewer Rules')}</a>
79 79 </li>
80 80 %endif
81 <li class="${'active' if c.active=='automation' else ''}">
81 <li class="${h.is_active('automation', c.active)}">
82 82 <a href="${h.route_path('repo_automation', repo_name=c.repo_name)}">${_('Automation')}</a>
83 83 </li>
84 <li class="${'active' if c.active=='maintenance' else ''}">
84 <li class="${h.is_active('maintenance', c.active)}">
85 85 <a href="${h.route_path('edit_repo_maintenance', repo_name=c.repo_name)}">${_('Maintenance')}</a>
86 86 </li>
87 <li class="${'active' if c.active=='strip' else ''}">
87 <li class="${h.is_active('strip', c.active)}">
88 88 <a href="${h.route_path('edit_repo_strip', repo_name=c.repo_name)}">${_('Strip')}</a>
89 89 </li>
90 <li class="${'active' if c.active=='audit' else ''}">
90 <li class="${h.is_active('audit', c.active)}">
91 91 <a href="${h.route_path('edit_repo_audit_logs', repo_name=c.repo_name)}">${_('Audit logs')}</a>
92 92 </li>
93 93
@@ -24,7 +24,7 b''
24 24
25 25 <%def name="side_bar_nav()">
26 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 28 <a href="${navitem.url}">${navitem.name}</a>
29 29 </li>
30 30 % endfor
@@ -2,7 +2,7 b''
2 2 <%inherit file="/base/base.mako"/>
3 3
4 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 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
@@ -31,11 +31,11 b''
31 31 <div class="sidebar-col-wrapper">
32 32 <div class="sidebar">
33 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>
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>
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>
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>
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>
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="${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="${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="${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="${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 39 </ul>
40 40 </div>
41 41
@@ -2,7 +2,7 b''
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 ${_('%s user settings') % c.user.username}
5 ${_('{} user settings').format(c.user.username)}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
@@ -36,17 +36,17 b''
36 36 <div class="sidebar-col-wrapper">
37 37 <div class="sidebar">
38 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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="${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="${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="${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="${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="${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="${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="${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="${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="${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="${h.is_active('caches', c.active)}"><a href="${h.route_path('edit_user_caches', user_id=c.user.user_id)}">${_('Caches')}</a></li>
50 50 </ul>
51 51 </div>
52 52
@@ -1,7 +1,7 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 ## base64 filter
4 3 <%!
4 ## base64 filter e.g ${ example | base64 }
5 5 def base64(text):
6 6 import base64
7 7 from rhodecode.lib.helpers import safe_str
@@ -84,11 +84,6 b''
84 84 </%def>
85 85
86 86 <%def name="admin_menu(active=None)">
87 <%
88 def is_active(selected):
89 if selected == active:
90 return "active"
91 %>
92 87
93 88 <div id="context-bar">
94 89 <div class="wrapper">
@@ -108,16 +103,16 b''
108 103
109 104 ## super admin case
110 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>
112 <li class="${is_active('repositories')}"><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>
114 <li class="${is_active('users')}"><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>
116 <li class="${is_active('permissions')}"><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>
118 <li class="${is_active('integrations')}"><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>
120 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
106 <li class="${h.is_active('audit_logs', active)}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
107 <li class="${h.is_active('repositories', active)}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
108 <li class="${h.is_active('repository_groups', active)}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
109 <li class="${h.is_active('users', active)}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
110 <li class="${h.is_active('user_groups', active)}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
111 <li class="${h.is_active('permissions', active)}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
112 <li class="${h.is_active('authentication', active)}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
113 <li class="${h.is_active('integrations', active)}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
114 <li class="${h.is_active('defaults', active)}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
115 <li class="${h.is_active('settings', active)}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
121 116
122 117 ## delegated admin
123 118 % elif c.is_delegated_admin:
@@ -128,13 +123,13 b''
128 123 %>
129 124
130 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 127 %endif
133 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 130 %endif
136 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 133 %endif
139 134 % endif
140 135 </ul>
@@ -347,9 +342,6 b''
347 342
348 343 <%def name="repo_menu(active=None)">
349 344 <%
350 def is_active(selected):
351 if selected == active:
352 return "active"
353 345 ## determine if we have "any" option available
354 346 can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking
355 347 has_actions = can_lock
@@ -370,14 +362,14 b''
370 362 </div>
371 363
372 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>
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>
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>
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>
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>
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>
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>
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 370 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
379 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 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 374 <div class="menulabel">
383 375 ${_('Pull Requests')} <span class="menulink-counter">${c.repository_pull_requests}</span>
@@ -386,7 +378,7 b''
386 378 </li>
387 379 %endif
388 380
389 <li class="${is_active('artifacts')}">
381 <li class="${h.is_active('artifacts', active)}">
390 382 <a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}">
391 383 <div class="menulabel">
392 384 ${_('Artifacts')} <span class="menulink-counter">${c.repository_artifacts}</span>
@@ -395,10 +387,10 b''
395 387 </li>
396 388
397 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 391 %endif
400 392
401 <li class="${is_active('options')}">
393 <li class="${h.is_active('options', active)}">
402 394 % if has_actions:
403 395 <a class="menulink dropdown">
404 396 <div class="menulabel">${_('Options')}<div class="show_more"></div></div>
@@ -449,10 +441,6 b''
449 441
450 442 <%def name="repo_group_menu(active=None)">
451 443 <%
452 def is_active(selected):
453 if selected == active:
454 return "active"
455
456 444 gr_name = c.repo_group.group_name if c.repo_group else None
457 445 # create repositories with write permission on group is set to true
458 446 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
@@ -468,11 +456,11 b''
468 456 </div>
469 457
470 458 <ul id="context-pages" class="navigation horizontal-list">
471 <li class="${is_active('home')}">
459 <li class="${h.is_active('home', active)}">
472 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 461 </li>
474 462 % if c.is_super_admin or group_admin:
475 <li class="${is_active('settings')}">
463 <li class="${h.is_active('settings', active)}">
476 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 465 </li>
478 466 % endif
@@ -703,12 +691,6 b''
703 691 </%def>
704 692
705 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 695 <ul id="quick" class="main_nav navigation horizontal-list">
714 696 ## notice box for important system messages
@@ -782,34 +764,34 b''
782 764 </li>
783 765
784 766 ## ROOT MENU
785 <li class="${is_active('home')}">
767 <li class="${h.is_active('home', active)}">
786 768 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
787 769 <div class="menulabel">${_('Home')}</div>
788 770 </a>
789 771 </li>
790 772
791 773 %if c.rhodecode_user.username != h.DEFAULT_USER:
792 <li class="${is_active('journal')}">
774 <li class="${h.is_active('journal', active)}">
793 775 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
794 776 <div class="menulabel">${_('Journal')}</div>
795 777 </a>
796 778 </li>
797 779 %else:
798 <li class="${is_active('journal')}">
780 <li class="${h.is_active('journal', active)}">
799 781 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
800 782 <div class="menulabel">${_('Public journal')}</div>
801 783 </a>
802 784 </li>
803 785 %endif
804 786
805 <li class="${is_active('gists')}">
787 <li class="${h.is_active('gists', active)}">
806 788 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
807 789 <div class="menulabel">${_('Gists')}</div>
808 790 </a>
809 791 </li>
810 792
811 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 795 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
814 796 <div class="menulabel">${_('Admin')} </div>
815 797 </a>
@@ -1,7 +1,7 b''
1 1 <%inherit file="/base/base.mako"/>
2 2
3 3 <%def name="title()">
4 ${_('%s Pull Requests') % c.repo_name}
4 ${_('{} Pull Requests').format(c.repo_name)}
5 5 %if c.rhodecode_name:
6 6 &middot; ${h.branding(c.rhodecode_name)}
7 7 %endif
@@ -24,12 +24,12 b''
24 24 <div class="box">
25 25 <div class="title">
26 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>
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>
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>
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>
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>
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>
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 ${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 ${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 ${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 ${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 ${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 33 </ul>
34 34
35 35 <ul class="links">
General Comments 0
You need to be logged in to leave comments. Login now