##// END OF EJS Templates
Implements #734 repo switcher should be available in all views
marcink -
r3209:e7600fe1 beta
parent child Browse files
Show More
@@ -144,9 +144,6 b''
144 if selected == current:
144 if selected == current:
145 return h.literal('class="current"')
145 return h.literal('class="current"')
146 %>
146 %>
147 ## we render this menu only not for those pages
148 %if current not in ['home','admin', 'search', 'journal']:
149 ##REGULAR MENU
150 <ul id="quick">
147 <ul id="quick">
151 <!-- repo switcher -->
148 <!-- repo switcher -->
152 <li>
149 <li>
@@ -162,7 +159,9 b''
162 </li>
159 </li>
163 </ul>
160 </ul>
164 </li>
161 </li>
165
162 ## we render this menu only not for those pages
163 %if current not in ['home','admin', 'search', 'journal']:
164 ##REGULAR MENU
166 <li ${is_current('summary')}>
165 <li ${is_current('summary')}>
167 <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
166 <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
168 <span class="icon">
167 <span class="icon">
@@ -179,7 +178,6 b''
179 <span>${_('Changelog')}</span>
178 <span>${_('Changelog')}</span>
180 </a>
179 </a>
181 </li>
180 </li>
182
183 <li ${is_current('switch_to')}>
181 <li ${is_current('switch_to')}>
184 <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#">
182 <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#">
185 <span class="icon">
183 <span class="icon">
@@ -199,7 +197,6 b''
199 <span>${_('Files')}</span>
197 <span>${_('Files')}</span>
200 </a>
198 </a>
201 </li>
199 </li>
202
203 <li ${is_current('options')}>
200 <li ${is_current('options')}>
204 <a class="menu_link" title="${_('Options')}" href="#">
201 <a class="menu_link" title="${_('Options')}" href="#">
205 <span class="icon">
202 <span class="icon">
@@ -255,7 +252,6 b''
255 % endif
252 % endif
256 </ul>
253 </ul>
257 </li>
254 </li>
258
259 <li>
255 <li>
260 <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
256 <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
261 <span class="icon_short">
257 <span class="icon_short">
@@ -281,28 +277,7 b''
281 </a>
277 </a>
282 </li>
278 </li>
283 ${usermenu()}
279 ${usermenu()}
284 </ul>
285 <script type="text/javascript">
280 <script type="text/javascript">
286 YUE.on('repo_switcher','mouseover',function(){
287 function qfilter(){
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){
297 YUD.addClass('repo_switcher','loaded');
298 ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
299 function(o){qfilter();},
300 function(o){YUD.removeClass('repo_switcher','loaded');}
301 ,null);
302 }
303 return false;
304 });
305
306 YUE.on('branch_tag_switcher','mouseover',function(){
281 YUE.on('branch_tag_switcher','mouseover',function(){
307 var loaded = YUD.hasClass('branch_tag_switcher','loaded');
282 var loaded = YUD.hasClass('branch_tag_switcher','loaded');
308 if(!loaded){
283 if(!loaded){
@@ -317,7 +292,6 b''
317 </script>
292 </script>
318 %else:
293 %else:
319 ##ROOT MENU
294 ##ROOT MENU
320 <ul id="quick">
321 <li ${is_current('home')}>
295 <li ${is_current('home')}>
322 <a class="menu_link" title="${_('Home')}" href="${h.url('home')}">
296 <a class="menu_link" title="${_('Home')}" href="${h.url('home')}">
323 <span class="icon">
297 <span class="icon">
@@ -353,7 +327,6 b''
353 <span>${_('Search')}</span>
327 <span>${_('Search')}</span>
354 </a>
328 </a>
355 </li>
329 </li>
356
357 %if h.HasPermissionAll('hg.admin')('access admin main page'):
330 %if h.HasPermissionAll('hg.admin')('access admin main page'):
358 <li ${is_current('admin')}>
331 <li ${is_current('admin')}>
359 <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
332 <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
@@ -366,6 +339,26 b''
366 </li>
339 </li>
367 %endif
340 %endif
368 ${usermenu()}
341 ${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