blobdiff.tpl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {*
  2. * blobdiff.tpl
  3. * gitphp: A PHP git repository browser
  4. * Component: Blobdiff view template
  5. *
  6. * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  7. *}
  8. {extends file='projectbase.tpl'}
  9. {block name=main}
  10. <div class="page_nav">
  11. {include file='nav.tpl' treecommit=$commit}
  12. <br />
  13. {if $sidebyside}
  14. <a href="{geturl project=$project action=blobdiff hash=$blob hashparent=$blobparent hashbase=$commit file=$file diffmode=unified}">{t}unified{/t}</a>
  15. {else}
  16. <a href="{geturl project=$project action=blobdiff hash=$blob hashparent=$blobparent hashbase=$commit file=$file diffmode=sidebyside}">{t}side by side{/t}</a>
  17. {/if}
  18. |
  19. <a href="{geturl project=$project action=blobdiff hash=$blob hashparent=$blobparent file=$file output=plain}">{t}plain{/t}</a>
  20. </div>
  21. {include file='title.tpl' titlecommit=$commit}
  22. {include file='path.tpl' pathobject=$blobparent target='blob'}
  23. <div class="page_body">
  24. <div class="diff_info">
  25. {* Display the from -> to diff header *}
  26. {t}blob{/t}:<a href="{geturl project=$project action=blob hash=$blobparent hashbase=$commit file=$file}">{if $file}a/{$file}{else}{$blobparent->GetHash()}{/if}</a> -&gt; {t}blob{/t}:<a href="{geturl project=$project action=blob hash=$blob hashbase=$commit file=$file}">{if $file}b/{$file}{else}{$blob->GetHash()}{/if}</a>
  27. </div>
  28. {if $filediff->IsBinary()}
  29. <pre>
  30. {t 1=$filediff->GetFromLabel($file) 2=$filediff->GetToLabel($file)}Binary files %1 and %2 differ{/t}
  31. </pre>
  32. {else}
  33. {if $sidebyside}
  34. {* Display the sidebysidediff *}
  35. {include file='filediffsidebyside.tpl' diffsplit=$filediff->GetDiffSplit()}
  36. {else}
  37. {* Display the diff *}
  38. {include file='filediff.tpl' diff=$filediff->GetDiff($file, false, true)}
  39. {/if}
  40. {/if}
  41. </div>
  42. {/block}