treelist.tpl 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. {foreach from=$tree->GetContents() item=treeitem}
  12. <tr class="{cycle values="light,dark"}">
  13. <td class="monospace perms">{$treeitem->GetModeString()}</td>
  14. {if $treeitem instanceof GitPHP_Blob}
  15. <td class="filesize">{$treeitem->GetSize()}</td>
  16. <td></td>
  17. <td class="list fileName">
  18. <a href="{geturl project=$project action=blob hash=$treeitem hashbase=$commit file=$treeitem->GetPath()}" class="list">{$treeitem->GetName()}</a>
  19. </td>
  20. <td class="link">
  21. <a href="{geturl project=$project action=blob hash=$treeitem hashbase=$commit file=$treeitem->GetPath()}">{t}blob{/t}</a>
  22. |
  23. <a href="{geturl project=$project action=history hash=$commit file=$treeitem->GetPath()}">{t}history{/t}</a>
  24. |
  25. <a href="{geturl project=$project action=blob hash=$treeitem file=$treeitem->GetPath() output=plain}">{t}plain{/t}</a>
  26. </td>
  27. {elseif $treeitem instanceof GitPHP_Tree}
  28. <td class="filesize"></td>
  29. <td class="expander"></td>
  30. <td class="list fileName">
  31. <a href="{geturl project=$project action=tree hash=$treeitem hashbase=$commit file=$treeitem->GetPath()}" class="treeLink">{$treeitem->GetName()}</a>
  32. </td>
  33. <td class="link">
  34. <a href="{geturl project=$project action=tree hash=$treeitem hashbase=$commit file=$treeitem->GetPath()}">{t}tree{/t}</a>
  35. |
  36. <a href="{geturl project=$project action=snapshot hash=$treeitem file=$treeitem->GetPath()}" class="snapshotTip">{t}snapshot{/t}</a>
  37. </td>
  38. {/if}
  39. </tr>
  40. {/foreach}