##// END OF EJS Templates
ui: added admin nav into admin pages
marcink -
r3564:9f92b9de new-ui
parent child Browse files
Show More
@@ -26,7 +26,7 b''
26 <div class="box">
26 <div class="box">
27 <!-- box / title -->
27 <!-- box / title -->
28 <div class="title">
28 <div class="title">
29 ${self.breadcrumbs()}
29 ${self.admin_menu()}
30 </div>
30 </div>
31 <!-- end box / title -->
31 <!-- end box / title -->
32 <div class="table">
32 <div class="table">
@@ -22,7 +22,7 b''
22
22
23 <div class="box">
23 <div class="box">
24 <div class="title">
24 <div class="title">
25 ${self.breadcrumbs()}
25 ${self.admin_menu()}
26 </div>
26 </div>
27
27
28 <div class='sidebar-col-wrapper'>
28 <div class='sidebar-col-wrapper'>
@@ -21,7 +21,7 b''
21 <%def name="main()">
21 <%def name="main()">
22 <div class="box">
22 <div class="box">
23 <div class="title">
23 <div class="title">
24 ${self.breadcrumbs()}
24 ${self.admin_menu()}
25 </div>
25 </div>
26
26
27 ##main
27 ##main
@@ -29,7 +29,7 b''
29 <%def name="main()">
29 <%def name="main()">
30 <div class="box">
30 <div class="box">
31 <div class="title">
31 <div class="title">
32 ${self.breadcrumbs()}
32 ${self.admin_menu()}
33 </div>
33 </div>
34
34
35 ##main
35 ##main
@@ -22,7 +22,7 b''
22 <%def name="main()">
22 <%def name="main()">
23 <div class="box">
23 <div class="box">
24 <div class="title">
24 <div class="title">
25 ${self.breadcrumbs()}
25 ${self.admin_menu()}
26 </div>
26 </div>
27
27
28 <div class="sidebar-col-wrapper scw-small">
28 <div class="sidebar-col-wrapper scw-small">
@@ -20,7 +20,7 b''
20 <%def name="main()">
20 <%def name="main()">
21 <div class="box">
21 <div class="box">
22 <div class="title">
22 <div class="title">
23 ${self.breadcrumbs()}
23 ${self.admin_menu()}
24 <ul class="links">
24 <ul class="links">
25 %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')():
25 %if h.HasPermissionAny('hg.admin','hg.repogroup.create.true')():
26 <li>
26 <li>
@@ -20,7 +20,7 b''
20 <%def name="main()">
20 <%def name="main()">
21 <div class="box">
21 <div class="box">
22 <div class="title">
22 <div class="title">
23 ${self.breadcrumbs()}
23 ${self.admin_menu()}
24 <ul class="links">
24 <ul class="links">
25 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
25 %if h.HasPermissionAny('hg.admin','hg.create.repository')():
26 <li>
26 <li>
@@ -33,7 +33,7 b''
33 <%def name="main()">
33 <%def name="main()">
34 <div class="box">
34 <div class="box">
35 <div class="title">
35 <div class="title">
36 ${self.breadcrumbs()}
36 ${self.admin_menu()}
37 </div>
37 </div>
38
38
39 ##main
39 ##main
@@ -21,7 +21,7 b''
21 <div class="box">
21 <div class="box">
22
22
23 <div class="title">
23 <div class="title">
24 ${self.breadcrumbs()}
24 ${self.admin_menu()}
25 <ul class="links">
25 <ul class="links">
26 %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')():
26 %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')():
27 <li>
27 <li>
@@ -22,7 +22,7 b''
22 <div class="box">
22 <div class="box">
23
23
24 <div class="title">
24 <div class="title">
25 ${self.breadcrumbs()}
25 ${self.admin_menu()}
26 <ul class="links">
26 <ul class="links">
27 <li>
27 <li>
28 <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a>
28 <a href="${h.route_path('users_new')}" class="btn btn-small btn-success">${_(u'Add User')}</a>
@@ -75,18 +75,40 b''
75 </%def>
75 </%def>
76
76
77 <%def name="admin_menu()">
77 <%def name="admin_menu()">
78 <ul class="admin_menu submenu">
78
79 <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
79 <ul id="context-pages" class="navigation horizontal-list">
80 <li><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
80 <%
81 <li><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
81 repositories=c.rhodecode_user.repositories_admin
82 <li><a href="${h.route_path('users')}">${_('Users')}</a></li>
82 repository_groups=c.rhodecode_user.repository_groups_admin
83 <li><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
83 user_groups=c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')()
84 <li><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
84 %>
85 <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
85 ## super admin case
86 <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
86 % if c.rhodecode_user.is_admin:
87 <li><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
87 <li><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
88 <li class="last"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
88 <li><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
89 </ul>
89 <li><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
90 <li><a href="${h.route_path('users')}">${_('Users')}</a></li>
91 <li><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
92 <li><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
93 <li><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
94 <li><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
95 <li><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
96 <li><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
97
98 ## delegated admin
99 % elif repositories or repository_groups or user_groups:
100
101 %if repositories:
102 <li class="local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
103 %endif
104 %if repository_groups:
105 <li class="local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
106 %endif
107 %if user_groups:
108 <li class="local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
109 %endif
110 % endif
111 </ul>
90 </%def>
112 </%def>
91
113
92
114
@@ -145,21 +167,6 b''
145 </%def>
167 </%def>
146
168
147
169
148 ## admin menu used for people that have some admin resources
149 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
150 <ul class="submenu">
151 %if repositories:
152 <li class="local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
153 %endif
154 %if repository_groups:
155 <li class="local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
156 %endif
157 %if user_groups:
158 <li class="local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
159 %endif
160 </ul>
161 </%def>
162
163 <%def name="repo_page_title(repo_instance)">
170 <%def name="repo_page_title(repo_instance)">
164 <div class="title-content">
171 <div class="title-content">
165 <div class="title-main">
172 <div class="title-main">
@@ -573,23 +580,12 b''
573 </a>
580 </a>
574 </li>
581 </li>
575
582
576 % if h.HasPermissionAll('hg.admin')('access admin main page'):
577 <li class="${is_active('admin')}">
583 <li class="${is_active('admin')}">
578 <a class="menulink childs" title="${_('Admin settings')}" href="#" onclick="return false;">
584 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
579 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
585 <div class="menulabel">${_('Admin')} </div>
580 </a>
586 </a>
581 ${admin_menu()}
582 </li>
587 </li>
583 % elif c.rhodecode_user.repositories_admin or c.rhodecode_user.repository_groups_admin or c.rhodecode_user.user_groups_admin:
588
584 <li class="${is_active('admin')}">
585 <a class="menulink childs" title="${_('Delegated Admin settings')}">
586 <div class="menulabel">${_('Admin')} <div class="show_more"></div></div>
587 </a>
588 ${admin_menu_simple(c.rhodecode_user.repositories_admin,
589 c.rhodecode_user.repository_groups_admin,
590 c.rhodecode_user.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
591 </li>
592 % endif
593 ## render extra user menu
589 ## render extra user menu
594 ${usermenu(active=(active=='my_account'))}
590 ${usermenu(active=(active=='my_account'))}
595
591
@@ -63,15 +63,9 b''
63 <div class="box">
63 <div class="box">
64 %if c.repo_name:
64 %if c.repo_name:
65 <!-- box / title -->
65 <!-- box / title -->
66 <!--div class="title">
67 ${self.repo_page_title(c.rhodecode_db_repo)}
68 </div-->
69 ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')}
66 ${h.form(h.route_path('search_repo',repo_name=c.repo_name),method='get')}
70 %elif c.repo_group_name:
67 %elif c.repo_group_name:
71 <!-- box / title -->
68 <!-- box / title -->
72 <!--div class="title">
73 ${self.repo_group_page_title(c.repo_group)}
74 </div-->
75 ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')}
69 ${h.form(h.route_path('search_repo_group',repo_group_name=c.repo_group_name),method='get')}
76 %else:
70 %else:
77 <!-- box / title -->
71 <!-- box / title -->
General Comments 0
You need to be logged in to leave comments. Login now