Changeset - e7600fe19943
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-01-23 22:16:54
marcin@python-works.com
Implements #734 repo switcher should be available in all views
1 file changed with 24 insertions and 31 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/base/base.html
Show inline comments
 
@@ -144,9 +144,6 @@
 
            if selected == current:
 
                return h.literal('class="current"')
 
        %>
 
        ## we render this menu only not for those pages 
 
        %if current not in ['home','admin', 'search', 'journal']:
 
            ##REGULAR MENU
 
            <ul id="quick">
 
                <!-- repo switcher -->
 
                <li>
 
@@ -162,7 +159,9 @@
 
                        </li>
 
                    </ul>
 
                </li>
 

	
 
        ## we render this menu only not for those pages 
 
        %if current not in ['home','admin', 'search', 'journal']:
 
            ##REGULAR MENU
 
                <li ${is_current('summary')}>
 
                   <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
 
                   <span class="icon">
 
@@ -179,7 +178,6 @@
 
                   <span>${_('Changelog')}</span>
 
                   </a>
 
                </li>
 

	
 
                <li ${is_current('switch_to')}>
 
                   <a class="menu_link" id="branch_tag_switcher" title="${_('Switch to')}" href="#">
 
                   <span class="icon">
 
@@ -199,7 +197,6 @@
 
                   <span>${_('Files')}</span>
 
                   </a>
 
                </li>
 

	
 
                <li ${is_current('options')}>
 
                   <a class="menu_link" title="${_('Options')}" href="#">
 
                   <span class="icon">
 
@@ -255,7 +252,6 @@
 
                    % endif
 
                   </ul>
 
                </li>
 

	
 
                <li>
 
                    <a class="menu_link" title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}">
 
                    <span class="icon_short">
 
@@ -281,28 +277,7 @@
 
                    </a>
 
                </li>
 
                ${usermenu()}
 
            </ul>
 
            <script type="text/javascript">
 
               YUE.on('repo_switcher','mouseover',function(){
 
                      function qfilter(){
 
                          var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
 
                          var target = 'q_filter_rs';
 
                          var func = function(node){
 
                              return node.parentNode;
 
                          }
 
                          q_filter(target,nodes,func);
 
                      }
 
                   var loaded = YUD.hasClass('repo_switcher','loaded');
 
                   if(!loaded){
 
                       YUD.addClass('repo_switcher','loaded');
 
                       ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
 
                           function(o){qfilter();},
 
                           function(o){YUD.removeClass('repo_switcher','loaded');}
 
                           ,null);
 
                   }
 
                   return false;
 
               });
 

	
 
              YUE.on('branch_tag_switcher','mouseover',function(){
 
                 var loaded = YUD.hasClass('branch_tag_switcher','loaded');
 
                 if(!loaded){
 
@@ -317,7 +292,6 @@
 
            </script>
 
        %else:
 
            ##ROOT MENU
 
            <ul id="quick">
 
                <li ${is_current('home')}>
 
                    <a class="menu_link" title="${_('Home')}"  href="${h.url('home')}">
 
                    <span class="icon">
 
@@ -353,7 +327,6 @@
 
                    <span>${_('Search')}</span>
 
                    </a>
 
                </li>
 

	
 
                %if h.HasPermissionAll('hg.admin')('access admin main page'):
 
                <li ${is_current('admin')}>
 
                   <a class="menu_link" title="${_('Admin')}" href="${h.url('admin_home')}">
 
@@ -366,6 +339,26 @@
 
                </li>
 
                %endif
 
                ${usermenu()}
 
            </ul>
 
        %endif
 
  <script type="text/javascript">
 
     YUE.on('repo_switcher','mouseover',function(){
 
            function qfilter(){
 
                var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
 
                var target = 'q_filter_rs';
 
                var func = function(node){
 
                    return node.parentNode;
 
                }
 
                q_filter(target,nodes,func);
 
            }
 
         var loaded = YUD.hasClass('repo_switcher','loaded');
 
         if(!loaded){
 
             YUD.addClass('repo_switcher','loaded');
 
             ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
 
                 function(o){qfilter();},
 
                 function(o){YUD.removeClass('repo_switcher','loaded');}
 
                 ,null);
 
         }
 
         return false;
 
     });
 
</script>                    
 
</%def>
0 comments (0 inline, 0 general)