Export the project object itself to the template
[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 {* If we managed to look up commit info, we have enough info to display the full header - othewise just use a simple header *}
12 <div class="page_nav">
13 {if $fullnav}
Chris Han 14 <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={$hashbase}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commitdiff&h={$hashbase}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&h={$tree}&hb={$hashbase}">tree</a><br />
Chris Han 15 {if $file}
Chris Han 16 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blob_plain&h={$hash}&f={$file}">plain</a> |
Chris Han 17 {if ($hashbase != "HEAD") && ($hashbase != $head)}
Chris Han 18 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blame&hb=HEAD&f={$file}">HEAD</a>
Chris Han 19 {else}
20 HEAD
21 {/if}
22 | blame
23 <br />
24 {else}
Chris Han 25 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blob_plain&h={$hash}">plain</a><br />
Chris Han 26 {/if}
27 {else}
28 <br /><br />
29 {/if}
30 </div>
31 <div>
32 {if $fullnav}
Chris Han 33 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$hashbase}" class="title">{$title}
Chris Han 34 {if $hashbaseref}
35 <span class="tag">{$hashbaseref}</span>
36 {/if}
37 </a>
38 {else}
39 <div class="title">{$hash}</div>
40 {/if}
41 </div>
42 <div class="page_path">
43 {* The path to the file, with directories broken into tree links *}
44 <b>
Chris Han 45 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&hb={$hashbase}&h={$hashbase}">[{$project->GetProject()}]</a> /
Chris Han 46 {foreach from=$paths item=path name=paths}
47 {if $smarty.foreach.paths.last}
Chris Han 48 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blob_plain&h={$path.tree}&f={$path.full}">{$path.short}</a>
Chris Han 49 {else}
Chris Han 50 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&hb={$hashbase}&h={$path.tree}&f={$path.full}">{$path.short}</a> /
Chris Han 51 {/if}
52 {/foreach}
53 </b>
54 </div>
55 <div class="page_body">
56 <table class="code">
57 {counter name=linecount start=0 print=false}
58 {foreach from=$blamedata item=blameitem}
59 {cycle values="light,dark" assign=rowclass}
60 {foreach from=$blameitem.lines name=linegroup item=blameline}
61 {counter name=linecount assign=linenum}
62 <tr class="{$rowclass}">
63 <td class="num"><a id="l{$linenum}" href="#l{$linenum}" class="linenr">{$linenum}</a></td>
Chris Han 64 <td class="date">
65 {if $smarty.foreach.linegroup.first}
66 {if $blameitem.commit}
Chris Han 67 <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$blameitem.commit}" title="{$blameitem.commitdata.summary}">{$blameitem.commitdata.authortime|date_format:"%F %X"}</a>
Chris Han 68 {else}
Chris Han 69 {$blameitem.commitdata.authortime|date_format:"%F %X"}
Chris Han 70 {/if}
71 {/if}
72 </td>
Chris Han 73 <td class="author">{if $smarty.foreach.linegroup.first}{$blameitem.commitdata.author}{/if}</td>
Chris Han 74 <td class="codeline">{$blameline|escape}</td>
Chris Han 75 </tr>
76 {/foreach}
77 {/foreach}
78 </table>
79 </div>
80
81 {include file='footer.tpl'}
82
comments