Changeset - 237470e64bb8
[Not reviewed]
default
1 13 2
Marcin Kuzminski - 15 years ago 2010-06-13 23:56:16
marcin@python-works.com
switched filters into webhelpers for easy of usage.
Rewrite of html to use predefined templates from branches shortlog tags, for DRY usage.
Added info messages about empty branches/tags etc.
16 files changed with 119 insertions and 225 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/changelog.py
Show inline comments
 
@@ -40,30 +40,31 @@ class ChangelogController(BaseController
 
        limit = 100
 
        default = 20
 
        if request.params.get('size'):
 
            try:
 
                int_size = int(request.params.get('size'))
 
            except ValueError:
 
                int_size = default
 
            int_size = int_size if int_size <= limit else limit 
 
            c.size = int_size
 
            session['changelog_size'] = c.size
 
            session.save()
 
        else:
 
            c.size = session.get('changelog_size', default)
 
            c.size = int(session.get('changelog_size', default))
 

	
 
        changesets = HgModel().get_repo(c.repo_name)
 
            
 
        p = int(request.params.get('page', 1))
 
        c.pagination = Page(changesets, page=p, item_count=len(changesets),
 
        c.total_cs = len(changesets)
 
        c.pagination = Page(changesets, page=p, item_count=c.total_cs,
 
                            items_per_page=c.size)
 
            
 
        #self._graph(c.repo, c.size,p)
 
        
 
        return render('changelog/changelog.html')
 

	
 

	
 
    def _graph(self, repo, size, p):
 
        pass
 
#        revcount = size
 
#        if not repo.revisions:return dumps([]), 0
 
#        
pylons_app/controllers/graph.py
Show inline comments
 
@@ -16,27 +16,27 @@
 
# You should have received a copy of the GNU General Public License
 
# along with this program; if not, write to the Free Software
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
# MA  02110-1301, USA.
 
"""
 
Created on April 21, 2010
 
graph controller for pylons
 
@author: marcink
 
"""
 
from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
 
from mercurial.node import short
 
from pylons import request, tmpl_context as c
 
import pylons_app.lib.helpers as h
 
from pylons_app.lib.auth import LoginRequired
 
from pylons_app.lib.base import BaseController, render
 
from pylons_app.lib.filters import age as _age, person
 
from pylons_app.model.hg_model import HgModel
 
from simplejson import dumps
 
from webhelpers.paginate import Page
 
import logging
 

	
 
log = logging.getLogger(__name__)
 

	
 
class GraphController(BaseController):
 
    
 
    @LoginRequired()
 
    def __before__(self):
 
        super(GraphController, self).__before__()
 
@@ -65,20 +65,20 @@ class GraphController(BaseController):
 
        bg_height = 39
 
        
 
        revcount = min(max_rev, revcount)
 
        rev_end = max(0, rev_start - revcount)
 
        dag = graph_rev(repo.repo, rev_start, rev_end)
 
        tree = list(colored(dag))
 
        canvasheight = (len(tree) + 1) * bg_height - 27
 
        data = []
 
        for (id, type, ctx, vtx, edges) in tree:
 
            if type != CHANGESET:
 
                continue
 
            node = short(ctx.node())
 
            age = _age(ctx.date())
 
            age = h.age(ctx.date())
 
            desc = ctx.description()
 
            user = person(ctx.user())
 
            user = h.person(ctx.user())
 
            branch = ctx.branch()
 
            branch = branch, repo.repo.branchtags().get(branch) == ctx.node()
 
            data.append((node, vtx, edges, desc, user, age, branch, ctx.tags()))
 
    
 
        return dumps(data), canvasheight
pylons_app/controllers/summary.py
Show inline comments
 
@@ -16,39 +16,40 @@
 
# You should have received a copy of the GNU General Public License
 
# along with this program; if not, write to the Free Software
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
# MA  02110-1301, USA.
 
"""
 
Created on April 18, 2010
 
summary controller for pylons
 
@author: marcink
 
"""
 
from pylons import tmpl_context as c, request
 
from pylons_app.lib.auth import LoginRequired
 
from pylons_app.lib.base import BaseController, render
 
from pylons_app.model.hg_model import HgModel, _full_changelog_cached
 
from pylons_app.model.hg_model import HgModel
 
from webhelpers.paginate import Page
 
import logging
 

	
 
log = logging.getLogger(__name__)
 

	
 
class SummaryController(BaseController):
 
    
 
    @LoginRequired()
 
    def __before__(self):
 
        super(SummaryController, self).__before__()
 
        
 
    def index(self):
 
        hg_model = HgModel()
 
        c.repo_info = hg_model.get_repo(c.repo_name)
 
        c.repo_changesets = _full_changelog_cached(c.repo_name)[:10]
 
        c.repo_changesets = Page(list(c.repo_info[:10]), page=1, items_per_page=20)
 
        e = request.environ
 
        uri = u'%(protocol)s://%(user)s@%(host)s/%(repo_name)s' % {
 
                                        'protocol': e.get('wsgi.url_scheme'),
 
                                        'user':str(c.hg_app_user.username),
 
                                        'host':e.get('HTTP_HOST'),
 
                                        'repo_name':c.repo_name, }
 
        c.clone_repo_url = uri
 
        c.repo_tags = {}
 
        for name, hash in c.repo_info.tags.items()[:10]:
 
            c.repo_tags[name] = c.repo_info.get_changeset(hash)
 
        
 
        c.repo_branches = {}
pylons_app/lib/filters.py
Show inline comments
 
deleted file
pylons_app/lib/helpers.py
Show inline comments
 
@@ -194,12 +194,38 @@ def pygmentize_annotation(filenode, **kw
 
      
 
def repo_name_slug(value):
 
    """
 
    Return slug of name of repository
 
    """
 
    slug = urlify(value)
 
    for c in """=[]\;'"<>,/~!@#$%^&*()+{}|:""":
 
        slug = slug.replace(c, '-')
 
    slug = recursive_replace(slug, '-')
 
    return slug
 

	
 
flash = _Flash()
 

	
 

	
 
#===============================================================================
 
# MERCURIAL FILTERS available via h.
 
#===============================================================================
 

	
 

	
 
from mercurial import util
 
from mercurial.templatefilters import age as _age, person as _person
 

	
 
age = lambda  x:_age(x)
 
capitalize = lambda x: x.capitalize()
 
date = lambda x: util.datestr(x)
 
email = util.email
 
person = lambda x: _person(x)
 
hgdate = lambda  x: "%d %d" % x
 
isodate = lambda  x: util.datestr(x, '%Y-%m-%d %H:%M %1%2')
 
isodatesec = lambda  x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2')
 
localdate = lambda  x: (x[0], util.makedate()[1])
 
rfc822date = lambda  x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2")
 
rfc3339date = lambda  x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2")
 
time_ago = lambda x: util.datestr(_age(x), "%a, %d %b %Y %H:%M:%S %1%2")
 

	
 

	
 

	
 

	
pylons_app/templates/branches/branches.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%! from pylons_app.lib import filters %>
 
<%def name="title()">
 
    ${_('Branches')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    /
 
    ${_('branches')}
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('branches')}    
 
</%def>
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Branches')}</h2>
 

	
 
    <table class="table_disp">
 
    	<tr class="header">
 
			<td>${_('date')}</td>
 
			<td>${_('revision')}</td>
 
			<td>${_('name')}</td>
 
			<td>${_('links')}</td>
 
    	</tr>
 
		%for cnt,branch in enumerate(c.repo_branches.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${branch[1]._ctx.date()|n,filters.age}</td>
 
			<td>r${branch[1].revision}:${branch[1].raw_id}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${h.link_to(branch[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
 
				</span>			
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 

	
 
	<%include file='branches_data.html'/>
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/branches/branches_data.html
Show inline comments
 
new file 100644
 
% if c.repo_branches:
 
    <table class="table_disp">
 
    	<tr class="header">
 
			<td>${_('date')}</td>
 
			<td>${_('revision')}</td>
 
			<td>${_('name')}</td>
 
			<td>${_('links')}</td>
 
    	</tr>
 
		%for cnt,branch in enumerate(c.repo_branches.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${h.age(branch[1]._ctx.date())}</td>
 
			<td>r${branch[1].revision}:${branch[1].raw_id}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${h.link_to(branch[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
 
				</span>			
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 
%else:
 
	${_('There are no branches yet')}
 
%endif
 

	
pylons_app/templates/changelog/changelog.html
Show inline comments
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Changelog - %s') % c.repo_name}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))}
 
    /
 
    ${_('changelog')}
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('changelog')}     
 
</%def>
 

	
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Changelog')} - ${_('showing last ')} ${c.size} ${_('revisions')}</h2>
 
    <h2 class="no-link no-border">${_('Changelog')} - ${_('showing ')} 
 
    	${c.size if c.size <= c.total_cs else c.total_cs}
 
    	${_('out of')} ${c.total_cs} ${_('revisions')}
 
    </h2>
 
	<noscript>${_('The revision graph only works with JavaScript-enabled browsers.')}</noscript>
 
% if c.pagination:
 

	
 
<div id="graph">
 
	##<div id="graph_nodes" style="height:1000px">
 
	##	<canvas id="graph" width="160"></canvas>
 
	##</div>
 
	<div id="graph_content">
 
		<div class="container_header">
 
			${h.form(h.url.current(),method='get')}
 
				${_('Show')}: ${h.text('size',size=2,value=c.size)} ${_('revisions')}
 
				${h.submit('','set')}
 
			${h.end_form()}
 
		</div>
 
@@ -80,13 +81,16 @@ from pylons_app.lib import filters
 
##<!-- hide script content
 
##
 
##var jsdata = ${c.jsdata|n};
 
##var r = new BranchRenderer();
 
##r.render(jsdata); 
 

	
 
##// stop hiding script -->
 
##</script>
 

	
 
<div>
 
	<h2>${c.pagination.pager('$link_previous ~2~ $link_next')}</h2>
 
</div>	
 
%else:
 
	${_('There are no changes yet')}
 
%endif
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/changeset/changeset.html
Show inline comments
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Changeset')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('changeset_home',repo_name=c.repo_name))}
 
    /
 
    ${_('changeset')}
 
</%def>
pylons_app/templates/errors/error_404.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%inherit file="./../base/base.html"/>
 
            
 
<%def name="title()">
 
    ${_('Repository not found')}
 
</%def>
 

	
 
<%def name="breadcrumbs()">
 
	${h.link_to(u'Home',h.url('hg_home'))}
 
	 / 
 
	${h.link_to(u'Admin',h.url('admin_home'))}
 
</%def>
 

	
pylons_app/templates/index.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%inherit file="base/base.html"/>
 
<%def name="title()">
 
    ${c.repos_prefix} Mercurial Repositories
 
</%def>
 
<%def name="breadcrumbs()">
 
	${c.repos_prefix} Mercurial Repositories
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('home')}
 
</%def>
 
<%def name="main()">
 
	<%def name="get_sort(name)">
 
@@ -29,28 +26,28 @@ from pylons_app.lib import filters
 
	    <td>${get_sort(_('Description'))}</td>
 
	    <td>${get_sort(_('Last change'))}</td>
 
	    <td>${get_sort(_('Tip'))}</td>
 
	    <td>${get_sort(_('Contact'))}</td>
 
	    <td>${_('RSS')}</td>
 
	    <td>${_('Atom')}</td>
 
	  </tr>	
 
	%for cnt,repo in enumerate(c.repos_list):
 
 		<tr class="parity${cnt%2}">
 
		    <td>${h.link_to(repo['name'],
 
		    	h.url('summary_home',repo_name=repo['name']))}</td>
 
		    <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
 
	        <td>${repo['last_change']|n,filters.age}</td>
 
	        <td>${h.age(repo['last_change'])}</td>
 
	        <td>${h.link_to('r%s:%s' % (repo['rev'],repo['tip']),
 
		        h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
 
	        	class_="tooltip",
 
		    	tooltip_title=h.tooltip(repo['last_msg']))}</td>
 
	        <td title="${repo['contact']}">${repo['contact']|n,filters.person}</td>
 
	        <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
 
			<td>
 
				<a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_logo"  href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
 
			</td>        
 
			<td>
 
				<a title="${_('Subscribe to %s atom feed')%repo['name']}"  class="atom_logo" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
 
			</td>
 
		</tr>
 
	%endfor
 
	</table>
 
</%def>    
pylons_app/templates/login.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%inherit file="base/base.html"/>
 
<%def name="title()">
 
    ${c.repos_prefix} Mercurial Repositories
 
</%def>
 
<%def name="breadcrumbs()">
 
	${c.repos_prefix} Mercurial Repositories
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('home')}
 
</%def>
 
<%def name="main()">
 
        <div>
pylons_app/templates/shortlog/shortlog_data.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%!
 
from pylons_app.lib import filters
 
%>
 
% if c.repo_changesets:
 

	
 
<table class="table_disp">
 
	<tr class="header">
 
		<td>${_('date')}</td>
 
		<td>${_('author')}</td>
 
		<td>${_('revision')}</td>
 
		<td>${_('commit message')}</td>
 
		<td>${_('branch')}</td>
 
		<td>${_('tags')}</td>
 
		<td>${_('links')}</td>
 
		
 
	</tr>
 
%for cnt,cs in enumerate(c.repo_changesets):
 
	<tr class="parity${cnt%2}">
 
		<td>${cs._ctx.date()|n,filters.age}</td>
 
		<td title="${cs.author}">${cs.author|n,filters.person}</td>
 
		<td>${h.age(cs._ctx.date())}</td>
 
		<td title="${cs.author}">${h.person(cs.author)}</td>
 
		<td>r${cs.revision}:${cs.raw_id}</td>
 
		<td>
 
			${h.link_to(h.truncate(cs.message,60),
 
			h.url('changeset_home',repo_name=c.repo_name,revision=cs._short),
 
			title=cs.message)}
 
		</td>
 
		<td>
 
			<span class="logtags">
 
				<span class="branchtag">${cs.branch}</span>
 
			</span>
 
		</td>
 
		<td>
 
@@ -50,13 +49,16 @@ from pylons_app.lib import filters
 
		YAHOO.util.Event.onDOMReady(function(){
 
			YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
 
					YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});});
 
		</script>	
 
		<h2>
 
		${c.repo_changesets.pager('$link_previous ~2~ $link_next',
 
		onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{
 
		success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText;
 
		YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
 
				YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');});		
 
		YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")}
 
		</h2>
 
	</div>	
 
\ No newline at end of file
 
	</div>	
 
%else:
 
	${_('There are no commits yet')}
 
%endif
 
\ No newline at end of file
pylons_app/templates/summary/summary.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%def name="title()">
 
    ${_('Repository managment')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    /
 
    ${_('summary')}
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('summary')}    
 
@@ -32,131 +29,43 @@ E.onDOMReady(function(e){
 
</%def>
 

	
 
<%def name="main()">
 
    <h2 class="no-link no-border">${_('Mercurial Repository Overview')}</h2>
 
    <dl class="overview">
 
        <dt>${_('name')}</dt>
 
        <dd>${c.repo_info.name}</dd>
 
        <dt>${_('description')}</dt>
 
        <dd>${c.repo_info.description}</dd>
 
        <dt>${_('contact')}</dt>
 
        <dd>${c.repo_info.contact}</dd>
 
        <dt>${_('last change')}</dt>
 
        <dd>${c.repo_info.last_change|n,filters.age} - ${c.repo_info.last_change|n,filters.rfc822date}</dd>
 
        <dd>${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}</dd>
 
        <dt>${_('clone url')}</dt>
 
        <dd><input type="text" id="clone_url"  readonly="readonly" value="hg clone ${c.clone_repo_url}" size="70"/></dd>
 
        <dt>${_('download')}</dt>
 
        <dd>
 
       	%for cnt,archive in enumerate(c.repo_info._get_archives()):
 
       		 %if cnt >=1:
 
       		 |
 
       		 %endif
 
       		 ${h.link_to(c.repo_info.name+'.'+archive['type'],
 
       			h.url('files_archive_home',repo_name=c.repo_info.name,
 
       			revision='tip',fileformat=archive['extension']),class_="archive_logo")}
 
		%endfor
 
        </dd>
 
        <dt>${_('feeds')}</dt>
 
        <dd>
 
        	${h.link_to(_('RSS'),h.url('rss_feed_home',repo_name=c.repo_info.name),class_='rss_logo')}
 
			${h.link_to(_('Atom'),h.url('atom_feed_home',repo_name=c.repo_info.name),class_='atom_logo')}
 
        </dd>
 
    </dl>
 

	
 
    <h2>${h.link_to(_('Last ten changes'),h.url('changelog_home',repo_name=c.repo_name))}</h2>
 
<table class="table_disp">
 
	<tr class="header">
 
		<td>${_('date')}</td>
 
		<td>${_('author')}</td>
 
		<td>${_('revision')}</td>
 
		<td>${_('commit message')}</td>
 
		<td>${_('branch')}</td>
 
		<td>${_('tags')}</td>
 
		<td>${_('links')}</td>
 
		
 
	</tr>
 
	%for cnt,cs in enumerate(c.repo_changesets):
 
		<tr class="parity${cnt%2}">
 
			<td>${cs._ctx.date()|n,filters.age}</td>
 
			<td>${cs.author|n,filters.person}</td>
 
			<td>r${cs.revision}:${cs.raw_id}</td>
 
			<td>
 
				${h.link_to(h.truncate(cs.message,60),
 
				h.url('changeset_home',repo_name=c.repo_name,revision=cs._short),
 
				title=cs.message)}
 
			</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${cs.branch}</span>
 
				</span>
 
			</td>
 
			<td>
 
				<span class="logtags">
 
					%for tag in cs.tags:
 
						<span class="tagtag">${tag}</span>
 
					%endfor
 
				</span>
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs._short))}
 
			</td>
 
		</tr>
 
	%endfor
 
    </table>
 
	<%include file='../shortlog/shortlog_data.html'/>
 

	
 
    <h2>${h.link_to(_('Last ten tags'),h.url('tags_home',repo_name=c.repo_name))}</h2>
 
    <table class="table_disp">
 
    	<tr class="header">
 
			<td>${_('date')}</td>
 
			<td>${_('revision')}</td>
 
			<td>${_('name')}</td>
 
			<td>${_('links')}</td>
 
    	</tr>
 
		%for cnt,tag in enumerate(c.repo_tags.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${tag[1]._ctx.date()|n,filters.age}</td>
 
			<td>r${tag[1].revision}:${tag[1].raw_id}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
 
				</span>
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 

	
 
	<%include file='../tags/tags_data.html'/>
 
    
 
    <h2>${h.link_to(_('Last ten branches'),h.url('branches_home',repo_name=c.repo_name))}</h2>
 
    <table class="table_disp">
 
    	<tr class="header">
 
			<td>${_('date')}</td>
 
			<td>${_('revision')}</td>
 
			<td>${_('name')}</td>
 
			<td>${_('links')}</td>
 
    	</tr>
 
		%for cnt,branch in enumerate(c.repo_branches.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${branch[1]._ctx.date()|n,filters.age}</td>
 
			<td>r${branch[1].revision}:${branch[1].raw_id}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${h.link_to(branch[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
 
				</span>			
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 
	<%include file='../branches/branches_data.html'/>
 

	
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/tags/tags.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%def name="title()">
 
    ${_('Tags')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    /
 
    ${_('tags')}
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('tags')}    
 
</%def>
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Tags')}</h2>
 
    <table class="table_disp">
 
    	<tr class="header">
 
			<td>${_('date')}</td>
 
			<td>${_('revision')}</td>
 
			<td>${_('name')}</td>
 
			<td>${_('links')}</td>
 
    	</tr>
 
		%for cnt,tag in enumerate(c.repo_tags.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${tag[1]._ctx.date()|n,filters.age}</td>
 
			<td>r${tag[1].revision}:${tag[1].raw_id}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
 
				</span>
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 
	<%include file='tags_data.html'/>
 

	
 
</%def>    
 
\ No newline at end of file
pylons_app/templates/tags/tags_data.html
Show inline comments
 
new file 100644
 
%if c.repo_tags:    
 
    <table class="table_disp">
 
    	<tr class="header">
 
			<td>${_('date')}</td>
 
			<td>${_('revision')}</td>
 
			<td>${_('name')}</td>
 
			<td>${_('links')}</td>
 
    	</tr>
 
		%for cnt,tag in enumerate(c.repo_tags.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${h.age(tag[1]._ctx.date())}</td>
 
			<td>r${tag[1].revision}:${tag[1].raw_id}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
 
				</span>
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 
%else:
 
	${_('There are no tags yet')}
 
%endif    
 
\ No newline at end of file
0 comments (0 inline, 0 general)