Use blob as template variable for blob objects, rather than hash
[gitphp.git] / templates / blame.tpl
Chris Han 1 {*
2 * blame.tpl
3 * gitphp: A PHP git repository browser
4 * Component: Blame view template
5 *
6 * Copyright (C) 2010 Christopher Han <xiphux@gmail.com>
7 *}
8
9 {include file='header.tpl'}
10
11 <div class="page_nav">
Chris Han 12 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$commit->GetHash()}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commitdiff&h={$commit->GetHash()}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&h={$tree->GetHash()}&hb={$commit->GetHash()}">tree</a><br />
Chris Han 13 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blob_plain&h={$hash->GetHash()}&f={$hash->GetPath()}">plain</a> |
Chris Han 14 {if $commit->GetHash() != $head->GetHash()}
Chris Han 15 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blame&hb=HEAD&f={$hash->GetPath()}">HEAD</a>
Chris Han 16 {else}
Chris Han 17 HEAD
Chris Han 18 {/if}
Chris Han 19 | blame
20 <br />
Chris Han 21 </div>
Chris Han 22
Chris Han 23 {include file='title.tpl' titlecommit=$commit}
Chris Han 24
Chris Han 25 {include file='path.tpl' pathobject=$hash target='blob'}
Chris Han 26
Chris Han 27 <div class="page_body">
28 <table class="code">
Chris Han 29 {foreach from=$hash->GetData(true) item=blobline name=blob}
Chris Han 30 {assign var=blamecommit value=$blame[$smarty.foreach.blob.iteration]}
31 {if $blamecommit}
32 {cycle values="light,dark" assign=rowclass}
33 {/if}
34 <tr class="{$rowclass}">
35 <td class="date">
36 {if $blamecommit}
37 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$blamecommit->GetHash()}" title="{$blamecommit->GetTitle()}">{$blamecommit->GetAuthorEpoch()|date_format:"%F %X"}</a>
38 {/if}
39 </td>
40 <td class="author">
41 {if $blamecommit}
42 {$blamecommit->GetAuthor()}
43 {/if}
44 </td>
45 <td class="num"><a id="l{$smarty.foreach.blob.iteration}" href="#l{$smarty.foreach.blob.iteration}" class="linenr">{$smarty.foreach.blob.iteration}</a></td>
46 <td class="codeline">{$blobline|escape}</td>
47 </tr>
Chris Han 48 {/foreach}
49 </table>
50 </div>
51
52 {include file='footer.tpl'}
53
comments