## 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',
"""Review comments can be added interactively while viewing the reviewed item.
If able to detect a previous version for reviewing file, you can find that
modified lines are color-highlighted to indicate the difference from previous
version. Color hightlighting are only indicative of changes made."""
],
[ 'Author',
"""Author can add comments, comment's nature and also
reponsible for taking actions on all review comments."""
],
[ 'Moderator',
"""Moderator can add comments, comment's nature and is responsible
for approving actions taken on review comments. Once all the comments are
approve, the moderator can close the review."""
],
[ 'Participant',
"""Participants can comment and reply to other paticipants
comment."""
],
[ 'Timeline',
"""Timeline gives a log of all updates done to Review(s)."""
],
]
import xml.etree.cElementTree as et
from pygments.formatters import HtmlFormatter
%>
<%def name="hd_links()">
${parent.hd_links()}
%def>
<%def name="hd_styles()">
${parent.hd_styles()}
%def>
<%def name="hd_script()">
${parent.hd_script()}
%def>
## Confirm and Clean up this function !!
<%def name="revwsourceline( position, line, cmtsatpos )">
<%
bg = position in cmtsatpos and 'bgrevwcmts' or ''
esc = line and '' or ' '
plus = c.revwcmtable and '+' or ''
%>
| ${plus} | ${position} | ${line}${esc|n} |
%def>
<%def name="reviewsource()">
<%
closed = c.review.closed and 'strike' or ''
%>
Review ${c.review.id}
( ${"%s, ver:%s" % (c.review.resource_url, c.review.version) } )
% if c.revwcmtable :
${forms.form_creatercmt(
c.authuser, c.project, c.review,
h.suburl_creatercmt, c.naturenames
)}
% endif
${forms.form_replyrcmt( c.authuser, c.project, c.review,
h.suburl_replyrcmt )}
${forms.form_processrcmt( c.authuser, c.project, c.review,
h.suburl_processrcmt )}
<%
import re
cont = '\n'.join([ l for l in c.revwsource ])
conthtml = h.syntaxhl( cont, lexbyfile=c.review.resource_url )
htmllines= re.search( r'
((.|[\r\n])*)
', conthtml
).groups()[0].splitlines()
lineno = 1
bgcmtadd = c.revwcmtable and 'bgcmtadd' or ''
%>
% for l in htmllines :
<%
bg = lineno in c.cmtsatpos and 'bgrevwcmts' or ''
if c.diffpri == None :
lnobg = 'bgyellow1'
elif lineno in c.diffpri :
lnobg = 'bgyellow1'
elif c.diffsec and lineno in c.diffsec :
lnobg = 'bgred1'
else :
lnobg = 'bgaliceblue'
%>
|
|
${lineno}
|
${l | n}
|
<% lineno += 1 %>
% endfor
%def>
<%def name="bd_body()">
<%
sel_revw = capture( forms.form_selectrevw, c.authuser,
c.revwlist, c.review and c.review.resource_url or '' )
sel_rset = capture( forms.form_selectrset, c.authuser,
c.rsetlist, c.reviewset and c.reviewset.name or '' )
fav = capture( elements.favoriteicon, 'favrevw' )
searchbox = capture(
forms.form_searchbox,
c.authuser, 'searchreview', 'Search-review',
h.suburl_search, c.searchfaces
)
if c.revweditable :
newrevw = '' +\
'Create' + ''
else :
newrevw = ''
revwsets = ' \
\
Reviewsets' % h.url_reviewsets
charts = capture( elements.iconlink, h.url_revwcharts,
'barchart', title="Review analytics" )
tline = capture( elements.iconlink, h.url_revwtimeline,
'timeline', title="Timeline" )
%>
${elements.mainnav()}
${elements.contextnav( [ fav, searchbox, sel_revw, sel_rset,
newrevw, revwsets ], rspans=[ charts, tline ],
tooltips=page_tooltips )}
% if c.authusername == 'anonymous' or not c.userpanes :
% else :
% endif
% if c.authorized :
${forms.form_revwfav(
c.authuser, c.project, c.review, h.suburl_revwfav,
c.isuserfavorite and 'delfavuser' or 'addfavuser'
)}
% endif
${reviewsource()}
% if c.authusername != 'anonymous' and c.userpanes :
${elements.user_panes( c.userpanes )}
% endif
%def>
<%def name="bd_script()">
${parent.bd_script()}
%def>