Show More
@@ -144,228 +144,221 b'' | |||||
144 | if selected == current: |
|
144 | if selected == current: | |
145 | return h.literal('class="current"') |
|
145 | return h.literal('class="current"') | |
146 | %> |
|
146 | %> | |
|
147 | <ul id="quick"> | |||
|
148 | <!-- repo switcher --> | |||
|
149 | <li> | |||
|
150 | <a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="#"> | |||
|
151 | <span class="icon"> | |||
|
152 | <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" /> | |||
|
153 | </span> | |||
|
154 | <span>${_('Repositories')}</span> | |||
|
155 | </a> | |||
|
156 | <ul id="repo_switcher_list" class="repo_switcher"> | |||
|
157 | <li> | |||
|
158 | <a href="#">${_('loading...')}</a> | |||
|
159 | </li> | |||
|
160 | </ul> | |||
|
161 | </li> | |||
147 | ## we render this menu only not for those pages |
|
162 | ## we render this menu only not for those pages | |
148 | %if current not in ['home','admin', 'search', 'journal']: |
|
163 | %if current not in ['home','admin', 'search', 'journal']: | |
149 | ##REGULAR MENU |
|
164 | ##REGULAR MENU | |
150 | <ul id="quick"> |
|
165 | <li ${is_current('summary')}> | |
151 | <!-- repo switcher --> |
|
166 | <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}"> | |
152 |
|
|
167 | <span class="icon"> | |
153 | <a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="#"> |
|
168 | <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" /> | |
154 |
|
|
169 | </span> | |
155 | <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" /> |
|
170 | <span>${_('Summary')}</span> | |
156 |
|
|
171 | </a> | |
157 | <span>${_('Repositories')}</span> |
|
172 | </li> | |
158 | </a> |
|
173 | <li ${is_current('changelog')}> | |
159 | <ul id="repo_switcher_list" class="repo_switcher"> |
|
174 | <a class="menu_link" title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> | |
160 |
|
|
175 | <span class="icon"> | |
161 | <a href="#">${_('loading...')}</a> |
|
176 | <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" /> | |
162 |
|
|
177 | </span> | |
163 | </ul> |
|
178 | <span>${_('Changelog')}</span> | |
164 |
|
|
179 | </a> | |
165 |
|
180 | </li> | ||
166 |
|
|
181 | <li ${is_current('switch_to')}> | |
167 | <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}"> |
|
182 | <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#"> | |
168 |
|
|
183 | <span class="icon"> | |
169 |
|
|
184 | <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" /> | |
170 |
|
|
185 | </span> | |
171 |
|
|
186 | <span>${_('Switch to')}</span> | |
172 |
|
|
187 | </a> | |
173 | </li> |
|
188 | <ul id="switch_to_list" class="switch_to"> | |
174 | <li ${is_current('changelog')}> |
|
189 | <li><a href="#">${_('loading...')}</a></li> | |
175 | <a class="menu_link" title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> |
|
190 | </ul> | |
176 | <span class="icon"> |
|
191 | </li> | |
177 | <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" /> |
|
192 | <li ${is_current('files')}> | |
178 | </span> |
|
193 | <a class="menu_link" title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}"> | |
179 | <span>${_('Changelog')}</span> |
|
194 | <span class="icon"> | |
180 | </a> |
|
195 | <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" /> | |
181 |
|
|
196 | </span> | |
|
197 | <span>${_('Files')}</span> | |||
|
198 | </a> | |||
|
199 | </li> | |||
|
200 | <li ${is_current('options')}> | |||
|
201 | <a class="menu_link" title="${_('Options')}" href="#"> | |||
|
202 | <span class="icon"> | |||
|
203 | <img src="${h.url('/images/icons/table_gear.png')}" alt="${_('Admin')}" /> | |||
|
204 | </span> | |||
|
205 | <span>${_('Options')}</span> | |||
|
206 | </a> | |||
|
207 | <ul> | |||
|
208 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |||
|
209 | %if h.HasPermissionAll('hg.admin')('access settings on repository'): | |||
|
210 | <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> | |||
|
211 | %else: | |||
|
212 | <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> | |||
|
213 | %endif | |||
|
214 | %endif | |||
182 |
|
215 | |||
183 | <li ${is_current('switch_to')}> |
|
216 | <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li> | |
184 | <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#"> |
|
217 | %if h.is_hg(c.rhodecode_repo): | |
185 | <span class="icon"> |
|
218 | <li>${h.link_to(_('open new pull request'),h.url('pullrequest_home',repo_name=c.repo_name),class_='pull_request')}</li> | |
186 | <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" /> |
|
219 | %endif | |
187 | </span> |
|
220 | %if c.rhodecode_db_repo.fork: | |
188 | <span>${_('Switch to')}</span> |
|
221 | <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name),class_='compare_request')}</li> | |
189 |
|
|
222 | %endif | |
190 | <ul id="switch_to_list" class="switch_to"> |
|
223 | <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li> | |
191 | <li><a href="#">${_('loading...')}</a></li> |
|
|||
192 | </ul> |
|
|||
193 | </li> |
|
|||
194 | <li ${is_current('files')}> |
|
|||
195 | <a class="menu_link" title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}"> |
|
|||
196 | <span class="icon"> |
|
|||
197 | <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" /> |
|
|||
198 | </span> |
|
|||
199 | <span>${_('Files')}</span> |
|
|||
200 | </a> |
|
|||
201 | </li> |
|
|||
202 |
|
||||
203 | <li ${is_current('options')}> |
|
|||
204 | <a class="menu_link" title="${_('Options')}" href="#"> |
|
|||
205 | <span class="icon"> |
|
|||
206 | <img src="${h.url('/images/icons/table_gear.png')}" alt="${_('Admin')}" /> |
|
|||
207 | </span> |
|
|||
208 | <span>${_('Options')}</span> |
|
|||
209 | </a> |
|
|||
210 | <ul> |
|
|||
211 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
|||
212 | %if h.HasPermissionAll('hg.admin')('access settings on repository'): |
|
|||
213 | <li>${h.link_to(_('repository settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li> |
|
|||
214 | %else: |
|
|||
215 | <li>${h.link_to(_('repository settings'),h.url('repo_settings_home',repo_name=c.repo_name),class_='settings')}</li> |
|
|||
216 | %endif |
|
|||
217 | %endif |
|
|||
218 |
|
224 | |||
219 | <li>${h.link_to(_('fork'),h.url('repo_fork_home',repo_name=c.repo_name),class_='fork')}</li> |
|
225 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
220 |
|
|
226 | %if c.rhodecode_db_repo.locked[0]: | |
221 |
|
|
227 | <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> | |
222 |
|
|
228 | %else: | |
223 | %if c.rhodecode_db_repo.fork: |
|
229 | <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> | |
224 | <li>${h.link_to(_('compare fork'),h.url('compare_url',repo_name=c.repo_name,org_ref_type='branch',org_ref=request.GET.get('branch') or 'default',other_ref_type='branch',other_ref='default',repo=c.rhodecode_db_repo.fork.repo_name),class_='compare_request')}</li> |
|
230 | %endif | |
225 |
|
|
231 | %endif | |
226 | <li>${h.link_to(_('search'),h.url('search_repo',search_repo=c.repo_name),class_='search')}</li> |
|
|||
227 |
|
||||
228 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: |
|
|||
229 | %if c.rhodecode_db_repo.locked[0]: |
|
|||
230 | <li>${h.link_to(_('unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li> |
|
|||
231 | %else: |
|
|||
232 | <li>${h.link_to(_('lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li> |
|
|||
233 | %endif |
|
|||
234 | %endif |
|
|||
235 |
|
||||
236 | % if h.HasPermissionAll('hg.admin')('access admin main page'): |
|
|||
237 | <li> |
|
|||
238 | ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} |
|
|||
239 | <%def name="admin_menu()"> |
|
|||
240 | <ul> |
|
|||
241 | <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li> |
|
|||
242 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> |
|
|||
243 | <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> |
|
|||
244 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> |
|
|||
245 | <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li> |
|
|||
246 | <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> |
|
|||
247 | <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> |
|
|||
248 | <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> |
|
|||
249 | <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> |
|
|||
250 | </ul> |
|
|||
251 | </%def> |
|
|||
252 | ## ADMIN MENU |
|
|||
253 | ${admin_menu()} |
|
|||
254 | </li> |
|
|||
255 | % endif |
|
|||
256 | </ul> |
|
|||
257 | </li> |
|
|||
258 |
|
232 | |||
259 | <li> |
|
233 | % if h.HasPermissionAll('hg.admin')('access admin main page'): | |
260 | <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> |
|
234 | <li> | |
261 | <span class="icon_short"> |
|
235 | ${h.link_to(_('admin'),h.url('admin_home'),class_='admin')} | |
262 | <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" /> |
|
236 | <%def name="admin_menu()"> | |
263 |
< |
|
237 | <ul> | |
264 | <span id="current_followers_count" class="short">${c.repository_followers}</span> |
|
238 | <li>${h.link_to(_('journal'),h.url('admin_home'),class_='journal')}</li> | |
265 | </a> |
|
239 | <li>${h.link_to(_('repositories'),h.url('repos'),class_='repos')}</li> | |
266 | </li> |
|
240 | <li>${h.link_to(_('repositories groups'),h.url('repos_groups'),class_='repos_groups')}</li> | |
267 | <li> |
|
241 | <li>${h.link_to(_('users'),h.url('users'),class_='users')}</li> | |
268 | <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> |
|
242 | <li>${h.link_to(_('users groups'),h.url('users_groups'),class_='groups')}</li> | |
269 | <span class="icon_short"> |
|
243 | <li>${h.link_to(_('permissions'),h.url('edit_permission',id='default'),class_='permissions')}</li> | |
270 | <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" /> |
|
244 | <li>${h.link_to(_('ldap'),h.url('ldap_home'),class_='ldap')}</li> | |
271 | </span> |
|
245 | <li>${h.link_to(_('defaults'),h.url('defaults'),class_='defaults')}</li> | |
272 | <span class="short">${c.repository_forks}</span> |
|
246 | <li class="last">${h.link_to(_('settings'),h.url('admin_settings'),class_='settings')}</li> | |
273 |
</ |
|
247 | </ul> | |
274 |
</ |
|
248 | </%def> | |
275 |
|
|
249 | ## ADMIN MENU | |
276 | <a class="menu_link" title="${_('Pull requests')}" href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}"> |
|
250 | ${admin_menu()} | |
277 |
|
|
251 | </li> | |
278 | <img src="${h.url('/images/icons/arrow_join.png')}" alt="${_('Pull requests')}" /> |
|
252 | % endif | |
279 |
|
|
253 | </ul> | |
280 | <span class="short">${c.repository_pull_requests}</span> |
|
254 | </li> | |
281 |
|
|
255 | <li> | |
282 | </li> |
|
256 | <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> | |
283 | ${usermenu()} |
|
257 | <span class="icon_short"> | |
284 | </ul> |
|
258 | <img src="${h.url('/images/icons/heart.png')}" alt="${_('Followers')}" /> | |
|
259 | </span> | |||
|
260 | <span id="current_followers_count" class="short">${c.repository_followers}</span> | |||
|
261 | </a> | |||
|
262 | </li> | |||
|
263 | <li> | |||
|
264 | <a class="menu_link" title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> | |||
|
265 | <span class="icon_short"> | |||
|
266 | <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Forks')}" /> | |||
|
267 | </span> | |||
|
268 | <span class="short">${c.repository_forks}</span> | |||
|
269 | </a> | |||
|
270 | </li> | |||
|
271 | <li> | |||
|
272 | <a class="menu_link" title="${_('Pull requests')}" href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}"> | |||
|
273 | <span class="icon_short"> | |||
|
274 | <img src="${h.url('/images/icons/arrow_join.png')}" alt="${_('Pull requests')}" /> | |||
|
275 | </span> | |||
|
276 | <span class="short">${c.repository_pull_requests}</span> | |||
|
277 | </a> | |||
|
278 | </li> | |||
|
279 | ${usermenu()} | |||
285 | <script type="text/javascript"> |
|
280 | <script type="text/javascript"> | |
286 |
YUE.on(' |
|
281 | YUE.on('branch_tag_switcher','mouseover',function(){ | |
287 | function qfilter(){ |
|
282 | var loaded = YUD.hasClass('branch_tag_switcher','loaded'); | |
288 | var nodes = YUQ('ul#repo_switcher_list li a.repo_name'); |
|
|||
289 | var target = 'q_filter_rs'; |
|
|||
290 | var func = function(node){ |
|
|||
291 | return node.parentNode; |
|
|||
292 | } |
|
|||
293 | q_filter(target,nodes,func); |
|
|||
294 | } |
|
|||
295 | var loaded = YUD.hasClass('repo_switcher','loaded'); |
|
|||
296 | if(!loaded){ |
|
283 | if(!loaded){ | |
297 |
YUD.addClass(' |
|
284 | YUD.addClass('branch_tag_switcher','loaded'); | |
298 |
ypjax("${h.url(' |
|
285 | ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list', | |
299 |
function(o){ |
|
286 | function(o){}, | |
300 |
function(o){YUD.removeClass(' |
|
287 | function(o){YUD.removeClass('branch_tag_switcher','loaded');} | |
301 | ,null); |
|
288 | ,null); | |
302 | } |
|
289 | } | |
303 | return false; |
|
290 | return false; | |
304 | }); |
|
291 | }); | |
305 |
|
||||
306 | YUE.on('branch_tag_switcher','mouseover',function(){ |
|
|||
307 | var loaded = YUD.hasClass('branch_tag_switcher','loaded'); |
|
|||
308 | if(!loaded){ |
|
|||
309 | YUD.addClass('branch_tag_switcher','loaded'); |
|
|||
310 | ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list', |
|
|||
311 | function(o){}, |
|
|||
312 | function(o){YUD.removeClass('branch_tag_switcher','loaded');} |
|
|||
313 | ,null); |
|
|||
314 | } |
|
|||
315 | return false; |
|
|||
316 | }); |
|
|||
317 | </script> |
|
292 | </script> | |
318 | %else: |
|
293 | %else: | |
319 | ##ROOT MENU |
|
294 | ##ROOT MENU | |
320 | <ul id="quick"> |
|
295 | <li ${is_current('home')}> | |
321 | <li ${is_current('home')}> |
|
296 | <a class="menu_link" title="${_('Home')}" href="${h.url('home')}"> | |
322 | <a class="menu_link" title="${_('Home')}" href="${h.url('home')}"> |
|
297 | <span class="icon"> | |
323 | <span class="icon"> |
|
298 | <img src="${h.url('/images/icons/home_16.png')}" alt="${_('Home')}" /> | |
324 | <img src="${h.url('/images/icons/home_16.png')}" alt="${_('Home')}" /> |
|
299 | </span> | |
325 |
|
|
300 | <span>${_('Home')}</span> | |
326 | <span>${_('Home')}</span> |
|
301 | </a> | |
327 |
|
|
302 | </li> | |
328 | </li> |
|
303 | %if c.rhodecode_user.username != 'default': | |
329 | %if c.rhodecode_user.username != 'default': |
|
304 | <li ${is_current('journal')}> | |
330 | <li ${is_current('journal')}> |
|
305 | <a class="menu_link" title="${_('Journal')}" href="${h.url('journal')}"> | |
331 | <a class="menu_link" title="${_('Journal')}" href="${h.url('journal')}"> |
|
306 | <span class="icon"> | |
332 | <span class="icon"> |
|
307 | <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" /> | |
333 | <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" /> |
|
308 | </span> | |
334 |
|
|
309 | <span>${_('Journal')}</span> | |
335 | <span>${_('Journal')}</span> |
|
310 | </a> | |
336 |
|
|
311 | </li> | |
337 |
|
|
312 | %else: | |
338 | %else: |
|
313 | <li ${is_current('journal')}> | |
339 | <li ${is_current('journal')}> |
|
314 | <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}"> | |
340 | <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}"> |
|
315 | <span class="icon"> | |
341 | <span class="icon"> |
|
316 | <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" /> | |
342 | <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" /> |
|
317 | </span> | |
343 | </span> |
|
318 | <span>${_('Public journal')}</span> | |
344 | <span>${_('Public journal')}</span> |
|
319 | </a> | |
345 |
|
|
320 | </li> | |
346 |
|
|
321 | %endif | |
347 | %endif |
|
322 | <li ${is_current('search')}> | |
348 | <li ${is_current('search')}> |
|
323 | <a class="menu_link" title="${_('Search')}" href="${h.url('search')}"> | |
349 | <a class="menu_link" title="${_('Search')}" href="${h.url('search')}"> |
|
324 | <span class="icon"> | |
350 | <span class="icon"> |
|
325 | <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" /> | |
351 | <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" /> |
|
326 | </span> | |
352 |
|
|
327 | <span>${_('Search')}</span> | |
353 | <span>${_('Search')}</span> |
|
328 | </a> | |
354 |
|
|
329 | </li> | |
355 | </li> |
|
330 | %if h.HasPermissionAll('hg.admin')('access admin main page'): | |
356 |
|
331 | <li ${is_current('admin')}> | ||
357 | %if h.HasPermissionAll('hg.admin')('access admin main page'): |
|
332 | <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}"> | |
358 | <li ${is_current('admin')}> |
|
333 | <span class="icon"> | |
359 | <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}"> |
|
334 | <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" /> | |
360 |
|
|
335 | </span> | |
361 | <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" /> |
|
336 | <span>${_('Admin')}</span> | |
362 |
|
|
337 | </a> | |
363 |
|
|
338 | ${admin_menu()} | |
364 |
|
|
339 | </li> | |
365 | ${admin_menu()} |
|
340 | %endif | |
366 | </li> |
|
341 | ${usermenu()} | |
367 | %endif |
|
|||
368 | ${usermenu()} |
|
|||
369 | </ul> |
|
|||
370 | %endif |
|
342 | %endif | |
|
343 | <script type="text/javascript"> | |||
|
344 | YUE.on('repo_switcher','mouseover',function(){ | |||
|
345 | function qfilter(){ | |||
|
346 | var nodes = YUQ('ul#repo_switcher_list li a.repo_name'); | |||
|
347 | var target = 'q_filter_rs'; | |||
|
348 | var func = function(node){ | |||
|
349 | return node.parentNode; | |||
|
350 | } | |||
|
351 | q_filter(target,nodes,func); | |||
|
352 | } | |||
|
353 | var loaded = YUD.hasClass('repo_switcher','loaded'); | |||
|
354 | if(!loaded){ | |||
|
355 | YUD.addClass('repo_switcher','loaded'); | |||
|
356 | ypjax("${h.url('repo_switcher')}",'repo_switcher_list', | |||
|
357 | function(o){qfilter();}, | |||
|
358 | function(o){YUD.removeClass('repo_switcher','loaded');} | |||
|
359 | ,null); | |||
|
360 | } | |||
|
361 | return false; | |||
|
362 | }); | |||
|
363 | </script> | |||
371 | </%def> |
|
364 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now