path.tpl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {*
  2. * Path
  3. *
  4. * Path template
  5. *
  6. * @author Christopher Han <xiphux@gmail.com>
  7. * @copyright Copyright (c) 2010 Christopher Han
  8. * @package GitPHP
  9. * @subpackage Template
  10. *}
  11. <div class="page_path">
  12. {if $pathobject}
  13. {assign var=pathobjectcommit value=$pathobject->GetCommit()}
  14. {assign var=pathobjecttree value=$pathobjectcommit->GetTree()}
  15. <a href="{geturl project=$project action=tree hashbase=$pathobjectcommit hash=$pathobjecttree}"><strong>[{$project->GetProject()}]</strong></a> /
  16. {foreach from=$pathobject->GetPathTree() item=pathtreepiece}
  17. <a href="{geturl project=$project action=tree hashbase=$pathobjectcommit hash=$pathtreepiece file=$pathtreepiece->GetPath()}"><strong>{$pathtreepiece->GetName()|escape}</strong></a> /
  18. {/foreach}
  19. {if $pathobject instanceof GitPHP_Blob}
  20. {if $target == 'blobplain'}
  21. <a href="{geturl project=$project action=blob hash=$pathobject file=$pathobject->GetPath() output=plain}"><strong>{$pathobject->GetName()|escape}</strong></a>
  22. {elseif $target == 'blob'}
  23. <a href="{geturl project=$project action=blob hash=$pathobject hashbase=$pathobjectcommit file=$pathobject->GetPath()}"><strong>{$pathobject->GetName()|escape}</strong></a>
  24. {else}
  25. <strong>{$pathobject->GetName()|escape}</strong>
  26. {/if}
  27. {elseif $pathobject->GetName()}
  28. {if $target == 'tree'}
  29. <a href="{geturl project=$project action=tree hashbase=$pathobjectcommit hash=$pathobject file=$pathobject->GetPath()}"><strong>{$pathobject->GetName()|escape}</strong></a> /
  30. {else}
  31. <strong>{$pathobject->GetName()|escape}</strong> /
  32. {/if}
  33. {/if}
  34. {else}
  35. &nbsp;
  36. {/if}
  37. </div>