## 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. <%namespace name="forms" file="/component/forms.html"/> <%! iconmap = { 'addattach' : '/zetaicons/add_attach.png', 'addtag' : '/zetaicons/tag_green_add.png', 'attach' : '/zetaicons/attach.png', 'project' : '/zetaicons/project.png', 'projects' : '/zetaicons/projects.png', 'relation' : '/zetaicons/user_link.png', 'tag' : '/zetaicons/tag_green.png', 'team' : '/zetaicons/group_link.png', 'users' : '/zetaicons/group.png', 'user' : '/zetaicons/user.png', 'trash' : '/zetaicons/bin.png', 'refresh' : '/zetaicons/arrow_refresh.png', 'servergo' : '/zetaicons/server_go.png', 'plus_exp' : '/zetaicons/plus_exp.gif', 'arrow_right' : '/zetaicons/arrow_right.png', 'timeline' : '/zetaicons/time.png', 'tooltips' : '/zetaicons/tooltips.png', 'barchart' : '/zetaicons/chart_bar.png', 'commentadd' : '/zetaicons/comment_add.png', } %> <%def name="mainnav()" > <%def name="favoriteicon( name )"> <%def name="iconize( spantext, iconname, span_name='', classes='', styles='', title='' )"> <% iconfile = iconmap.get( iconname, '' ) %> ${spantext | n} <%def name="iconlink( link, iconname, anchor_name='', classes='', styles='', title='' )"> <% iconfile = iconmap.get( iconname, '' ) %> <%def name="flashmessages()"> <% allflash = [ ('%s'%m) for m in h.flash.pop_messages() ] errors = [ m.strip( h.ERROR_FLASH ) for m in allflash if h.ERROR_FLASH in m ] messages = [ m.strip( h.MESSAGE_FLASH ) for m in allflash if h.MESSAGE_FLASH in m ] allflash = errors + messages flashcls = (errors and 'bgLSalmon') or (messages and 'bgyellow') or '' if allflash : style= "" else : style= "display: none;" %>
% for message in allflash: ${message} % endfor
<%def name="pagebar( text, spans=[], rspans=[], tooltips=[], *args )" >
% if tooltips :
${iconize( '', 'tooltips', styles="height: 16px;" )}
% else :
% endif
% for span in rspans : ${span | n} % endfor
${text}
% for span in spans : ${span | n} % endfor
% for div_spans in args :
% for span in div_spans : ${span | n} % endfor
% endfor
% if tooltips :
% endif : <%def name="contextnav( spans=[], rspans=[], tooltips=[] )">
% if tooltips :
${iconize( '', 'tooltips' )}
% else :
% endif
% for span in rspans : ${span | n} % endfor
% for span in spans : ${span | n} % endfor
% if tooltips :
% endif : <%def name="user_panes( userpanes )">
»
refreshcollapse
% for up in userpanes : ${up}  % endfor
% for up in userpanes :
% endfor
<%def name="lictable1( license, editable )"> % if editable : % endif % for l in license : <% id, licensename, licurl, editurl, rmurl = l[:5] %> % if editable : % endif % endfor
Id License name Projects
${id} ${licensename} % for p, href in l[5:] :
${p}
% endfor
${iconize( '', 'trash', span_name='rmlic', classes='fgblue pointer', title='Remove this license' )}
<%def name="captiontextarea( text='' )">
${text} Zwiki reference
<%def name="attach_spans( span_name, form_id, refreshurl )"> <%def name="tag_spans( span_name, form_id, refreshurl )"> <%def name="helpboard( help='', classes='', styles='' )">
${help |n}
<%def name="userdetails( user, userinfo, urlphoto )"> <% username = user.username %>

${'%s %s %s' % (userinfo.firstname, userinfo.middlename, userinfo.lastname) }

${user.emailid}
timezone : ${user.timezone}
Registered as : ${username}
Registered on : ${userinfo.created_on.strftime("%a, %b %d, %Y")}
Address :

${userinfo.addressline1}

${userinfo.addressline2}

${userinfo.city} - ${userinfo.pincode}

${userinfo.state}

${userinfo.country}

