Add a couple comments to the templates
Add a couple comments to the templates

{* {*
* commitdiff.tpl * commitdiff.tpl
* gitphp: A PHP git repository browser * gitphp: A PHP git repository browser
* Component: Commitdiff view template * Component: Commitdiff view template
* *
* Copyright (C) 2009 Christopher Han <xiphux@gmail.com> * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
*} *}
  {* Nav *}
<div class="page_nav"> <div class="page_nav">
<a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | commitdiff | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a><br /><a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff_plain&h={$hash}&hp={$hashparent}">plain</a> <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | commitdiff | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a><br /><a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff_plain&h={$hash}&hp={$hashparent}">plain</a>
</div> </div>
<div> <div>
<br /><br /> <br /><br />
</div> </div>
<div> <div>
<a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}{if $commitref} <span class="tag">{$commitref}</span>{/if}</a> <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}{if $commitref} <span class="tag">{$commitref}</span>{/if}</a>
</div> </div>
<div class="page_body"> <div class="page_body">
{foreach from=$comment item=line} {foreach from=$comment item=line}
{$line}<br /> {$line}<br />
{/foreach} {/foreach}
<br /> <br />
  {* Diff each file changed *}
{section name=difftree loop=$difftreelines} {section name=difftree loop=$difftreelines}
{if $difftreelines[difftree].status == "A"} {if $difftreelines[difftree].status == "A"}
<div class="diff_info"> <div class="diff_info">
{$difftreelines[difftree].to_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].to_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}{$difftreelines[difftree].file}{else}{$difftreelines[difftree].to_id}{/if}</a>(new) {$difftreelines[difftree].to_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].to_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}{$difftreelines[difftree].file}{else}{$difftreelines[difftree].to_id}{/if}</a>(new)
</div> </div>
{elseif $difftreelines[difftree].status == "D"} {elseif $difftreelines[difftree].status == "D"}
<div class="diff_info"> <div class="diff_info">
{$difftreelines[difftree].from_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].from_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}{$difftreelines[difftree].file}{else}{$difftreelines[difftree].from_id}{/if}</a>(deleted) {$difftreelines[difftree].from_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].from_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}{$difftreelines[difftree].file}{else}{$difftreelines[difftree].from_id}{/if}</a>(deleted)
</div> </div>
{elseif $difftreelines[difftree].status == "M"} {elseif $difftreelines[difftree].status == "M"}
{if $difftreelines[difftree].from_id != $difftreelines[difftree].to_id} {if $difftreelines[difftree].from_id != $difftreelines[difftree].to_id}
<div class="diff_info"> <div class="diff_info">
{$difftreelines[difftree].from_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].from_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}a/{$difftreelines[difftree].file}{else}{$difftreelines[difftree].from_id}{/if}</a> -&gt; {$difftreelines[difftree].to_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].to_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}b/{$difftreelines[difftree].file}{else}{$difftreelines[difftree].to_id}{/if}</a> {$difftreelines[difftree].from_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].from_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}a/{$difftreelines[difftree].file}{else}{$difftreelines[difftree].from_id}{/if}</a> -&gt; {$difftreelines[difftree].to_type}:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$difftreelines[difftree].to_id}&hb={$hash}&f={$difftreelines[difftree].file}">{if $difftreelines[difftree].file}b/{$difftreelines[difftree].file}{else}{$difftreelines[difftree].to_id}{/if}</a>
</div> </div>
{/if} {/if}
{/if} {/if}
{include file='filediff.tpl' diff=$difftreelines[difftree].diffout} {include file='filediff.tpl' diff=$difftreelines[difftree].diffout}
{/section} {/section}
</div> </div>
   
