##// END OF EJS Templates
admin menu: cleanup case conditions
marcink -
r3586:8905c773 new-ui
parent child Browse files
Show More
@@ -75,27 +75,36 b''
75 </%def>
75 </%def>
76
76
77 <%def name="admin_menu(active=None)">
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 <div id="context-bar">
90 <div id="context-bar">
79 <div class="wrapper">
91 <div class="wrapper">
80 <div class="title">
92 <div class="title">
81 <div class="title-content">
93 <div class="title-content">
82 <div class="title-main">
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 </div>
100 </div>
85 </div>
101 </div>
86 </div>
102 </div>
87
103
88 <ul id="context-pages" class="navigation horizontal-list">
104 <ul id="context-pages" class="navigation horizontal-list">
89 <%
105
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 %>
97 ## super admin case
106 ## super admin case
98 % if c.rhodecode_user.is_admin:
107 % if is_super_admin:
99 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
108 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
100 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
109 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
101 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
110 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
@@ -108,8 +117,7 b''
108 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
117 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
109
118
110 ## delegated admin
119 ## delegated admin
111 % elif repositories or repository_groups or user_groups:
120 % elif is_delegated_admin:
112
113 %if repositories:
121 %if repositories:
114 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
122 <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
115 %endif
123 %endif
@@ -121,6 +129,7 b''
121 %endif
129 %endif
122 % endif
130 % endif
123 </ul>
131 </ul>
132
124 </div>
133 </div>
125 <div class="clear"></div>
134 <div class="clear"></div>
126 </div>
135 </div>
General Comments 0
You need to be logged in to leave comments. Login now