Make subtree snapshots using direct tree objects rather than path restrictions
[gitphp.git] / templates / treelist.tpl
Chris Han 1 {*
2 * Tree list
3 *
4 * Tree filelist template fragment
5 *
6 * @author Christopher Han <xiphux@gmail.com>
7 * @copyright Copyright (c) 2010 Christopher Han
8 * @package GitPHP
9 * @subpackage Template
10 *}
11
12 {foreach from=$tree->GetContents() item=treeitem}
13 <tr class="{cycle values="light,dark"}">
Chris Han 14 <td class="monospace perms">{$treeitem->GetModeString()}</td>
Chris Han 15 {if $treeitem instanceof GitPHP_Blob}
16 <td class="filesize">{$treeitem->GetSize()}</td>
Chris Han 17 <td></td>
Chris Han 18 <td class="list fileName">
Chris Han 19 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob&amp;h={$treeitem->GetHash()}&amp;hb={$commit->GetHash()}&amp;f={$treeitem->GetPath()}" class="list">{$treeitem->GetName()}</a>
20 </td>
21 <td class="link">
22 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob&amp;h={$treeitem->GetHash()}&amp;hb={$commit->GetHash()}&amp;f={$treeitem->GetPath()}">{t}blob{/t}</a>
23 |
24 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=history&amp;h={$commit->GetHash()}&amp;f={$treeitem->GetPath()}">{t}history{/t}</a>
25 |
26 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob_plain&amp;h={$treeitem->GetHash()}&amp;f={$treeitem->GetPath()}">{t}plain{/t}</a>
27 </td>
28 {elseif $treeitem instanceof GitPHP_Tree}
Chris Han 29 <td class="filesize"></td>
Chris Han 30 <td class="expander"></td>
Chris Han 31 <td class="list fileName">
Chris Han 32 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=tree&amp;h={$treeitem->GetHash()}&amp;hb={$commit->GetHash()}&amp;f={$treeitem->GetPath()}" class="treeLink">{$treeitem->GetName()}</a>
Chris Han 33 </td>
34 <td class="link">
35 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=tree&amp;h={$treeitem->GetHash()}&amp;hb={$commit->GetHash()}&amp;f={$treeitem->GetPath()}">{t}tree{/t}</a>
36 |
Chris Han 37 <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=snapshot&amp;h={$treeitem->GetHash()}&amp;f={$treeitem->GetPath()}" class="snapshotTip">{t}snapshot{/t}</a>
Chris Han 38 </td>
39 {/if}
40 </tr>
41 {/foreach}
42
comments