{* {*
* history.tpl * history.tpl
* gitphp: A PHP git repository browser * gitphp: A PHP git repository browser
* Component: History view template * Component: History view template
* *
* Copyright (C) 2009 Christopher Han <xiphux@gmail.com> * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
*} *}
{* Page header *} {* Page header *}
<div class="page_nav"> <div class="page_nav">
<a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a> <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a>
<br /><br /> <br /><br />
</div> </div>
<div> <div>
<a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title} <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}
{if $hashbaseref} {if $hashbaseref}
<span class="tag">{$hashbaseref}</span> <span class="tag">{$hashbaseref}</span>
{/if} {/if}
</a> </a>
</div> </div>
<div class="page_path"> <div class="page_path">
{* File path *} {* File path *}
<b> <b>
<a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$hash}">[{$project}]</a> / <a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$hash}">[{$project}]</a> /
{foreach from=$paths item=path name=paths} {foreach from=$paths item=path name=paths}
{if $smarty.foreach.paths.last} {if $smarty.foreach.paths.last}
<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$path.tree}&f={$path.full}">{$path.short}</a> <a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$path.tree}&f={$path.full}">{$path.short}</a>
{else} {else}
<a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$path.tree}&f={$path.full}">{$path.short}</a> / <a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$path.tree}&f={$path.full}">{$path.short}</a> /
{/if} {/if}
{/foreach} {/foreach}
</b> </b>
</div> </div>
<table cellspacing="0"> <table cellspacing="0">
  {* Display each history line *}
{section name=history loop=$historylines} {section name=history loop=$historylines}
<tr class="{cycle values="light,dark"}"> <tr class="{cycle values="light,dark"}">
<td title="{$historylines[history].agestringage}"><i>{$historylines[history].agestringdate}</i></td> <td title="{$historylines[history].agestringage}"><i>{$historylines[history].agestringdate}</i></td>
<td><i>{$historylines[history].authorname}</i></td> <td><i>{$historylines[history].authorname}</i></td>
<td><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$historylines[history].commit}" class="list"><b>{$historylines[history].title}{if $historylines[history].commitref} <span class="tag">{$historylines[history].commitref}</span>{/if}</b></a></td> <td><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$historylines[history].commit}" class="list"><b>{$historylines[history].title}{if $historylines[history].commitref} <span class="tag">{$historylines[history].commitref}</span>{/if}</b></a></td>
<td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$historylines[history].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$historylines[history].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=blob&hb={$historylines[history].commit}&f={$historylines[history].file}">blob</a>{if $historylines[history].blob && $historylines[history].blobparent} | <a href="{$SCRIPT_NAME}?p={$project}&a=blobdiff&h={$historylines[history].blob}&hp={$historylines[history].blobparent}&hb={$historylines[history].commit}&f={$historylines[history].file}">diff to current</a>{/if} <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$historylines[history].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$historylines[history].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=blob&hb={$historylines[history].commit}&f={$historylines[history].file}">blob</a>{if $historylines[history].blob && $historylines[history].blobparent} | <a href="{$SCRIPT_NAME}?p={$project}&a=blobdiff&h={$historylines[history].blob}&hp={$historylines[history].blobparent}&hb={$historylines[history].commit}&f={$historylines[history].file}">diff to current</a>{/if}
</td> </td>
</tr> </tr>
{/section} {/section}
</table> </table>
   
{* {*
* log.tpl * log.tpl
* gitphp: A PHP git repository browser * gitphp: A PHP git repository browser
* Component: Log view template * Component: Log view template
* *
* Copyright (C) 2009 Christopher Han <xiphux@gmail.com> * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
*} *}
  {* Nav *}
<div class="page_nav"> <div class="page_nav">
<a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}">shortlog</a> | log | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hash}">tree</a> <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}">shortlog</a> | log | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hash}">tree</a>
<br /> <br />
{if ($hash != $head) || $page} {if ($hash != $head) || $page}
<a href="{$SCRIPT_NAME}?p={$project}&a=log">HEAD</a> <a href="{$SCRIPT_NAME}?p={$project}&a=log">HEAD</a>
{else} {else}
HEAD HEAD
{/if} {/if}
&sdot; &sdot;
{if $page > 0} {if $page > 0}
<a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$page-1}" accesskey="p" title="Alt-p">prev</a> <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$page-1}" accesskey="p" title="Alt-p">prev</a>
{else} {else}
prev prev
{/if} {/if}
&sdot; &sdot;
{if $revlistcount > 100} {if $revlistcount > 100}
<a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$page+1}" accesskey="n" title="Alt-n">next</a> <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$page+1}" accesskey="n" title="Alt-n">next</a>
{else} {else}
next next
{/if} {/if}
<br /> <br />
</div> </div>
{if $norevlist} {if $norevlist}
<div> <div>
<a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp</a> <a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp</a>
</div> </div>
<div class="page_body"> <div class="page_body">
Last change {$lastchange}. Last change {$lastchange}.
<br /><br /> <br /><br />
</div> </div>
{/if} {/if}
  {* Display each commit *}
{section name=log loop=$commitlines} {section name=log loop=$commitlines}
<div> <div>
<a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}" class="title"><span class="age">{$commitlines[log].agestring}</span>{$commitlines[log].title} <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}" class="title"><span class="age">{$commitlines[log].agestring}</span>{$commitlines[log].title}
{if $commitlines[log].commitref} {if $commitlines[log].commitref}
<span class="tag">{$commitlines[log].commitref}</span> <span class="tag">{$commitlines[log].commitref}</span>
{/if} {/if}
</a> </a>
</div> </div>
<div class="title_text"> <div class="title_text">
<div class="log_link"> <div class="log_link">
<a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commitlines[log].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commitlines[log].commit}&hb={$commitlines[log].commit}">tree</a> <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commitlines[log].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commitlines[log].commit}&hb={$commitlines[log].commit}">tree</a>
<br /> <br />
</div> </div>
<i>{$commitlines[log].authorname} [{$commitlines[log].rfc2822}]</i><br /> <i>{$commitlines[log].authorname} [{$commitlines[log].rfc2822}]</i><br />
</div> </div>
<div class="log_body"> <div class="log_body">
{foreach from=$commitlines[log].comment item=line} {foreach from=$commitlines[log].comment item=line}
{$line}<br /> {$line}<br />
{/foreach} {/foreach}
{if count($commitlines[log].comment) > 0} {if count($commitlines[log].comment) > 0}
<br /> <br />
{/if} {/if}
</div> </div>
{/section} {/section}
   
comments