Files @ defcf245f3e9
Branch filter:

Location: kallithea/rhodecode/templates/journal/journal.html - annotation

Marcin Kuzminski
fixes #229 repo sorting is not working.
- implemented repo sorting using YUI dataTable
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
753aeb4a5c58
753aeb4a5c58
a3ee2611e6e8
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
d14723711d17
d14723711d17
d14723711d17
d14723711d17
d14723711d17
fcbc35ecb024
fcbc35ecb024
184557472f5c
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
184557472f5c
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
753aeb4a5c58
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
184557472f5c
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
753aeb4a5c58
753aeb4a5c58
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
60a00fd76d58
fcbc35ecb024
fcbc35ecb024
753aeb4a5c58
d14723711d17
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
753aeb4a5c58
fcbc35ecb024
753aeb4a5c58
fcbc35ecb024
753aeb4a5c58
753aeb4a5c58
fcbc35ecb024
753aeb4a5c58
753aeb4a5c58
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
fcbc35ecb024
753aeb4a5c58
a3ee2611e6e8
753aeb4a5c58
753aeb4a5c58
fcbc35ecb024
d14723711d17
## -*- 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')}
</%def>
<%def name="main()">
	
    <div class="box box-left">
	    <!-- box / title -->
	    <div class="title">
	        <h5>${_('Journal')}</h5>
             <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>          
             </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...')}"/>        
            <a id="show_my" class="link-white" href="#my">${_('My repos')}</a> / <a id="show_watched" class="link-white" href="#watched">${_('Watched')}</a>
            </h5>
             %if h.HasPermissionAny('hg.admin','hg.create.repository')():
             <ul class="links">
               <li>
                 <span>${h.link_to(_('ADD'),h.url('admin_settings_create_repository'))}</span>
               </li>          
             </ul>           
             %endif        
        </div>
        <!-- end box / title -->
        <div id="my" class="table">
            %if c.user_repos:
            <table>
            <thead>
                <tr>
                <th class="left">${_('Name')}</th>
                <th class="left">${_('revision')}</th>
                <th colspan="2" class="left">${_('action')}</th>            
            </thead>
             <tbody>
                 %for repo in c.user_repos:
                    <tr>
                        <td>
                         %if repo['dbrepo']['repo_type'] =='hg':
                           <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
                         %elif repo['dbrepo']['repo_type'] =='git':
                           <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
                         %else:
                           
                         %endif                     
                         %if repo['dbrepo']['private']:
                            <img class="icon" alt="${_('private')}" src="${h.url('/images/icons/lock.png')}"/>
                         %else:
                            <img class="icon" alt="${_('public')}" src="${h.url('/images/icons/lock_open.png')}"/>
                         %endif
                                                         
                        ${h.link_to(repo['name'], h.url('summary_home',repo_name=repo['name']),class_="repo_name")}
                        %if repo['dbrepo_fork']:
                            <a href="${h.url('summary_home',repo_name=repo['dbrepo_fork']['repo_name'])}">
                            <img class="icon" alt="${_('public')}"
                            title="${_('Fork of')} ${repo['dbrepo_fork']['repo_name']}" 
                            src="${h.url('/images/icons/arrow_divide.png')}"/></a>
                        %endif                  
                        </td> 
                        <td><div class="tooltip" title="${repo['last_change']}"><pre>${("r%s:%s") % (repo['rev'],h.short_id(repo['tip']))}</pre></div></td>
                        <td><a href="${h.url('repo_settings_home',repo_name=repo['name'])}" title="${_('edit')}"><img class="icon" alt="${_('private')}" src="${h.url('/images/icons/application_form_edit.png')}"/></a></td>
                        <td>
                          ${h.form(url('repo_settings_delete', repo_name=repo['name']),method='delete')}
                            ${h.submit('remove_%s' % repo['name'],'',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
                          ${h.end_form()}               
                        </td>
                    </tr>
                 %endfor
             </tbody>
             </table>
             %else:
                <div style="padding:5px 0px 10px 0px;">
                ${_('No repositories yet')} 
                %if h.HasPermissionAny('hg.admin','hg.create.repository')():
                    ${h.link_to(_('create one now'),h.url('admin_settings_create_repository'),class_="ui-btn")}
                %endif
                </div>
             %endif             
        </div>
    
        <div id="watched" class="table" style="display:none">
          %if c.following:
            <table>
            <thead>
                <tr>
                <th class="left">${_('Name')}</th>
            </thead>
             <tbody>
                %for entry in c.following:
                  <tr>
                    <td>
                      %if entry.follows_user_id:
                        <img title="${_('following user')}" alt="${_('user')}" src="${h.url('/images/icons/user.png')}"/>
                        ${entry.follows_user.full_contact}
                      %endif
                      
                      %if entry.follows_repo_id:
                        <div style="float:right;padding-right:5px">
                        <span id="follow_toggle_${entry.follows_repository.repo_id}" class="following" title="${_('Stop following this repository')}"
                              onclick="javascript:toggleFollowingRepo(this,${entry.follows_repository.repo_id},'${str(h.get_token())}')">
                        </span>                   
                        </div>
                        
                         %if entry.follows_repository.repo_type == 'hg':
                           <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
                         %elif entry.follows_repository.repo_type == 'git':
                           <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
                         %endif                        
                        
                        %if entry.follows_repository.private:
                          <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="${h.url('/images/icons/lock.png')}"/>
                        %else:
                          <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
                        %endif
                        <span class="watched_repo">
                            ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home',repo_name=entry.follows_repository.repo_name))}
                        </span>
                      %endif
                    </td>
                  </tr>
                %endfor
            </tbody>
            </table>
          %else:
              <div style="padding:5px 0px 10px 0px;">
              ${_('You are not following any users or repositories')}
              </div>
          %endif                  
        </div> 
    </div>
    
    <script type="text/javascript">
    YUE.on('show_my','click',function(e){
        YUD.setStyle('watched','display','none');
        YUD.setStyle('my','display','');
        var nodes = YUQ('#my tr td a.repo_name');
        var target = 'q_filter';
        var func = function(node){
            return node.parentNode.parentNode;
        }
        q_filter(target,nodes,func);        
        YUE.preventDefault(e);
    })
    YUE.on('show_watched','click',function(e){
        YUD.setStyle('my','display','none');
        YUD.setStyle('watched','display','');
        var nodes = YUQ('#watched .watched_repo a');
        var target = 'q_filter';
        var func = function(node){
            return node.parentNode.parentNode;
        }
        q_filter(target,nodes,func);        
        YUE.preventDefault(e);        
    })
    YUE.on('refresh','click',function(e){
        ypjax(e.currentTarget.href,"journal",function(){show_more_event();tooltip_activate();});
        YUE.preventDefault(e);
    })
    </script>    
</%def>