##// END OF EJS Templates
base: fixed admin panel title for super admins
marcink -
r3597:08c93ec2 new-ui
parent child Browse files
Show More
@@ -1,942 +1,942 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="root.mako"/>
2 <%inherit file="root.mako"/>
3
3
4 <%include file="/ejs_templates/templates.html"/>
4 <%include file="/ejs_templates/templates.html"/>
5
5
6 <div class="outerwrapper">
6 <div class="outerwrapper">
7 <!-- HEADER -->
7 <!-- HEADER -->
8 <div class="header">
8 <div class="header">
9 <div id="header-inner" class="wrapper">
9 <div id="header-inner" class="wrapper">
10 <div id="logo">
10 <div id="logo">
11 <div class="logo-wrapper">
11 <div class="logo-wrapper">
12 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
12 <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a>
13 </div>
13 </div>
14 % if c.rhodecode_name:
14 % if c.rhodecode_name:
15 <div class="branding">
15 <div class="branding">
16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
16 <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a>
17 </div>
17 </div>
18 % endif
18 % endif
19 </div>
19 </div>
20 <!-- MENU BAR NAV -->
20 <!-- MENU BAR NAV -->
21 ${self.menu_bar_nav()}
21 ${self.menu_bar_nav()}
22 <!-- END MENU BAR NAV -->
22 <!-- END MENU BAR NAV -->
23 </div>
23 </div>
24 </div>
24 </div>
25 ${self.menu_bar_subnav()}
25 ${self.menu_bar_subnav()}
26 <!-- END HEADER -->
26 <!-- END HEADER -->
27
27
28 <!-- CONTENT -->
28 <!-- CONTENT -->
29 <div id="content" class="wrapper">
29 <div id="content" class="wrapper">
30
30
31 <rhodecode-toast id="notifications"></rhodecode-toast>
31 <rhodecode-toast id="notifications"></rhodecode-toast>
32
32
33 <div class="main">
33 <div class="main">
34 ${next.main()}
34 ${next.main()}
35 </div>
35 </div>
36 </div>
36 </div>
37 <!-- END CONTENT -->
37 <!-- END CONTENT -->
38
38
39 </div>
39 </div>
40 <!-- FOOTER -->
40 <!-- FOOTER -->
41 <div id="footer">
41 <div id="footer">
42 <div id="footer-inner" class="title wrapper">
42 <div id="footer-inner" class="title wrapper">
43 <div>
43 <div>
44 <p class="footer-link-right">
44 <p class="footer-link-right">
45 % if c.visual.show_version:
45 % if c.visual.show_version:
46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
46 RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition}
47 % endif
47 % endif
48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
48 &copy; 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved.
49 % if c.visual.rhodecode_support_url:
49 % if c.visual.rhodecode_support_url:
50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
50 <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a>
51 % endif
51 % endif
52 </p>
52 </p>
53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
53 <% sid = 'block' if request.GET.get('showrcid') else 'none' %>
54 <p class="server-instance" style="display:${sid}">
54 <p class="server-instance" style="display:${sid}">
55 ## display hidden instance ID if specially defined
55 ## display hidden instance ID if specially defined
56 % if c.rhodecode_instanceid:
56 % if c.rhodecode_instanceid:
57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
57 ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)}
58 % endif
58 % endif
59 </p>
59 </p>
60 </div>
60 </div>
61 </div>
61 </div>
62 </div>
62 </div>
63
63
64 <!-- END FOOTER -->
64 <!-- END FOOTER -->
65
65
66 ### MAKO DEFS ###
66 ### MAKO DEFS ###
67
67
68 <%def name="menu_bar_subnav()">
68 <%def name="menu_bar_subnav()">
69 </%def>
69 </%def>
70
70
71 <%def name="breadcrumbs(class_='breadcrumbs')">
71 <%def name="breadcrumbs(class_='breadcrumbs')">
72 <div class="${class_}">
72 <div class="${class_}">
73 ${self.breadcrumbs_links()}
73 ${self.breadcrumbs_links()}
74 </div>
74 </div>
75 </%def>
75 </%def>
76
76
77 <%def name="admin_menu(active=None)">
77 <%def name="admin_menu(active=None)">
78 <%
78 <%
79 def is_active(selected):
79 def is_active(selected):
80 if selected == active:
80 if selected == active:
81 return "active"
81 return "active"
82 %>
82 %>
83
83
84 <div id="context-bar">
84 <div id="context-bar">
85 <div class="wrapper">
85 <div class="wrapper">
86 <div class="title">
86 <div class="title">
87 <div class="title-content">
87 <div class="title-content">
88 <div class="title-main">
88 <div class="title-main">
89 % if is_super_admin:
89 % if c.is_super_admin:
90 ${_('Super Admin Panel')}
90 ${_('Super Admin Panel')}
91 % else:
91 % else:
92 ${_('Delegated Admin Panel')}
92 ${_('Delegated Admin Panel')}
93 % endif
93 % endif
94 </div>
94 </div>
95 </div>
95 </div>
96 </div>
96 </div>
97
97
98 <ul id="context-pages" class="navigation horizontal-list">
98 <ul id="context-pages" class="navigation horizontal-list">
99
99
100 ## super admin case
100 ## super admin case
101 % if c.is_super_admin:
101 % if c.is_super_admin:
102 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
102 <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li>
103 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
103 <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li>
104 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
104 <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
105 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
105 <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li>
106 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
106 <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
107 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
107 <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li>
108 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
108 <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li>
109 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
109 <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li>
110 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
110 <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li>
111 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
111 <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li>
112
112
113 ## delegated admin
113 ## delegated admin
114 % elif c.is_delegated_admin:
114 % elif c.is_delegated_admin:
115 <%
115 <%
116 repositories=c.auth_user.repositories_admin or c.can_create_repo
116 repositories=c.auth_user.repositories_admin or c.can_create_repo
117 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
117 repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group
118 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
118 user_groups=c.auth_user.user_groups_admin or c.can_create_user_group
119 %>
119 %>
120
120
121 %if repositories:
121 %if repositories:
122 <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>
123 %endif
123 %endif
124 %if repository_groups:
124 %if repository_groups:
125 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
125 <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li>
126 %endif
126 %endif
127 %if user_groups:
127 %if user_groups:
128 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
128 <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li>
129 %endif
129 %endif
130 % endif
130 % endif
131 </ul>
131 </ul>
132
132
133 </div>
133 </div>
134 <div class="clear"></div>
134 <div class="clear"></div>
135 </div>
135 </div>
136 </%def>
136 </%def>
137
137
138 <%def name="dt_info_panel(elements)">
138 <%def name="dt_info_panel(elements)">
139 <dl class="dl-horizontal">
139 <dl class="dl-horizontal">
140 %for dt, dd, title, show_items in elements:
140 %for dt, dd, title, show_items in elements:
141 <dt>${dt}:</dt>
141 <dt>${dt}:</dt>
142 <dd title="${h.tooltip(title)}">
142 <dd title="${h.tooltip(title)}">
143 %if callable(dd):
143 %if callable(dd):
144 ## allow lazy evaluation of elements
144 ## allow lazy evaluation of elements
145 ${dd()}
145 ${dd()}
146 %else:
146 %else:
147 ${dd}
147 ${dd}
148 %endif
148 %endif
149 %if show_items:
149 %if show_items:
150 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
150 <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span>
151 %endif
151 %endif
152 </dd>
152 </dd>
153
153
154 %if show_items:
154 %if show_items:
155 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
155 <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none">
156 %for item in show_items:
156 %for item in show_items:
157 <dt></dt>
157 <dt></dt>
158 <dd>${item}</dd>
158 <dd>${item}</dd>
159 %endfor
159 %endfor
160 </div>
160 </div>
161 %endif
161 %endif
162
162
163 %endfor
163 %endfor
164 </dl>
164 </dl>
165 </%def>
165 </%def>
166
166
167 <%def name="gravatar(email, size=16)">
167 <%def name="gravatar(email, size=16)">
168 <%
168 <%
169 if (size > 16):
169 if (size > 16):
170 gravatar_class = 'gravatar gravatar-large'
170 gravatar_class = 'gravatar gravatar-large'
171 else:
171 else:
172 gravatar_class = 'gravatar'
172 gravatar_class = 'gravatar'
173 %>
173 %>
174 <%doc>
174 <%doc>
175 TODO: johbo: For now we serve double size images to make it smooth
175 TODO: johbo: For now we serve double size images to make it smooth
176 for retina. This is how it worked until now. Should be replaced
176 for retina. This is how it worked until now. Should be replaced
177 with a better solution at some point.
177 with a better solution at some point.
178 </%doc>
178 </%doc>
179 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
179 <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}">
180 </%def>
180 </%def>
181
181
182
182
183 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
183 <%def name="gravatar_with_user(contact, size=16, show_disabled=False)">
184 <% email = h.email_or_none(contact) %>
184 <% email = h.email_or_none(contact) %>
185 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
185 <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
186 ${self.gravatar(email, size)}
186 ${self.gravatar(email, size)}
187 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
187 <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span>
188 </div>
188 </div>
189 </%def>
189 </%def>
190
190
191
191
192 <%def name="repo_page_title(repo_instance)">
192 <%def name="repo_page_title(repo_instance)">
193 <div class="title-content">
193 <div class="title-content">
194 <div class="title-main">
194 <div class="title-main">
195 ## SVN/HG/GIT icons
195 ## SVN/HG/GIT icons
196 %if h.is_hg(repo_instance):
196 %if h.is_hg(repo_instance):
197 <i class="icon-hg"></i>
197 <i class="icon-hg"></i>
198 %endif
198 %endif
199 %if h.is_git(repo_instance):
199 %if h.is_git(repo_instance):
200 <i class="icon-git"></i>
200 <i class="icon-git"></i>
201 %endif
201 %endif
202 %if h.is_svn(repo_instance):
202 %if h.is_svn(repo_instance):
203 <i class="icon-svn"></i>
203 <i class="icon-svn"></i>
204 %endif
204 %endif
205
205
206 ## public/private
206 ## public/private
207 %if repo_instance.private:
207 %if repo_instance.private:
208 <i class="icon-repo-private"></i>
208 <i class="icon-repo-private"></i>
209 %else:
209 %else:
210 <i class="icon-repo-public"></i>
210 <i class="icon-repo-public"></i>
211 %endif
211 %endif
212
212
213 ## repo name with group name
213 ## repo name with group name
214 ${h.breadcrumb_repo_link(repo_instance)}
214 ${h.breadcrumb_repo_link(repo_instance)}
215
215
216 </div>
216 </div>
217
217
218 ## FORKED
218 ## FORKED
219 %if repo_instance.fork:
219 %if repo_instance.fork:
220 <p class="discreet">
220 <p class="discreet">
221 <i class="icon-code-fork"></i> ${_('Fork of')}
221 <i class="icon-code-fork"></i> ${_('Fork of')}
222 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
222 ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}
223 </p>
223 </p>
224 %endif
224 %endif
225
225
226 ## IMPORTED FROM REMOTE
226 ## IMPORTED FROM REMOTE
227 %if repo_instance.clone_uri:
227 %if repo_instance.clone_uri:
228 <p class="discreet">
228 <p class="discreet">
229 <i class="icon-code-fork"></i> ${_('Clone from')}
229 <i class="icon-code-fork"></i> ${_('Clone from')}
230 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
230 <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a>
231 </p>
231 </p>
232 %endif
232 %endif
233
233
234 ## LOCKING STATUS
234 ## LOCKING STATUS
235 %if repo_instance.locked[0]:
235 %if repo_instance.locked[0]:
236 <p class="locking_locked discreet">
236 <p class="locking_locked discreet">
237 <i class="icon-repo-lock"></i>
237 <i class="icon-repo-lock"></i>
238 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
238 ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}
239 </p>
239 </p>
240 %elif repo_instance.enable_locking:
240 %elif repo_instance.enable_locking:
241 <p class="locking_unlocked discreet">
241 <p class="locking_unlocked discreet">
242 <i class="icon-repo-unlock"></i>
242 <i class="icon-repo-unlock"></i>
243 ${_('Repository not locked. Pull repository to lock it.')}
243 ${_('Repository not locked. Pull repository to lock it.')}
244 </p>
244 </p>
245 %endif
245 %endif
246
246
247 </div>
247 </div>
248 </%def>
248 </%def>
249
249
250 <%def name="repo_menu(active=None)">
250 <%def name="repo_menu(active=None)">
251 <%
251 <%
252 def is_active(selected):
252 def is_active(selected):
253 if selected == active:
253 if selected == active:
254 return "active"
254 return "active"
255 %>
255 %>
256
256
257 <!--- REPO CONTEXT BAR -->
257 <!--- REPO CONTEXT BAR -->
258 <div id="context-bar">
258 <div id="context-bar">
259 <div class="wrapper">
259 <div class="wrapper">
260
260
261 <div class="title">
261 <div class="title">
262 ${self.repo_page_title(c.rhodecode_db_repo)}
262 ${self.repo_page_title(c.rhodecode_db_repo)}
263 </div>
263 </div>
264
264
265 <ul id="context-pages" class="navigation horizontal-list">
265 <ul id="context-pages" class="navigation horizontal-list">
266 <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>
266 <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>
267 <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
267 <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
268 <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>
268 <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>
269 <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>
269 <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>
270
270
271 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
271 ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()"
272 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
272 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
273 <li class="${is_active('showpullrequest')}">
273 <li class="${is_active('showpullrequest')}">
274 <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)}">
274 <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)}">
275 <div class="menulabel">
275 <div class="menulabel">
276 %if c.repository_pull_requests == 1:
276 %if c.repository_pull_requests == 1:
277 ${c.repository_pull_requests} ${_('Pull Request')}
277 ${c.repository_pull_requests} ${_('Pull Request')}
278 %else:
278 %else:
279 ${c.repository_pull_requests} ${_('Pull Requests')}
279 ${c.repository_pull_requests} ${_('Pull Requests')}
280 %endif
280 %endif
281 </div>
281 </div>
282 </a>
282 </a>
283 </li>
283 </li>
284 %endif
284 %endif
285
285
286 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
286 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
287 <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>
287 <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>
288 %endif
288 %endif
289
289
290 <li class="${is_active('options')}">
290 <li class="${is_active('options')}">
291 <a class="menulink dropdown">
291 <a class="menulink dropdown">
292 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
292 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
293 </a>
293 </a>
294 <ul class="submenu">
294 <ul class="submenu">
295
295
296 %if c.rhodecode_db_repo.fork:
296 %if c.rhodecode_db_repo.fork:
297 <li>
297 <li>
298 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
298 <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}"
299 href="${h.route_path('repo_compare',
299 href="${h.route_path('repo_compare',
300 repo_name=c.rhodecode_db_repo.fork.repo_name,
300 repo_name=c.rhodecode_db_repo.fork.repo_name,
301 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
301 source_ref_type=c.rhodecode_db_repo.landing_rev[0],
302 source_ref=c.rhodecode_db_repo.landing_rev[1],
302 source_ref=c.rhodecode_db_repo.landing_rev[1],
303 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
303 target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0],
304 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
304 target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1],
305 _query=dict(merge=1))}"
305 _query=dict(merge=1))}"
306 >
306 >
307 ${_('Compare fork')}
307 ${_('Compare fork')}
308 </a>
308 </a>
309 </li>
309 </li>
310 %endif
310 %endif
311
311
312 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
312 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
313 %if c.rhodecode_db_repo.locked[0]:
313 %if c.rhodecode_db_repo.locked[0]:
314 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
314 <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li>
315 %else:
315 %else:
316 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
316 <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li>
317 %endif
317 %endif
318 %endif
318 %endif
319 %if c.rhodecode_user.username != h.DEFAULT_USER:
319 %if c.rhodecode_user.username != h.DEFAULT_USER:
320 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
320 %if c.rhodecode_db_repo.repo_type in ['git','hg']:
321 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
321 <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li>
322 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
322 <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li>
323 %endif
323 %endif
324 %endif
324 %endif
325 </ul>
325 </ul>
326 </li>
326 </li>
327 </ul>
327 </ul>
328 </div>
328 </div>
329 <div class="clear"></div>
329 <div class="clear"></div>
330 </div>
330 </div>
331 % if c.rhodecode_db_repo.archived:
331 % if c.rhodecode_db_repo.archived:
332 <div class="alert alert-warning text-center">
332 <div class="alert alert-warning text-center">
333 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
333 <strong>${_('This repository has been archived. It is now read-only.')}</strong>
334 </div>
334 </div>
335 % endif
335 % endif
336 <!--- REPO END CONTEXT BAR -->
336 <!--- REPO END CONTEXT BAR -->
337
337
338 </%def>
338 </%def>
339
339
340 <%def name="repo_group_page_title(repo_group_instance)">
340 <%def name="repo_group_page_title(repo_group_instance)">
341 <div class="title-content">
341 <div class="title-content">
342 <div class="title-main">
342 <div class="title-main">
343 ## Repository Group icon
343 ## Repository Group icon
344 <i class="icon-folder-close"></i>
344 <i class="icon-folder-close"></i>
345
345
346 ## repo name with group name
346 ## repo name with group name
347 ${h.breadcrumb_repo_group_link(repo_group_instance)}
347 ${h.breadcrumb_repo_group_link(repo_group_instance)}
348 </div>
348 </div>
349
349
350 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
350 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
351 <div class="repo-group-desc">
351 <div class="repo-group-desc">
352 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
352 ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
353 </div>
353 </div>
354
354
355 </div>
355 </div>
356 </%def>
356 </%def>
357
357
358 <%def name="repo_group_menu(active=None)">
358 <%def name="repo_group_menu(active=None)">
359 <%
359 <%
360 def is_active(selected):
360 def is_active(selected):
361 if selected == active:
361 if selected == active:
362 return "active"
362 return "active"
363
363
364 gr_name = c.repo_group.group_name if c.repo_group else None
364 gr_name = c.repo_group.group_name if c.repo_group else None
365 # create repositories with write permission on group is set to true
365 # create repositories with write permission on group is set to true
366 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
366 create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')()
367 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
367 group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page')
368 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
368 group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page')
369
369
370 %>
370 %>
371
371
372 <!--- REPO GROUP CONTEXT BAR -->
372 <!--- REPO GROUP CONTEXT BAR -->
373 <div id="context-bar">
373 <div id="context-bar">
374 <div class="wrapper">
374 <div class="wrapper">
375 <div class="title">
375 <div class="title">
376 ${self.repo_group_page_title(c.repo_group)}
376 ${self.repo_group_page_title(c.repo_group)}
377 </div>
377 </div>
378
378
379 <ul id="context-pages" class="navigation horizontal-list">
379 <ul id="context-pages" class="navigation horizontal-list">
380 <li class="${is_active('home')}"><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></li>
380 <li class="${is_active('home')}"><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></li>
381 % if c.is_super_admin or group_admin:
381 % if c.is_super_admin or group_admin:
382 <li class="${is_active('settings')}"><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></li>
382 <li class="${is_active('settings')}"><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></li>
383 % endif
383 % endif
384
384
385 <li class="${is_active('options')}">
385 <li class="${is_active('options')}">
386 <a class="menulink dropdown">
386 <a class="menulink dropdown">
387 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
387 <div class="menulabel">${_('Options')} <div class="show_more"></div></div>
388 </a>
388 </a>
389 <ul class="submenu">
389 <ul class="submenu">
390 %if c.is_super_admin or group_admin or (group_write and create_on_write):
390 %if c.is_super_admin or group_admin or (group_write and create_on_write):
391 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
391 <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li>
392 %endif
392 %endif
393 %if c.is_super_admin or group_admin:
393 %if c.is_super_admin or group_admin:
394 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li>
394 <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li>
395 %endif
395 %endif
396 </ul>
396 </ul>
397 </li>
397 </li>
398 </ul>
398 </ul>
399 </div>
399 </div>
400 <div class="clear"></div>
400 <div class="clear"></div>
401 </div>
401 </div>
402
402
403 <!--- REPO GROUP CONTEXT BAR -->
403 <!--- REPO GROUP CONTEXT BAR -->
404
404
405 </%def>
405 </%def>
406
406
407
407
408 <%def name="usermenu(active=False)">
408 <%def name="usermenu(active=False)">
409 ## USER MENU
409 ## USER MENU
410 <li id="quick_login_li" class="${'active' if active else ''}">
410 <li id="quick_login_li" class="${'active' if active else ''}">
411 % if c.rhodecode_user.username == h.DEFAULT_USER:
411 % if c.rhodecode_user.username == h.DEFAULT_USER:
412 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
412 <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}">
413 ${gravatar(c.rhodecode_user.email, 20)}
413 ${gravatar(c.rhodecode_user.email, 20)}
414 <span class="user">
414 <span class="user">
415 <span>${_('Sign in')}</span>
415 <span>${_('Sign in')}</span>
416 </span>
416 </span>
417 </a>
417 </a>
418 % else:
418 % else:
419 ## logged in user
419 ## logged in user
420 <a id="quick_login_link" class="menulink childs">
420 <a id="quick_login_link" class="menulink childs">
421 ${gravatar(c.rhodecode_user.email, 20)}
421 ${gravatar(c.rhodecode_user.email, 20)}
422 <span class="user">
422 <span class="user">
423 <span class="menu_link_user">${c.rhodecode_user.username}</span>
423 <span class="menu_link_user">${c.rhodecode_user.username}</span>
424 <div class="show_more"></div>
424 <div class="show_more"></div>
425 </span>
425 </span>
426 </a>
426 </a>
427 ## subnav with menu for logged in user
427 ## subnav with menu for logged in user
428 <div class="user-menu submenu">
428 <div class="user-menu submenu">
429 <div id="quick_login">
429 <div id="quick_login">
430 %if c.rhodecode_user.username != h.DEFAULT_USER:
430 %if c.rhodecode_user.username != h.DEFAULT_USER:
431 <div class="">
431 <div class="">
432 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
432 <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div>
433 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
433 <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
434 <div class="email">${c.rhodecode_user.email}</div>
434 <div class="email">${c.rhodecode_user.email}</div>
435 </div>
435 </div>
436 <div class="">
436 <div class="">
437 <ol class="links">
437 <ol class="links">
438 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
438 <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li>
439 % if c.rhodecode_user.personal_repo_group:
439 % if c.rhodecode_user.personal_repo_group:
440 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
440 <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li>
441 % endif
441 % endif
442 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
442 <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li>
443 ## bookmark-items
443 ## bookmark-items
444 <li class="bookmark-items">
444 <li class="bookmark-items">
445 ${_('Bookmarks')}
445 ${_('Bookmarks')}
446 <div class="pull-right">
446 <div class="pull-right">
447 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
447 <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a>
448 </div>
448 </div>
449 </li>
449 </li>
450 % if not c.bookmark_items:
450 % if not c.bookmark_items:
451 <li>
451 <li>
452 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
452 <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a>
453 </li>
453 </li>
454 % endif
454 % endif
455 % for item in c.bookmark_items:
455 % for item in c.bookmark_items:
456 <li>
456 <li>
457 % if item.repository:
457 % if item.repository:
458 <div>
458 <div>
459 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
459 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
460 <code>${item.position}</code>
460 <code>${item.position}</code>
461 % if item.repository.repo_type == 'hg':
461 % if item.repository.repo_type == 'hg':
462 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
462 <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i>
463 % elif item.repository.repo_type == 'git':
463 % elif item.repository.repo_type == 'git':
464 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
464 <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i>
465 % elif item.repository.repo_type == 'svn':
465 % elif item.repository.repo_type == 'svn':
466 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
466 <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i>
467 % endif
467 % endif
468 ${(item.title or h.shorter(item.repository.repo_name, 30))}
468 ${(item.title or h.shorter(item.repository.repo_name, 30))}
469 </a>
469 </a>
470 </div>
470 </div>
471 % elif item.repository_group:
471 % elif item.repository_group:
472 <div>
472 <div>
473 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
473 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
474 <code>${item.position}</code>
474 <code>${item.position}</code>
475 <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i>
475 <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i>
476 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
476 ${(item.title or h.shorter(item.repository_group.group_name, 30))}
477 </a>
477 </a>
478 </div>
478 </div>
479 % else:
479 % else:
480 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
480 <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}">
481 <code>${item.position}</code>
481 <code>${item.position}</code>
482 ${item.title}
482 ${item.title}
483 </a>
483 </a>
484 % endif
484 % endif
485 </li>
485 </li>
486 % endfor
486 % endfor
487
487
488 <li class="logout">
488 <li class="logout">
489 ${h.secure_form(h.route_path('logout'), request=request)}
489 ${h.secure_form(h.route_path('logout'), request=request)}
490 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
490 ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")}
491 ${h.end_form()}
491 ${h.end_form()}
492 </li>
492 </li>
493 </ol>
493 </ol>
494 </div>
494 </div>
495 %endif
495 %endif
496 </div>
496 </div>
497 </div>
497 </div>
498 ## unread counter
498 ## unread counter
499 <div class="pill_container">
499 <div class="pill_container">
500 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
500 <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a>
501 </div>
501 </div>
502 % endif
502 % endif
503 </li>
503 </li>
504 </%def>
504 </%def>
505
505
506 <%def name="menu_items(active=None)">
506 <%def name="menu_items(active=None)">
507 <%
507 <%
508 def is_active(selected):
508 def is_active(selected):
509 if selected == active:
509 if selected == active:
510 return "active"
510 return "active"
511 return ""
511 return ""
512 %>
512 %>
513
513
514 <ul id="quick" class="main_nav navigation horizontal-list">
514 <ul id="quick" class="main_nav navigation horizontal-list">
515 ## notice box for important system messages
515 ## notice box for important system messages
516 <li style="display: none">
516 <li style="display: none">
517 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
517 <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false">
518 <div class="menulabel-notice" >
518 <div class="menulabel-notice" >
519 0
519 0
520 </div>
520 </div>
521 </a>
521 </a>
522 </li>
522 </li>
523
523
524 ## Main filter
524 ## Main filter
525 <li>
525 <li>
526 <div class="menulabel main_filter_box">
526 <div class="menulabel main_filter_box">
527 <div class="main_filter_input_box">
527 <div class="main_filter_input_box">
528 <ul class="searchItems">
528 <ul class="searchItems">
529
529
530 % if c.template_context['search_context']['repo_id']:
530 % if c.template_context['search_context']['repo_id']:
531 <li class="searchTag searchTagFilter searchTagHidable" >
531 <li class="searchTag searchTagFilter searchTagHidable" >
532 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
532 ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">
533 <span class="tag">
533 <span class="tag">
534 This repo
534 This repo
535 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
535 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
536 </span>
536 </span>
537 ##</a>
537 ##</a>
538 </li>
538 </li>
539 % elif c.template_context['search_context']['repo_group_id']:
539 % elif c.template_context['search_context']['repo_group_id']:
540 <li class="searchTag searchTagFilter searchTagHidable">
540 <li class="searchTag searchTagFilter searchTagHidable">
541 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
541 ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">
542 <span class="tag">
542 <span class="tag">
543 This group
543 This group
544 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
544 <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a>
545 </span>
545 </span>
546 ##</a>
546 ##</a>
547 </li>
547 </li>
548 % endif
548 % endif
549
549
550 <li class="searchTagInput">
550 <li class="searchTagInput">
551 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
551 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
552 </li>
552 </li>
553 <li class="searchTag searchTagHelp">
553 <li class="searchTag searchTagHelp">
554 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
554 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
555 </li>
555 </li>
556 </ul>
556 </ul>
557 </div>
557 </div>
558 </div>
558 </div>
559
559
560 <div id="main_filter_help" style="display: none">
560 <div id="main_filter_help" style="display: none">
561 - Use '/' key to quickly access this field.
561 - Use '/' key to quickly access this field.
562
562
563 - Enter a name of repository, or repository group for quick search.
563 - Enter a name of repository, or repository group for quick search.
564
564
565 - Prefix query to allow special search:
565 - Prefix query to allow special search:
566
566
567 user:admin, to search for usernames, always global
567 user:admin, to search for usernames, always global
568
568
569 user_group:devops, to search for user groups, always global
569 user_group:devops, to search for user groups, always global
570
570
571 commit:efced4, to search for commits, scoped to repositories or groups
571 commit:efced4, to search for commits, scoped to repositories or groups
572
572
573 file:models.py, to search for file paths, scoped to repositories or groups
573 file:models.py, to search for file paths, scoped to repositories or groups
574
574
575 % if c.template_context['search_context']['repo_id']:
575 % if c.template_context['search_context']['repo_id']:
576 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
576 For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>
577 % elif c.template_context['search_context']['repo_group_id']:
577 % elif c.template_context['search_context']['repo_group_id']:
578 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
578 For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a>
579 % else:
579 % else:
580 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
580 For advanced full text search visit: <a href="${h.route_path('search')}">global search</a>
581 % endif
581 % endif
582 </div>
582 </div>
583 </li>
583 </li>
584
584
585 ## ROOT MENU
585 ## ROOT MENU
586 <li class="${is_active('home')}">
586 <li class="${is_active('home')}">
587 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
587 <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}">
588 <div class="menulabel">${_('Home')}</div>
588 <div class="menulabel">${_('Home')}</div>
589 </a>
589 </a>
590 </li>
590 </li>
591
591
592 %if c.rhodecode_user.username != h.DEFAULT_USER:
592 %if c.rhodecode_user.username != h.DEFAULT_USER:
593 <li class="${is_active('journal')}">
593 <li class="${is_active('journal')}">
594 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
594 <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}">
595 <div class="menulabel">${_('Journal')}</div>
595 <div class="menulabel">${_('Journal')}</div>
596 </a>
596 </a>
597 </li>
597 </li>
598 %else:
598 %else:
599 <li class="${is_active('journal')}">
599 <li class="${is_active('journal')}">
600 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
600 <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}">
601 <div class="menulabel">${_('Public journal')}</div>
601 <div class="menulabel">${_('Public journal')}</div>
602 </a>
602 </a>
603 </li>
603 </li>
604 %endif
604 %endif
605
605
606 <li class="${is_active('gists')}">
606 <li class="${is_active('gists')}">
607 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
607 <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}">
608 <div class="menulabel">${_('Gists')}</div>
608 <div class="menulabel">${_('Gists')}</div>
609 </a>
609 </a>
610 </li>
610 </li>
611
611
612 % if c.is_super_admin or c.is_delegated_admin:
612 % if c.is_super_admin or c.is_delegated_admin:
613 <li class="${is_active('admin')}">
613 <li class="${is_active('admin')}">
614 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
614 <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}">
615 <div class="menulabel">${_('Admin')} </div>
615 <div class="menulabel">${_('Admin')} </div>
616 </a>
616 </a>
617 </li>
617 </li>
618 % endif
618 % endif
619
619
620 ## render extra user menu
620 ## render extra user menu
621 ${usermenu(active=(active=='my_account'))}
621 ${usermenu(active=(active=='my_account'))}
622
622
623 % if c.debug_style:
623 % if c.debug_style:
624 <li>
624 <li>
625 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
625 <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}">
626 <div class="menulabel">${_('[Style]')}</div>
626 <div class="menulabel">${_('[Style]')}</div>
627 </a>
627 </a>
628 </li>
628 </li>
629 % endif
629 % endif
630 </ul>
630 </ul>
631
631
632 <script type="text/javascript">
632 <script type="text/javascript">
633 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
633 var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True";
634
634
635 var formatRepoResult = function(result, container, query, escapeMarkup) {
635 var formatRepoResult = function(result, container, query, escapeMarkup) {
636 return function(data, escapeMarkup) {
636 return function(data, escapeMarkup) {
637 if (!data.repo_id){
637 if (!data.repo_id){
638 return data.text; // optgroup text Repositories
638 return data.text; // optgroup text Repositories
639 }
639 }
640
640
641 var tmpl = '';
641 var tmpl = '';
642 var repoType = data['repo_type'];
642 var repoType = data['repo_type'];
643 var repoName = data['text'];
643 var repoName = data['text'];
644
644
645 if(data && data.type == 'repo'){
645 if(data && data.type == 'repo'){
646 if(repoType === 'hg'){
646 if(repoType === 'hg'){
647 tmpl += '<i class="icon-hg"></i> ';
647 tmpl += '<i class="icon-hg"></i> ';
648 }
648 }
649 else if(repoType === 'git'){
649 else if(repoType === 'git'){
650 tmpl += '<i class="icon-git"></i> ';
650 tmpl += '<i class="icon-git"></i> ';
651 }
651 }
652 else if(repoType === 'svn'){
652 else if(repoType === 'svn'){
653 tmpl += '<i class="icon-svn"></i> ';
653 tmpl += '<i class="icon-svn"></i> ';
654 }
654 }
655 if(data['private']){
655 if(data['private']){
656 tmpl += '<i class="icon-lock" ></i> ';
656 tmpl += '<i class="icon-lock" ></i> ';
657 }
657 }
658 else if(visualShowPublicIcon){
658 else if(visualShowPublicIcon){
659 tmpl += '<i class="icon-unlock-alt"></i> ';
659 tmpl += '<i class="icon-unlock-alt"></i> ';
660 }
660 }
661 }
661 }
662 tmpl += escapeMarkup(repoName);
662 tmpl += escapeMarkup(repoName);
663 return tmpl;
663 return tmpl;
664
664
665 }(result, escapeMarkup);
665 }(result, escapeMarkup);
666 };
666 };
667
667
668 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
668 var formatRepoGroupResult = function(result, container, query, escapeMarkup) {
669 return function(data, escapeMarkup) {
669 return function(data, escapeMarkup) {
670 if (!data.repo_group_id){
670 if (!data.repo_group_id){
671 return data.text; // optgroup text Repositories
671 return data.text; // optgroup text Repositories
672 }
672 }
673
673
674 var tmpl = '';
674 var tmpl = '';
675 var repoGroupName = data['text'];
675 var repoGroupName = data['text'];
676
676
677 if(data){
677 if(data){
678
678
679 tmpl += '<i class="icon-folder-close"></i> ';
679 tmpl += '<i class="icon-folder-close"></i> ';
680
680
681 }
681 }
682 tmpl += escapeMarkup(repoGroupName);
682 tmpl += escapeMarkup(repoGroupName);
683 return tmpl;
683 return tmpl;
684
684
685 }(result, escapeMarkup);
685 }(result, escapeMarkup);
686 };
686 };
687
687
688 var escapeRegExChars = function (value) {
688 var escapeRegExChars = function (value) {
689 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
689 return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
690 };
690 };
691
691
692 var getRepoIcon = function(repo_type) {
692 var getRepoIcon = function(repo_type) {
693 if (repo_type === 'hg') {
693 if (repo_type === 'hg') {
694 return '<i class="icon-hg"></i> ';
694 return '<i class="icon-hg"></i> ';
695 }
695 }
696 else if (repo_type === 'git') {
696 else if (repo_type === 'git') {
697 return '<i class="icon-git"></i> ';
697 return '<i class="icon-git"></i> ';
698 }
698 }
699 else if (repo_type === 'svn') {
699 else if (repo_type === 'svn') {
700 return '<i class="icon-svn"></i> ';
700 return '<i class="icon-svn"></i> ';
701 }
701 }
702 return ''
702 return ''
703 };
703 };
704
704
705 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
705 var autocompleteMainFilterFormatResult = function (data, value, org_formatter) {
706
706
707 if (value.split(':').length === 2) {
707 if (value.split(':').length === 2) {
708 value = value.split(':')[1]
708 value = value.split(':')[1]
709 }
709 }
710
710
711 var searchType = data['type'];
711 var searchType = data['type'];
712 var valueDisplay = data['value_display'];
712 var valueDisplay = data['value_display'];
713
713
714 var pattern = '(' + escapeRegExChars(value) + ')';
714 var pattern = '(' + escapeRegExChars(value) + ')';
715
715
716 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
716 valueDisplay = Select2.util.escapeMarkup(valueDisplay);
717
717
718 // highlight match
718 // highlight match
719 if (searchType != 'text') {
719 if (searchType != 'text') {
720 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
720 valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
721 }
721 }
722
722
723 var icon = '';
723 var icon = '';
724
724
725 if (searchType === 'hint') {
725 if (searchType === 'hint') {
726 icon += '<i class="icon-folder-close"></i> ';
726 icon += '<i class="icon-folder-close"></i> ';
727 }
727 }
728 // full text search
728 // full text search
729 else if (searchType === 'search') {
729 else if (searchType === 'search') {
730 icon += '<i class="icon-more"></i> ';
730 icon += '<i class="icon-more"></i> ';
731 }
731 }
732 // repository
732 // repository
733 else if (searchType === 'repo') {
733 else if (searchType === 'repo') {
734
734
735 var repoIcon = getRepoIcon(data['repo_type']);
735 var repoIcon = getRepoIcon(data['repo_type']);
736 icon += repoIcon;
736 icon += repoIcon;
737
737
738 if (data['private']) {
738 if (data['private']) {
739 icon += '<i class="icon-lock" ></i> ';
739 icon += '<i class="icon-lock" ></i> ';
740 }
740 }
741 else if (visualShowPublicIcon) {
741 else if (visualShowPublicIcon) {
742 icon += '<i class="icon-unlock-alt"></i> ';
742 icon += '<i class="icon-unlock-alt"></i> ';
743 }
743 }
744 }
744 }
745 // repository groups
745 // repository groups
746 else if (searchType === 'repo_group') {
746 else if (searchType === 'repo_group') {
747 icon += '<i class="icon-folder-close"></i> ';
747 icon += '<i class="icon-folder-close"></i> ';
748 }
748 }
749 // user group
749 // user group
750 else if (searchType === 'user_group') {
750 else if (searchType === 'user_group') {
751 icon += '<i class="icon-group"></i> ';
751 icon += '<i class="icon-group"></i> ';
752 }
752 }
753 // user
753 // user
754 else if (searchType === 'user') {
754 else if (searchType === 'user') {
755 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
755 icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']);
756 }
756 }
757 // commit
757 // commit
758 else if (searchType === 'commit') {
758 else if (searchType === 'commit') {
759 var repo_data = data['repo_data'];
759 var repo_data = data['repo_data'];
760 var repoIcon = getRepoIcon(repo_data['repository_type']);
760 var repoIcon = getRepoIcon(repo_data['repository_type']);
761 if (repoIcon) {
761 if (repoIcon) {
762 icon += repoIcon;
762 icon += repoIcon;
763 } else {
763 } else {
764 icon += '<i class="icon-tag"></i>';
764 icon += '<i class="icon-tag"></i>';
765 }
765 }
766 }
766 }
767 // file
767 // file
768 else if (searchType === 'file') {
768 else if (searchType === 'file') {
769 var repo_data = data['repo_data'];
769 var repo_data = data['repo_data'];
770 var repoIcon = getRepoIcon(repo_data['repository_type']);
770 var repoIcon = getRepoIcon(repo_data['repository_type']);
771 if (repoIcon) {
771 if (repoIcon) {
772 icon += repoIcon;
772 icon += repoIcon;
773 } else {
773 } else {
774 icon += '<i class="icon-tag"></i>';
774 icon += '<i class="icon-tag"></i>';
775 }
775 }
776 }
776 }
777 // generic text
777 // generic text
778 else if (searchType === 'text') {
778 else if (searchType === 'text') {
779 icon = '';
779 icon = '';
780 }
780 }
781
781
782 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
782 var tmpl = '<div class="ac-container-wrap">{0}{1}</div>';
783 return tmpl.format(icon, valueDisplay);
783 return tmpl.format(icon, valueDisplay);
784 };
784 };
785
785
786 var handleSelect = function(element, suggestion) {
786 var handleSelect = function(element, suggestion) {
787 if (suggestion.type === "hint") {
787 if (suggestion.type === "hint") {
788 // we skip action
788 // we skip action
789 $('#main_filter').focus();
789 $('#main_filter').focus();
790 }
790 }
791 else if (suggestion.type === "text") {
791 else if (suggestion.type === "text") {
792 // we skip action
792 // we skip action
793 $('#main_filter').focus();
793 $('#main_filter').focus();
794
794
795 } else {
795 } else {
796 window.location = suggestion['url'];
796 window.location = suggestion['url'];
797 }
797 }
798 };
798 };
799
799
800 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
800 var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) {
801 if (queryLowerCase.split(':').length === 2) {
801 if (queryLowerCase.split(':').length === 2) {
802 queryLowerCase = queryLowerCase.split(':')[1]
802 queryLowerCase = queryLowerCase.split(':')[1]
803 }
803 }
804 if (suggestion.type === "text") {
804 if (suggestion.type === "text") {
805 // special case we don't want to "skip" display for
805 // special case we don't want to "skip" display for
806 return true
806 return true
807 }
807 }
808 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
808 return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1;
809 };
809 };
810
810
811 var cleanContext = {
811 var cleanContext = {
812 repo_view_type: null,
812 repo_view_type: null,
813
813
814 repo_id: null,
814 repo_id: null,
815 repo_name: "",
815 repo_name: "",
816
816
817 repo_group_id: null,
817 repo_group_id: null,
818 repo_group_name: null
818 repo_group_name: null
819 };
819 };
820 var removeGoToFilter = function () {
820 var removeGoToFilter = function () {
821 $('.searchTagHidable').hide();
821 $('.searchTagHidable').hide();
822 $('#main_filter').autocomplete(
822 $('#main_filter').autocomplete(
823 'setOptions', {params:{search_context: cleanContext}});
823 'setOptions', {params:{search_context: cleanContext}});
824 };
824 };
825
825
826 $('#main_filter').autocomplete({
826 $('#main_filter').autocomplete({
827 serviceUrl: pyroutes.url('goto_switcher_data'),
827 serviceUrl: pyroutes.url('goto_switcher_data'),
828 params: {
828 params: {
829 "search_context": templateContext.search_context
829 "search_context": templateContext.search_context
830 },
830 },
831 minChars:2,
831 minChars:2,
832 maxHeight:400,
832 maxHeight:400,
833 deferRequestBy: 300, //miliseconds
833 deferRequestBy: 300, //miliseconds
834 tabDisabled: true,
834 tabDisabled: true,
835 autoSelectFirst: false,
835 autoSelectFirst: false,
836 formatResult: autocompleteMainFilterFormatResult,
836 formatResult: autocompleteMainFilterFormatResult,
837 lookupFilter: autocompleteMainFilterResult,
837 lookupFilter: autocompleteMainFilterResult,
838 onSelect: function (element, suggestion) {
838 onSelect: function (element, suggestion) {
839 handleSelect(element, suggestion);
839 handleSelect(element, suggestion);
840 return false;
840 return false;
841 },
841 },
842 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
842 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
843 if (jqXHR !== 'abort') {
843 if (jqXHR !== 'abort') {
844 alert("Error during search.\nError code: {0}".format(textStatus));
844 alert("Error during search.\nError code: {0}".format(textStatus));
845 window.location = '';
845 window.location = '';
846 }
846 }
847 }
847 }
848 });
848 });
849
849
850 showMainFilterBox = function () {
850 showMainFilterBox = function () {
851 $('#main_filter_help').toggle();
851 $('#main_filter_help').toggle();
852 };
852 };
853
853
854 $('#main_filter').on('keydown.autocomplete', function (e) {
854 $('#main_filter').on('keydown.autocomplete', function (e) {
855
855
856 var BACKSPACE = 8;
856 var BACKSPACE = 8;
857 var el = $(e.currentTarget);
857 var el = $(e.currentTarget);
858 if(e.which === BACKSPACE){
858 if(e.which === BACKSPACE){
859 var inputVal = el.val();
859 var inputVal = el.val();
860 if (inputVal === ""){
860 if (inputVal === ""){
861 removeGoToFilter()
861 removeGoToFilter()
862 }
862 }
863 }
863 }
864 });
864 });
865
865
866 </script>
866 </script>
867 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
867 <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
868 </%def>
868 </%def>
869
869
870 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
870 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
871 <div class="modal-dialog">
871 <div class="modal-dialog">
872 <div class="modal-content">
872 <div class="modal-content">
873 <div class="modal-header">
873 <div class="modal-header">
874 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
874 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
875 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
875 <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4>
876 </div>
876 </div>
877 <div class="modal-body">
877 <div class="modal-body">
878 <div class="block-left">
878 <div class="block-left">
879 <table class="keyboard-mappings">
879 <table class="keyboard-mappings">
880 <tbody>
880 <tbody>
881 <tr>
881 <tr>
882 <th></th>
882 <th></th>
883 <th>${_('Site-wide shortcuts')}</th>
883 <th>${_('Site-wide shortcuts')}</th>
884 </tr>
884 </tr>
885 <%
885 <%
886 elems = [
886 elems = [
887 ('/', 'Use quick search box'),
887 ('/', 'Use quick search box'),
888 ('g h', 'Goto home page'),
888 ('g h', 'Goto home page'),
889 ('g g', 'Goto my private gists page'),
889 ('g g', 'Goto my private gists page'),
890 ('g G', 'Goto my public gists page'),
890 ('g G', 'Goto my public gists page'),
891 ('g 0-9', 'Goto bookmarked items from 0-9'),
891 ('g 0-9', 'Goto bookmarked items from 0-9'),
892 ('n r', 'New repository page'),
892 ('n r', 'New repository page'),
893 ('n g', 'New gist page'),
893 ('n g', 'New gist page'),
894 ]
894 ]
895 %>
895 %>
896 %for key, desc in elems:
896 %for key, desc in elems:
897 <tr>
897 <tr>
898 <td class="keys">
898 <td class="keys">
899 <span class="key tag">${key}</span>
899 <span class="key tag">${key}</span>
900 </td>
900 </td>
901 <td>${desc}</td>
901 <td>${desc}</td>
902 </tr>
902 </tr>
903 %endfor
903 %endfor
904 </tbody>
904 </tbody>
905 </table>
905 </table>
906 </div>
906 </div>
907 <div class="block-left">
907 <div class="block-left">
908 <table class="keyboard-mappings">
908 <table class="keyboard-mappings">
909 <tbody>
909 <tbody>
910 <tr>
910 <tr>
911 <th></th>
911 <th></th>
912 <th>${_('Repositories')}</th>
912 <th>${_('Repositories')}</th>
913 </tr>
913 </tr>
914 <%
914 <%
915 elems = [
915 elems = [
916 ('g s', 'Goto summary page'),
916 ('g s', 'Goto summary page'),
917 ('g c', 'Goto changelog page'),
917 ('g c', 'Goto changelog page'),
918 ('g f', 'Goto files page'),
918 ('g f', 'Goto files page'),
919 ('g F', 'Goto files page with file search activated'),
919 ('g F', 'Goto files page with file search activated'),
920 ('g p', 'Goto pull requests page'),
920 ('g p', 'Goto pull requests page'),
921 ('g o', 'Goto repository settings'),
921 ('g o', 'Goto repository settings'),
922 ('g O', 'Goto repository permissions settings'),
922 ('g O', 'Goto repository permissions settings'),
923 ]
923 ]
924 %>
924 %>
925 %for key, desc in elems:
925 %for key, desc in elems:
926 <tr>
926 <tr>
927 <td class="keys">
927 <td class="keys">
928 <span class="key tag">${key}</span>
928 <span class="key tag">${key}</span>
929 </td>
929 </td>
930 <td>${desc}</td>
930 <td>${desc}</td>
931 </tr>
931 </tr>
932 %endfor
932 %endfor
933 </tbody>
933 </tbody>
934 </table>
934 </table>
935 </div>
935 </div>
936 </div>
936 </div>
937 <div class="modal-footer">
937 <div class="modal-footer">
938 </div>
938 </div>
939 </div><!-- /.modal-content -->
939 </div><!-- /.modal-content -->
940 </div><!-- /.modal-dialog -->
940 </div><!-- /.modal-dialog -->
941 </div><!-- /.modal -->
941 </div><!-- /.modal -->
942
942
General Comments 0
You need to be logged in to leave comments. Login now