Changeset - 1ac47c961f70
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 13 years ago 2013-01-23 22:03:39
marcin@python-works.com
Set current pages indication for search and journal
4 files changed with 8 insertions and 7 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/base/base.html
Show inline comments
 
@@ -99,97 +99,98 @@
 
                        </div>
 
                        <div class="input">
 
                            ${h.password('password',class_='focus',size=40)}
 
                        </div>
 

	
 
                    </div>
 
                    <div class="buttons">
 
                        <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div>
 
                        <div class="register">
 
                        %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
 
                         ${h.link_to(_("Don't have an account ?"),h.url('register'))}
 
                        %endif
 
                        </div>
 
                        <div class="submit">
 
                            ${h.submit('sign_in',_('Log In'),class_="ui-btn xsmall")}
 
                        </div>
 
                    </div>
 
                </div>
 
            </div>
 
            ${h.end_form()}
 
        %else:
 
            <div class="links_left">
 
                <div class="full_name">${c.rhodecode_user.full_name_or_username}</div>
 
                <div class="email">${c.rhodecode_user.email}</div>
 
                <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,48)}" /></div>
 
                <div class="inbox"><a href="${h.url('notifications')}">${_('Inbox')}: ${c.unread_notifications}</a></div>
 
            </div>
 
            <div class="links_right">
 
            <ol class="links">
 
              <li>${h.link_to(_(u'Home'),h.url('home'))}</li>
 
              <li>${h.link_to(_(u'Journal'),h.url('journal'))}</li>
 
              <li>${h.link_to(_(u'My account'),h.url('admin_settings_my_account'))}</li>
 
              <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
 
            </ol>
 
            </div>
 
        %endif
 
      </div>
 
  </div>
 

	
 
    </li>
 
</%def>
 

	
 
<%def name="menu(current=None)">
 
        <%
 
        def is_current(selected):
 
            if selected == current:
 
                return h.literal('class="current"')
 
        %>
 
        %if current not in ['home','admin']:
 
        ## 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>
 
                    <a class="menu_link" id="repo_switcher" title="${_('Switch repository')}" href="#">
 
                    <span class="icon">
 
                        <img src="${h.url('/images/icons/database.png')}" alt="${_('Products')}" />
 
                    </span>
 
                    <span>${_('Repositories')}</span>
 
                    </a>
 
                    <ul id="repo_switcher_list" class="repo_switcher">
 
                        <li>
 
                            <a href="#">${_('loading...')}</a>
 
                        </li>
 
                    </ul>
 
                </li>
 

	
 
                <li ${is_current('summary')}>
 
                   <a class="menu_link" title="${_('Summary')}" href="${h.url('summary_home',repo_name=c.repo_name)}">
 
                   <span class="icon">
 
                       <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
 
                   </span>
 
                   <span>${_('Summary')}</span>
 
                   </a>
 
                </li>
 
                <li ${is_current('changelog')}>
 
                   <a class="menu_link" title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}">
 
                   <span class="icon">
 
                       <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
 
                   </span>
 
                   <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">
 
                       <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" />
 
                   </span>
 
                   <span>${_('Switch to')}</span>
 
                   </a>
 
                    <ul id="switch_to_list" class="switch_to">
 
                        <li><a href="#">${_('loading...')}</a></li>
 
                    </ul>
 
                </li>
 
                <li ${is_current('files')}>
 
                   <a class="menu_link" title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
 
                   <span class="icon">
 
