Show More
@@ -75,27 +75,36 b'' | |||
|
75 | 75 | </%def> |
|
76 | 76 | |
|
77 | 77 | <%def name="admin_menu(active=None)"> |
|
78 | <% | |
|
79 | is_super_admin = c.rhodecode_user.is_admin | |
|
80 | repositories=c.rhodecode_user.repositories_admin | |
|
81 | repository_groups=c.rhodecode_user.repository_groups_admin | |
|
82 | user_groups=c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')() | |
|
83 | is_delegated_admin = repositories or repository_groups or user_groups | |
|
84 | ||
|
85 | def is_active(selected): | |
|
86 | if selected == active: | |
|
87 | return "active" | |
|
88 | %> | |
|
89 | ||
|
78 | 90 | <div id="context-bar"> |
|
79 | 91 | <div class="wrapper"> |
|
80 | 92 | <div class="title"> |
|
81 | 93 | <div class="title-content"> |
|
82 | 94 | <div class="title-main"> |
|
83 | ${_('Admin Panel')} | |
|
95 | % if is_super_admin: | |
|
96 | ${_('Super Admin Panel')} | |
|
97 | % else: | |
|
98 | ${_('Delegated Admin Panel')} | |
|
99 | % endif | |
|
84 | 100 | </div> |
|
85 | 101 | </div> |
|
86 | 102 | </div> |
|
87 | 103 | |
|
88 |
|
|
|
89 | <% | |
|
90 | repositories=c.rhodecode_user.repositories_admin | |
|
91 | repository_groups=c.rhodecode_user.repository_groups_admin | |
|
92 | user_groups=c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')() | |
|
93 | def is_active(selected): | |
|
94 | if selected == active: | |
|
95 | return "active" | |
|
96 | %> | |
|
104 | <ul id="context-pages" class="navigation horizontal-list"> | |
|
105 | ||
|
97 | 106 | ## super admin case |
|
98 |
% if |
|
|
107 | % if is_super_admin: | |
|
99 | 108 | <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> |
|
100 | 109 | <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
101 | 110 | <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
@@ -108,8 +117,7 b'' | |||
|
108 | 117 | <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li> |
|
109 | 118 | |
|
110 | 119 | ## delegated admin |
|
111 | % elif repositories or repository_groups or user_groups: | |
|
112 | ||
|
120 | % elif is_delegated_admin: | |
|
113 | 121 | %if repositories: |
|
114 | 122 | <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
115 | 123 | %endif |
@@ -121,6 +129,7 b'' | |||
|
121 | 129 | %endif |
|
122 | 130 | % endif |
|
123 | 131 | </ul> |
|
132 | ||
|
124 | 133 | </div> |
|
125 | 134 | <div class="clear"></div> |
|
126 | 135 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now