% if urlphoto : % endif
<%def name="titleindex( items, url_for )"> <% curdir = [] %> <%def name="captcha( url )">
${forms.input_text( name='captcha', id='captcha' )}
## ------------------- Difference formatting ---------------------- <%def name="diff_row( col1, col2, col3, cls )"> ${col1} ${col2} ${col3} <%def name="equal_row( tup, flines, tlines )"> <% if tup[2] - tup[1] != tup[4] - tup[3] : raise Exception len = tup[2] - tup[1] %> % for ln in range(0, len) : ${ diff_row( tup[1]+ln+1, tup[3]+ln+1, flines[tup[1]+ln], 'diffequal' )} % endfor <%def name="delete_row( tup, flines, tlines )"> % for ln in range(tup[1], tup[2]) : ${diff_row( ln+1, '', flines[ln], 'diffdelete' )} % endfor <%def name="insert_row( tup, flines, tlines )"> % for ln in range(tup[3], tup[4]) : ${diff_row( '', ln+1, tlines[ln], 'diffinsert' )} % endfor <%def name="replace_row( tup, flines, tlines )"> % for ln in range(tup[1], tup[2]) : ${diff_row( ln+1, '', flines[ln], 'diffreplace' )} % endfor % for ln in range(tup[3], tup[4]) : ${diff_row( '', ln+1, tlines[ln], 'diffreplace' )} % endfor <%def name="difftable( oldver, newver, flines, tlines )"> <% m = h.SequenceMatcher( None, flines, tlines ) %>
Un-modified
Deleted
Inserted
Replaced
% for cluster in m.get_grouped_opcodes() : ${diff_row( '...', '...', '', 'skip' )} % for tup in cluster : % if tup[0] == 'equal' : ${equal_row( tup, flines, tlines )} % elif tup[0] == 'delete' : ${delete_row( tup, flines, tlines )} % elif tup[0] == 'insert' : ${insert_row( tup, flines, tlines )} % elif tup[0] == 'replace' : ${replace_row( tup, flines, tlines )} % endif % endfor % endfor
v${oldver} v${newver} Difference
## -------------------- Timeline libraries -------------------------- <%def name="timeline( ondt, log )">
  • ${iconize( ondt, 'plus_exp', span_name='interface', classes='pointer mr5', title='%s'%log.created_on )} By ${log.userhtml |n } in ${log.itemhtml |n } ${log.log}
  • <%def name="timeline_view( logs, fromoff, tooff, links, chartid='' )"> <% if logs : lf = '%s' % logs[0].created_on.strftime("%a, %b %d, %Y") lt = '%s' % logs[-1].created_on.strftime("%a, %b %d, %Y") logwindow = "Till %s from %s" % ( lf, lt ) else : logwindow = "No logs" slices = h.timeslice( logs ) slicedt = sorted( slices.keys(), key=lambda x : h.dt.datetime.strptime(x, '%a, %b %d %Y' ), reverse=True ) %>

    RSS % if links[0] : « % endif % if links[1] : % endif ${fromoff}-${tooff} % if links[2] : % endif
    ${logwindow |n} Expand
    % if chartid :
    % endif % for ondt in slicedt : % endfor

    % if links[0] : « % endif % if links[1] : % endif ${fromoff}-${tooff} % if links[2] : % endif
    ## --- Function used by review templates <%def name="showpeople()"> <% participants = [ u.username for u in c.review.participants ] x_participants = sorted(list( set( c.usernames ).difference( set( participants )) )) 'admin' in x_participants and x_participants.remove('admin') 'anonymous' in x_participants and x_participants.remove('anonymous') %>
    Author
    % if c.revweditable :
    ${forms.form_revwauthor( c.authuser, c.project, c.review, h.suburl_revwauthor, c.projusers )}
    % else : <% authorname = c.review.author and c.review.author.username or '-' %>
    % if c.review.author : ${authorname} % else : ${authorname} % endif
    % endif
    Moderator
    % if c.revweditable :
    ${forms.form_revwmoderator( c.authuser, c.project, c.review, h.suburl_revwmoderator, c.projusers )}
    % else : <% moderatorname = c.review.moderator and c.review.moderator.username \ or '-' %>
    % if c.review.moderator : ${moderatorname} % else : ${moderatorname} % endif
    % endif % if c.authuser == c.review.moderator :
    ${forms.form_closerev( c.authuser, c.project, c.review, h.suburl_closerev )}
    % endif
    Participants
    % if c.revweditable :
    ${forms.form_addparts( c.authuser, c.project, c.review, h.suburl_addparts, x_participants )}
    % endif
    % for username in sorted([ u.username for u in c.review.participants ]) :
    % if c.revweditable : x % endif ${username}
    % endfor
    ${forms.form_delparts( c.authuser, c.project, c.review, h.suburl_delparts )}
    ## -------------------- Attachment libraries -------------------------- <%def name="attachments( u, attachments, editable, attachassc=None, aa=None, ua=None, la=None, pa=None, ta=None, ra=None, wa=None )"> <% keys = sorted( attachments.keys() ) %>
    % if attachassc : % endif % for k in keys : <% count = 0 %> % for att in attachments[k] : <% createdon = att[4] and h.utc_2_usertz( att[4], u.timezone ).strftime("%a, %b %d, %Y") count += 1 bgrnd = (count%2 == 0) and 'bggray1' or '' if attachassc : items = [ h.attachassc2link( item, aa, ua, la, pa, ta, ra, wa ) for item in attachassc.get( att[0], [] ) ] else : items = [] %> % if attachassc : % endif % endfor % endfor
    id filename summary tags uploaderattached-todownloads
    ${k}
    ${att[0]} ${att[1]} ${att[2]} ${att[6]} ${att[5]} % for text, href in items : % endfor ${att[3]}
    <%def name="attachdownloads( u, attachments )"> <% count = 0 values = []; [ values.extend( v ) for v in attachments.values() ] %>
    % for att in values : <% createdon = att[4] and h.utc_2_usertz( att[4], u.timezone ).strftime("%a, %b %d, %Y") count += 1 bgrnd = (count%2 == 0) and 'bggray1' or '' %> % if att[6] : % endif % endfor
    filename summary uploader created-on downloads
    ${att[1]} ${att[2]} ${att[5]} ${createdon} ${att[3]}
    ( ${att[6]} )