@@ -281,90 +282,90 @@
 
                </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){
 
                     YUD.addClass('branch_tag_switcher','loaded');
 
                     ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list',
 
                         function(o){},
 
                         function(o){YUD.removeClass('branch_tag_switcher','loaded');}
 
                         ,null);
 
                 }
 
                 return false;
 
              });
 
            </script>
 
        %else:
 
            ##ROOT MENU
 
            <ul id="quick">
 
                <li ${is_current('home')}>
 
                    <a class="menu_link" title="${_('Home')}"  href="${h.url('home')}">
 
                    <span class="icon">
 
                        <img src="${h.url('/images/icons/home_16.png')}" alt="${_('Home')}" />
 
                    </span>
 
                    <span>${_('Home')}</span>
 
                    </a>
 
                </li>
 
                %if c.rhodecode_user.username != 'default':
 
                 <li>
 
                 <li ${is_current('journal')}>
 
                    <a class="menu_link" title="${_('Journal')}"  href="${h.url('journal')}">
 
                    <span class="icon">
 
                        <img src="${h.url('/images/icons/book.png')}" alt="${_('Journal')}" />
 
                    </span>
 
                    <span>${_('Journal')}</span>
 
                    </a>
 
                 </li>
 
                %else:
 
                 <li>
 
                 <li ${is_current('journal')}>
 
                    <a class="menu_link" title="${_('Public journal')}"  href="${h.url('public_journal')}">
 
                    <span class="icon">
 
                        <img src="${h.url('/images/icons/book.png')}" alt="${_('Public journal')}" />
 
                    </span>
 
                    <span>${_('Public journal')}</span>
 
                    </a>
 
                 </li>
 
                %endif
 
                <li>
 
                <li ${is_current('search')}>
 
                    <a class="menu_link" title="${_('Search')}"  href="${h.url('search')}">
 
                    <span class="icon">
 
                        <img src="${h.url('/images/icons/search_16.png')}" alt="${_('Search')}" />
 
                    </span>
 
                    <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')}">
 
                   <span class="icon">
 
                       <img src="${h.url('/images/icons/cog_edit.png')}" alt="${_('Admin')}" />
 
                   </span>
 
                   <span>${_('Admin')}</span>
 
                   </a>
 
                    ${admin_menu()}
 
                </li>
 
                %endif
 
                ${usermenu()}
 
            </ul>
 
        %endif
 
</%def>
rhodecode/templates/journal/journal.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('Journal')} - ${c.rhodecode_name}
 
</%def>
 
<%def name="breadcrumbs()">
 
    <h5>
 
    <form id="filter_form">
 
    <input class="q_filter_box ${'' if c.search_term else 'initial'}" id="j_filter" size="15" type="text" name="filter" value="${c.search_term or _('quick filter...')}"/>
 
    <span class="tooltip" title="${h.tooltip(h.journal_filter_help())}">?</span>
 
    <input type='submit' value="${_('filter')}" class="ui-btn" style="padding:0px 2px 0px 2px;margin:0px"/>
 
    ${_('journal')} - ${ungettext('%s entry', '%s entries', c.journal_pager.item_count) % (c.journal_pager.item_count)}
 
    </form>
 
    ${h.end_form()}
 
    </h5>
 
</%def>
 
<%def name="page_nav()">
 
    ${self.menu('home')}
 
    ${self.menu('journal')}
 
</%def>
 
<%def name="head_extra()">
 
<link href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('ATOM journal feed')}" type="application/atom+xml" />
 
<link href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}" rel="alternate" title="${_('RSS journal feed')}" type="application/rss+xml" />
 
</%def>
 
<%def name="main()">
 

	
 
    <div class="box box-left">
 
        <!-- box / title -->
 
        <div class="title">
 
         ${self.breadcrumbs()}
 
         <ul class="links">
 
           <li>
 
             <span><a id="refresh" href="${h.url('journal')}"><img class="icon" title="${_('Refresh')}" alt="${_('Refresh')}" src="${h.url('/images/icons/arrow_refresh.png')}"/></a></span>
 
           </li>
 
           <li>
 
             <span><a href="${h.url('journal_rss', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('RSS feed')}" alt="${_('RSS feed')}" src="${h.url('/images/icons/rss_16.png')}"/></a></span>
 
           </li>
 
           <li>
 
             <span><a href="${h.url('journal_atom', api_key=c.rhodecode_user.api_key)}"><img class="icon" title="${_('ATOM feed')}" alt="${_('ATOM feed')}" src="${h.url('/images/icons/atom.png')}"/></a></span>
 
           </li>
 
         </ul>
 
        </div>
 
        <div id="journal">${c.journal_data}</div>
 
    </div>
 
    <div class="box box-right">
 
        <!-- box / title -->
 

	
 
        <div class="title">
 
            <h5>
 
            <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/>
 
            <input class="q_filter_box" id="q_filter_watched" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/>
 
            </h5>
 
             <ul class="links" style="color:#DADADA">
 
               <li>
 
                 <span><a id="show_watched" class="link-white current" href="#watched">${_('Watched')}</a> </span>
 
               </li>
 
               <li>
 
                 <span><a id="show_my" class="link-white" href="#my">${_('My repos')}</a> </span>
 
               </li>
 
               %if h.HasPermissionAny('hg.admin','hg.create.repository')():
 
                 <li>
 
                   <span>${h.link_to(_('Add repo'),h.url('admin_settings_create_repository'))}</span>
 
                 </li>
 
               %endif
 
             </ul>
 
        </div>
 

	
