history.tpl 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {*
  2. * history.tpl
  3. * gitphp: A PHP git repository browser
  4. * Component: History view template
  5. *
  6. * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  7. *}
  8. {extends file='projectbase.tpl'}
  9. {block name=links append}
  10. {if $page > 0}
  11. <link rel="prev" href="{geturl project=$project action=history hash=$commit file=$blob->GetPath() page=$page-1}" />
  12. {/if}
  13. {if $hasmorehistory}
  14. <link rel="next" href="{geturl project=$project action=history hash=$commit file=$blob->GetPath() page=$page+1}" />
  15. {/if}
  16. {/block}
  17. {block name=main}
  18. {* Page header *}
  19. <div class="page_nav">
  20. {include file='nav.tpl' treecommit=$commit}
  21. <br />
  22. {if $page > 0}
  23. <a href="{geturl project=$project action=history hash=$commit file=$blob->GetPath()}">{t}first{/t}</a>
  24. {else}
  25. {t}first{/t}
  26. {/if}
  27. &sdot;
  28. {if $page > 0}
  29. <a href="{geturl project=$project action=history hash=$commit file=$blob->GetPath() page=$page-1}">{t}prev{/t}</a>
  30. {else}
  31. {t}prev{/t}
  32. {/if}
  33. &sdot;
  34. {if $hasmorehistory}
  35. <a href="{geturl project=$project action=history hash=$commit file=$blob->GetPath() page=$page+1}">{t}next{/t}</a>
  36. {else}
  37. {t}next{/t}
  38. {/if}
  39. </div>
  40. {include file='title.tpl' titlecommit=$commit}
  41. {include file='path.tpl' pathobject=$blob target='blob'}
  42. <table>
  43. {* Display each history line *}
  44. {foreach from=$history item=historyitem}
  45. {assign var=historycommit value=$historyitem->GetCommit()}
  46. <tr class="{cycle values="light,dark"}">
  47. <td title="{if $historycommit->GetAge() > 60*60*24*7*2}{agestring age=$historycommit->GetAge()}{else}{$historycommit->GetCommitterEpoch()|date_format:"%Y-%m-%d"}{/if}"><em><time datetime="{$historycommit->GetCommitterEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+00:00"}">{if $historycommit->GetAge() > 60*60*24*7*2}{$historycommit->GetCommitterEpoch()|date_format:"%Y-%m-%d"}{else}{agestring age=$historycommit->GetAge()}{/if}</time></em></td>
  48. <td><em>{$historycommit->GetAuthorName()}</em></td>
  49. <td><a href="{geturl project=$project action=commit hash=$historycommit}" class="list commitTip" {if strlen($historycommit->GetTitle()) > 50}title="{$historycommit->GetTitle()|escape}"{/if}><strong>{$historycommit->GetTitle(50)|escape:'html'}</strong></a>
  50. {include file='refbadges.tpl' commit=$historycommit}
  51. </td>
  52. <td class="link"><a href="{geturl project=$project action=commit hash=$historycommit}">{t}commit{/t}</a> | <a href="{geturl project=$project action=commitdiff hash=$historycommit}">{t}commitdiff{/t}</a> | <a href="{geturl project=$project action=blob hashbase=$historycommit file=$blob->GetPath()}">{t}blob{/t}</a> | <a href="{geturl project=$project action=blobdiff hash=$historyitem->GetToBlob() hashparent=$historyitem->GetFromBlob() file=$blob->GetPath() hashbase=$historycommit}">{t}diff{/t}</a>{if $blob->GetHash() != $historyitem->GetToHash()} | <a href="{geturl project=$project action=blobdiff hash=$blob hashparent=$historyitem->GetToBlob() file=$blob->GetPath() hashbase=$historycommit}">{t}diff to current{/t}</a>{/if}
  53. </td>
  54. </tr>
  55. {/foreach}
  56. {if $hasmorehistory}
  57. <tr>
  58. <td><a href="{geturl project=$project action=history hash=$commit file=$blob->GetPath() page=$page+1}">{t}next{/t}</a></td>
  59. <td></td><td></td><td></td>
  60. </tr>
  61. {/if}
  62. </table>
  63. {/block}