## This file is subject to the terms and conditions defined in ## file 'LICENSE', which is part of this source code package. ## Copyright (c) 2009 SKR Farms (P) LTD. <%inherit file="/base/basic1.html"/> <%namespace name="elements" file="/component/elements.html"/> <%namespace name="forms" file="/component/forms.html"/> <%! page_tooltips = [ [ 'Help', """ Files in repository are viewable with syntax highlighting, annotation and changesets. """ ], [ 'Repository-list', """Integrate one or more repositories with projects by providing its type (like svn ...) and root-url. Make sure that root-url points to the same machine, or to a machine on the local network.
Repositories integrated with this project are listed in grid-style. Edit them inline. """ ], [ 'Browsing', """ Browsing the repository is provided in explorer style. By default the latest version of the repository is shown in the explorer widget. To explore a different revision use < revno and revno > links. """ ], [ 'Revisions', """Details about each repository revision listed in reverse chronological order. """ ], ] import xml.etree.cElementTree as et from pygments.formatters import HtmlFormatter %> <%def name="hd_links()"> ${parent.hd_links()} <%def name="hd_styles()"> ${parent.hd_styles()} <%def name="hd_script()"> ${parent.hd_script()} <%def name="showfilerev( log )"> <% logdet = log[3].strftime( '%b %d, %Y,' ) %>
${log[1]} \
${logdet} \
${log[2]}
<%def name="showfile( lines )"> <% bgcolor = [ '#FFFFFF', '#F2F2F2' ] fileauthors = set([ l[3] for l in lines ]) rf_date = c.vrep.finfo['l_date'] rl_date = c.vrep.linfo['l_date'] rep_lifespan = (rf_date and rl_date) and (rl_date - rf_date).days or 0 f_date = c.filelogs and c.filelogs[-1][3] or '' l_date = c.filelogs and c.filelogs[0][3] or '' updt_days = (f_date and l_date) and (l_date - f_date).days or 0 before_days = (rf_date and f_date) and (f_date - rf_date).days or 0 after_days = (l_date and rl_date) and (rl_date - l_date).days or 0 w_before = int((before_days / float(rep_lifespan)) * 100) w_update = int((updt_days / float(rep_lifespan)) * 100) w_after = int((after_days / float(rep_lifespan)) * 100) lifespan_title = '' if f_date and l_date : lifespan_title = f_date.strftime( '%a, %b %d %Y' ) + ' TO ' +\ l_date.strftime('%a, %b %d %Y') repospath = c.fileinfo.get('repos_path', '') filepath = repospath.replace('/', ' /') %>
${updt_days}
LifeSpan :
Review
${filepath} ( r${c.vfile.revno} ) ${c.fileinfo.get('size', 0)} bytes, ${len(lines)} lines, download-file
Authors
% for a in fileauthors :
${a}
% endfor
File-History
% for log in c.filelogs : ${showfilerev( log )} % endfor
<% import re cont = '\n'.join([ l[1] for l in lines ]) conthtml = h.syntaxhl( cont, lexbyfile=repospath ) htmllines= re.search( r'
((.|[\r\n])*)
', conthtml ).groups()[0].splitlines() annotats = [ 'revision%s, %s, %s' % ( l[2], l[3], l[4].strftime('%b-%d-%Y') ) for l in lines ] zipped = zip( htmllines, annotats ) lineno = 1 %>
% for l, title in zipped :
${lineno}
${l | n}
<% lineno += 1 %> % endfor
<%def name="showfileerror( error )">

${error}

<%def name="bd_body()"> <% title = '%s' % c.vcs.name sel_vcs = capture( forms.form_selectvcs, c.authuser, c.vcslist, c.vcs and c.vcs.name or '' ) sel_frev = capture( forms.form_selectfilerevision, c.authuser, c.sel_frevs, str(c.revno) ) vcsbrowse = 'Browser' % h.url_vcsbrowse revlist = 'Revisions' % h.url_revlist if c.vcseditable : newvcs = '' +\ ' \ Integrate' % h.url_vcscreate else : newvcs = '' tline = capture( elements.iconlink, h.url_vcstimeline, 'timeline', title="Timeline of vcs-integration" ) %> ${elements.mainnav()} ${elements.contextnav([ title, sel_vcs, sel_frev, vcsbrowse, revlist, newvcs, ], rspans=[ tline ], tooltips=page_tooltips)}
% if c.authusername == 'anonymous' or not c.userpanes :
% else :
% endif
% if c.fileerror : ${showfileerror( c.fileerror)} % else : ${showfile( c.filelines )} % endif
% if c.authusername != 'anonymous' and c.userpanes :
${elements.user_panes( c.userpanes )}
% endif
<%def name="bd_script()"> ${parent.bd_script()}