filediffsidebyside.tpl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {*
  2. * filediffsidebyside
  3. *
  4. * File diff with side-by-side changes template
  5. *
  6. * @author Christopher Han <xiphux@gmail.com>
  7. * @author Mattias Ulbrich
  8. * @copyright Copyright (c) 2010 Christopher Han
  9. * @package GitPHP
  10. * @subpackage Template
  11. *}
  12. <table class="diffTable">
  13. {if $filediff->GetStatus() == 'D'}
  14. {assign var=delblob value=$filediff->GetFromBlob()}
  15. {foreach from=$delblob->GetData(true) item=blobline}
  16. <tr class="diff-deleted">
  17. <td class="diff-left">{$blobline|escape}</td>
  18. <td>&nbsp;</td>
  19. </tr>
  20. {/foreach}
  21. {elseif $filediff->GetStatus() == 'A'}
  22. {assign var=newblob value=$filediff->GetToBlob()}
  23. {foreach from=$newblob->GetData(true) item=blobline}
  24. <tr class="diff-added">
  25. <td class="diff-left">&nbsp;</td>
  26. <td>{$blobline|escape}</td>
  27. </tr>
  28. {/foreach}
  29. {else}
  30. {foreach from=$diffsplit item=lineinfo}
  31. {if $lineinfo[0]=='added'}
  32. <tr class="diff-added">
  33. {elseif $lineinfo[0]=='deleted'}
  34. <tr class="diff-deleted">
  35. {elseif $lineinfo[0]=='modified'}
  36. <tr class="diff-modified">
  37. {else}
  38. <tr>
  39. {/if}
  40. <td class="diff-left">{if $lineinfo[1]}{$lineinfo[1]|escape}{else}&nbsp;{/if}</td>
  41. <td>{if $lineinfo[2]}{$lineinfo[2]|escape}{else}&nbsp;{/if}</td>
  42. </tr>
  43. {/foreach}
  44. {/if}
  45. </table>