blob.tpl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {*
  2. * blob.tpl
  3. * gitphp: A PHP git repository browser
  4. * Component: Blob view template
  5. *
  6. * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  7. *}
  8. {extends file='projectbase.tpl'}
  9. {block name=css}
  10. {if $geshicss}
  11. <style type="text/css">
  12. {$geshicss}
  13. </style>
  14. {/if}
  15. {/block}
  16. {block name=javascript}
  17. require.deps = ['blob'];
  18. {if file_exists('js/blob.min.js')}
  19. require.paths.blob = "blob.min";
  20. {/if}
  21. {/block}
  22. {block name=main}
  23. <div class="page_nav">
  24. {include file='nav.tpl' treecommit=$commit}
  25. <br />
  26. <a href="{geturl project=$project action=blob hash=$blob file=$blob->GetPath() output=plain}">{t}plain{/t}</a> |
  27. {if ($commit->GetHash() != $head->GetHash()) && ($tree->PathToHash($blob->GetPath()))}
  28. <a href="{geturl project=$project action=blob hashbase=HEAD file=$blob->GetPath()}">{t}HEAD{/t}</a>
  29. {else}
  30. {t}HEAD{/t}
  31. {/if}
  32. {if $blob->GetPath()}
  33. | <a href="{geturl project=$project action=history hash=$commit file=$blob->GetPath()}">{t}history{/t}</a>
  34. {if !$datatag} | <a href="{geturl project=$project action=blame hash=$blob file=$blob->GetPath() hashbase=$commit}" id="blameLink">{t}blame{/t}</a>{/if}
  35. {/if}
  36. <br />
  37. </div>
  38. {include file='title.tpl' titlecommit=$commit}
  39. {include file='path.tpl' pathobject=$blob target='blobplain'}
  40. <div class="page_body">
  41. {if $datatag}
  42. {* We're trying to display an image *}
  43. <div>
  44. <img src="data:{$mime};base64,{$data}" />
  45. </div>
  46. {elseif $geshi}
  47. {* We're using the highlighted output from geshi *}
  48. {$geshiout}
  49. {else}
  50. {* Just plain display *}
  51. <table class="code" id="blobData">
  52. <tbody>
  53. <tr class="li1">
  54. <td class="ln">
  55. <pre class="de1">
  56. {foreach from=$bloblines item=line name=bloblines}
  57. <a id="l{$smarty.foreach.bloblines.iteration}" href="#l{$smarty.foreach.bloblines.iteration}" class="linenr">{$smarty.foreach.bloblines.iteration}</a>
  58. {/foreach}
  59. </pre></td>
  60. <td class="de1">
  61. <pre class="de1">
  62. {foreach from=$bloblines item=line name=bloblines}
  63. {$line|escape}
  64. {/foreach}
  65. </pre>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. {/if}
  71. </div>
  72. {/block}