rhodecode/templates/journal/public_journal.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('Journal')} - ${c.rhodecode_name}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${c.rhodecode_name}
 
</%def>
 
<%def name="page_nav()">
 
    ${self.menu('home')}
 
    ${self.menu('journal')}
 
</%def>
 
<%def name="head_extra()">
 
<link href="${h.url('public_journal_atom')}" rel="alternate" title="${_('ATOM public journal feed')}" type="application/atom+xml" />
 
<link href="${h.url('public_journal_rss')}" rel="alternate" title="${_('RSS public journal feed')}" type="application/rss+xml" />
 
</%def>
 
<%def name="main()">
 

	
 
<div class="box">
 
  <!-- box / title -->
 
  <div class="title">
 
    <h5>${_('Public Journal')}</h5>
 
      <ul class="links">
 
      <li>
 
       <span><a href="${h.url('public_journal_rss')}"><img class="icon" title="${_('RSS feed')}" alt="${_('RSS feed')}" src="${h.url('/images/icons/atom.png')}"/></a></span>
 
     </li>
 
     <li>
 
       <span><a href="${h.url('public_journal_atom')}"><img class="icon" title="${_('ATOM feed')}" alt="${_('ATOM feed')}" src="${h.url('/images/icons/rss_16.png')}"/></a></span>
 
     </li>
 
     </ul>
 
  </div>
 

	
 
  <div id="journal">${c.journal_data}</div>
 
</div>
 

	
 
</%def>
rhodecode/templates/search/search.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
   %if c.cur_query:
 
    %if c.repo_name:
 
        ${_('Search "%s" in repository: %s') % (c.cur_query, c.repo_name)}
 
    %else:
 
        ${_('Search "%s" in all repositories') % c.cur_query}
 
    %endif
 
   %else:
 
    %if c.repo_name:
 
        ${_('Search in repository: %s') % c.repo_name}
 
    %else:
 
        ${_('Search in all repositories')}
 
    %endif
 
   %endif
 
    - ${c.rhodecode_name}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${c.rhodecode_name}
 
</%def>
 
<%def name="page_nav()">
 
    ${self.menu('home')}
 
    ${self.menu('search')}
 
</%def>
 
<%def name="main()">
 

	
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        <h5>
 
        %if c.repo_name:
 
            ${_('Search in repository: %s') % c.repo_name}
 
        %else:
 
            ${_('Search in all repositories')}
 
        %endif
 
        </h5>
 
    </div>
 
    <!-- end box / title -->
 
    %if c.repo_name:
 
        ${h.form(h.url('search_repo',search_repo=c.repo_name),method='get')}
 
    %else:
 
        ${h.form(h.url('search'),method='get')}
 
    %endif
 
    <div class="form">
 
        <div class="fields">
 
            <div class="field field-first field-noborder">
 
             <div class="label">
 
                 <label for="q">${_('Search term')}</label>
 
             </div>
 
                <div class="input">${h.text('q',c.cur_query,class_="small")}
 
                    <div class="button highlight">
 
                        <input type="submit" value="${_('Search')}" class="ui-button"/>
 
                    </div>
 
                </div>
 
                <div style="font-weight: bold;clear:Both;margin-left:200px">${c.runtime}</div>
 
            </div>
 

	
 
            <div class="field">
 
                <div class="label">
 
                    <label for="type">${_('Search in')}</label>
 
                </div>
 
                <div class="select">
 
                    ${h.select('type',c.cur_type,[('content',_('File contents')),
 
                        ('commit',_('Commit messages')),
 
                        ('path',_('File names')),
 
                        ##('repository',_('Repository names')),
 
                        ])}
 
                </div>
 
             </div>
 

	
 
        </div>
0 comments (0 inline, 0 general)