2008-11-30 09:26:05 +00:00
{extends "idf/review/base-full.html"}
{block extraheader}< link rel = "stylesheet" type = "text/css" href = "{media '/idf/css/prettify.css'}" / > {/block}
{block docclass}yui-t1{assign $inCreate = true}{/block}
{block body}
2008-12-01 17:23:18 +00:00
{if !$user.isAnonymous() and $form.errors}
2008-11-30 09:26:05 +00:00
< div class = "px-message-error" >
< p > {trans 'The form contains some errors. Please correct them to submit your review.'}< / p >
{if $form.get_top_errors}
{$form.render_top_errors|unsafe}
{/if}
< / div >
{/if}
2008-12-01 17:23:18 +00:00
< table class = "disp" summary = "" >
< tr > < td >
2008-11-30 09:26:05 +00:00
< table class = "commit" summary = "" >
< tr >
< th > < strong > {trans 'Created:'}< / strong > < / th > < td > {$patch.creation_dtime|date:"%Y-%m-%d %H:%M:%S"} ({$patch.creation_dtime|dateago})< / td >
< / tr >
< tr >
< th > < strong > {trans 'Updated:'}< / strong > < / th > < td > {$review.modif_dtime|dateago}< / td >
< / tr >
< tr >
< th > < strong > {trans 'Author:'}< / strong > < / th > < td > {$review.get_submitter()}< / td >
< / tr >
< tr >
< th > < strong > {trans 'Commit:'}< / strong > < / th > < td class = "mono" > < a href = "{url 'IDF_Views_Source::treeBase', array($project.shortname, $patch.get_commit().scm_id)}" title = "{trans 'View corresponding source tree'}" > {$patch.get_commit().scm_id}< / a > < / td >
< / tr >
< tr >
2009-08-03 19:23:23 +00:00
< th > < strong > {trans 'Description:'}< / strong > < / th > < td > {issuetext $review.summary, $request}< br / > < br / > {issuetext $patch.description, $request}< / td >
2008-11-30 09:26:05 +00:00
< / tr >
< tr >
< th > < strong > {trans 'Reviewers:'}< / strong > < / th > < td > {if count($reviewers)}{foreach $reviewers as $r}{$r}, {/foreach}{else}{trans 'No reviewers at the moment.'}{/if}< / td >
< / tr > {if count($diff.files)}
< tr >
< th > < strong > {trans 'Files:'}< / strong > < / th >
< td >
{foreach $diff.files as $filename=>$diffdef}
{assign $ndiff = count($diffdef['chunks'])}
{assign $nc = $files[$filename][2]->count()}
< a href = "{url 'IDF_Views_Source::tree', array($project.shortname, $patch.get_commit().scm_id, $filename)}" > {$filename}< / a > (< a href = "#diff-{$filename|md5}" > {blocktrans $ndiff}{$ndiff} diff{plural}{$ndiff} diffs{/blocktrans}< / a > {if $nc}, < a href = "#ct-{$filename|md5}" > {blocktrans $nc}{$nc} comment{plural}{$nc} comments{/blocktrans}< / a > {/if})< br / >
{/foreach}
< / td >
< / tr > {/if}
< tr > {aurl 'url', 'IDF_Views_Review::getPatch', array($project.shortname, $patch.id)}
< th > < / th > < td > < a href = "{$url}" > < img style = "vertical-align: text-bottom;" src = "{media '/idf/img/package-grey.png'}" alt = "{trans 'Archive'}" align = "bottom" / > < / a > < a href = "{$url}" class = "soft" > {trans 'Download the corresponding diff file'}< / a > < / td >
< / tr >
< / table >
2008-12-01 17:23:18 +00:00
< / td > < td >
2008-11-30 09:26:05 +00:00
{if !$user.isAnonymous()}
2008-12-01 17:23:18 +00:00
< div class = "issue-submit-info" style = "width: 90%; float: right; position: relative;" >
2008-11-30 09:26:05 +00:00
< p > < strong > {trans 'How to Participate in a Code Review'}< / strong > < / p >
< p > {blocktrans}Code review is a process in which
after or before changes are commited into the code repository,
different people discuss the code changes. The goal is
to < strong > improve the quality of the code and the
contributions< / strong > , as such, you must be pragmatic when writing
your review. Correctly mention the line numbers (in the old or in the
new file) and try to keep a good balance between seriousness and fun.
{/blocktrans}< / p >
< p > {blocktrans}
< strong > Proposing code for review is intimidating< / strong > , you know
you will receive critics, so please, as a reviewer, < strong > keep this
process fun< / strong > , use it to help your contributor learn your
coding standards and the structure of the code and < strong > make them want
to propose more contributions< / strong > .
{/blocktrans}< / p > < / div >
{/if}
2008-12-01 17:23:18 +00:00
< / td > < / tr >
< / table >
2008-11-30 09:26:05 +00:00
< form method = "post" action = "." >
{foreach $files as $file=>$def}
< table class = "diff" summary = " " >
< tbody >
< tr id = "diff-{$file|md5}" > < th colspan = "4" > {$file}< / th > < / tr >
< tr > < th colspan = "2" > {trans 'Old'}< / th > < th colspan = "2" > {trans 'New'}< / th > < / tr >
{$def[0]}
< / tbody >
< / table >
2009-10-29 12:25:50 +00:00
{assign $fcomments = $def[2]}
2010-12-05 00:22:32 +00:00
{assign $nc = $fcomments.count()}
2008-11-30 09:26:05 +00:00
{assign $i = 1}
2010-12-05 00:22:32 +00:00
{foreach $fcomments as $c}
2009-07-16 08:04:58 +00:00
< div class = "issue-comment{if $i == 1} issue-comment-first{/if}{if $i == $nc} issue-comment-last{/if}" id = "ic{$c.id}" > {assign $who = $c.get_comment().get_submitter()}{aurl 'whourl', 'IDF_Views_User::view', array($who.login)}
2008-11-30 09:26:05 +00:00
{aurl 'url', 'IDF_Views_Review::view', array($project.shortname, $review.id)}
{assign $id = $c.id}
{assign $url = $url~'#ic'~$c.id}
< p { if $ i = = 1 } id = "ct-{$file|md5}" { / if } > {blocktrans}Comment < a href = "{$url}" > {$i}< / a > by < a href = "{$whourl}" > {$who}< / a > , {$c.creation_dtime|date}{/blocktrans}< / p >
< pre class = "issue-comment-text" > {issuetext $c.content, $request}< / pre >
< / div > {assign $i = $i + 1}
{/foreach}
{if !$user.isAnonymous()}
< table class = "form" summary = " " >
< tr >
< td > < / td >
< td >
< p > {blocktrans}Your comments on the changes in file < em > {$file}< / em > :{/blocktrans}< br / > {$def[1]|safe}< / p >
< / td >
< / tr > < / table > {/if}
{/foreach}
2009-10-29 12:25:50 +00:00
2010-12-05 00:22:32 +00:00
{assign $i = 1}
{assign $nc = $comments.count()}
2009-10-29 12:25:50 +00:00
{if $nc}< hr align = "left" class = "attach" / >
< h2 > {trans 'General Comments'}< / h2 >
{/if}
2010-12-05 00:22:32 +00:00
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}{assign $submitter = $c.get_submitter()}{assign $submitter_data = $c.get_submitter_data()}
< div class = "issue-comment{if $i == 1} issue-comment-first{/if}{if $i == ($nc)} issue-comment-last{/if}" id = "ic{$c.id}" >
{if $submitter_data.avatar != ''}
< img style = "float:right; position: relative; max-height: 60px; max-width: 60px;" src = "{media}/upload/avatars/{$submitter_data.avatar}" alt = " " / >
{else}
< img style = "float:right; position: relative;" src = "http://www.gravatar.com/avatar/{$submitter.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt = " " / >
{/if}
2009-10-29 12:25:50 +00:00
{aurl 'url', 'IDF_Views_Review::view', array($project.shortname, $review.id)}
{assign $id = $c.id}
{assign $url = $url~'#ic'~$c.id}
< p > {blocktrans}Comment < a href = "{$url}" > {$i}< / a > by {$submitter}, {$c.creation_dtime|date}{/blocktrans}< / p >
{if strlen($c.content) > 0}< pre class = "issue-comment-text" > {issuetext $c.content, $request}< / pre > {/if}
{if $c.changedReview()}
2010-12-05 00:22:32 +00:00
< div class = "issue-changes" >
2009-10-29 12:25:50 +00:00
{foreach $c.changes as $w => $v}
< strong > {if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}< / strong > {$v}< br / >
{/foreach}
2010-12-05 00:22:32 +00:00
< / div >
2009-10-29 12:25:50 +00:00
{/if}
< / div > {assign $i = $i + 1}{if $i == $nc+1 and $user.isAnonymous()}
< div class = "issue-comment-signin" >
{aurl 'url', 'IDF_Views::login'}{blocktrans}< a href = "{$url}" > Sign in< / a > to participate in the review.{/blocktrans}
< / div >
{/if}
{/foreach}
2008-11-30 09:26:05 +00:00
{if !$user.isAnonymous()}
2009-10-29 12:25:50 +00:00
{if !$nc}< hr align = "left" class = "attach" / > {/if}
2008-11-30 09:26:05 +00:00
< table class = "form" summary = " " >
< tr >
2009-10-29 12:25:50 +00:00
< th > < strong > {$form.f.content.labelTag}:< / strong > < / th >
< td > {if $form.f.content.errors}{$form.f.content.fieldErrors}{/if}
{$form.f.content|unsafe}
< / td >
< / tr >
{if $isOwner or $isMember}
< tr >
< th > < strong > {$form.f.summary.labelTag}:< / strong > < / th >
< td > {if $form.f.summary.errors}{$form.f.summary.fieldErrors}{/if}
{$form.f.summary|unsafe}
< / td >
< / tr >
< tr >
< th > < strong > {$form.f.status.labelTag}:< / strong > < / th >
< td > {if $form.f.status.errors}{$form.f.status.fieldErrors}{/if}
{$form.f.status|unsafe}
< / td >
< / tr > {/if}
< tr >
2008-11-30 09:26:05 +00:00
< td > < / td >
< td > < input type = "submit" value = "{trans 'Submit Code Review'}" name = "submit" / > | < a href = "{url 'IDF_Views_Review::index', array($project.shortname)}" > {trans 'Cancel'}< / a >
< / td >
< / tr > < / table >
{/if}
< / form >
{/block}
2009-10-29 12:25:50 +00:00
2008-11-30 09:26:05 +00:00
{block javascript}
< script type = "text/javascript" src = "{media '/idf/js/prettify.js'}" > < / script >
< script type = "text/javascript" >
prettyPrint();
< / script >
2009-10-29 12:25:50 +00:00
{if $isOwner or $isMember}{include 'idf/issues/js-autocomplete.html'}{/if}
2008-11-30 09:26:05 +00:00
{/block}