projectlist.tpl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. {*
  2. * projectlist.tpl
  3. * gitphp: A PHP git repository browser
  4. * Component: Project list template
  5. *
  6. * Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  7. *}
  8. {extends file='main.tpl'}
  9. {block name=javascript}
  10. require.deps = ['projectlist'];
  11. {if file_exists('js/projectlist.min.js')}
  12. require.paths.projectlist = "projectlist.min";
  13. {/if}
  14. {/block}
  15. {block name=main}
  16. <div class="index_header">
  17. {if file_exists('templates/hometext.tpl') }
  18. {include file='hometext.tpl'}
  19. {else}
  20. {* default header *}
  21. <p>
  22. git source code archive
  23. </p>
  24. {/if}
  25. </div>
  26. <div class="projectSearch">
  27. <form method="get" action="{geturl}" id="projectSearchForm" enctype="application/x-www-form-urlencoded">
  28. {t}Search projects{/t}: <input type="search" name="s" class="projectSearchBox" {if $search}value="{$search}"{/if} /> <a href="{geturl}" class="clearSearch" {if !$search}style="display: none;"{/if}>X</a> {if $javascript}<img src="images/search-loader.gif" class="searchSpinner" style="display: none;" alt="{t}Loading…{/t}" />{/if}
  29. </form>
  30. </div>
  31. <table class="projectList">
  32. {foreach name=projects from=$projectlist item=proj}
  33. {if $smarty.foreach.projects.first}
  34. {* Header *}
  35. <tr class="projectHeader">
  36. {if $sort == "project"}
  37. <th>{t}Project{/t}</th>
  38. {else}
  39. <th><a class="header" href="{geturl sort=project}">{t}Project{/t}</a></th>
  40. {/if}
  41. {if $sort == "descr"}
  42. <th>{t}Description{/t}</th>
  43. {else}
  44. <th><a class="header" href="{geturl sort=descr}">{t}Description{/t}</a></th>
  45. {/if}
  46. {if $sort == "owner"}
  47. <th>{t}Owner{/t}</th>
  48. {else}
  49. <th><a class="header" href="{geturl sort=owner}">{t}Owner{/t}</a></th>
  50. {/if}
  51. {if $sort == "age"}
  52. <th>{t}Last Change{/t}</th>
  53. {else}
  54. <th><a class="header" href="{geturl sort=age}">{t}Last Change{/t}</a></th>
  55. {/if}
  56. <th>{t}Actions{/t}</th>
  57. </tr>
  58. {/if}
  59. {if $currentcategory != $proj->GetCategory()}
  60. {assign var=currentcategory value=$proj->GetCategory()}
  61. {if $currentcategory != ''}
  62. <tr class="light categoryRow">
  63. <th class="categoryName">{$currentcategory}</th>
  64. <th></th>
  65. <th></th>
  66. <th></th>
  67. <th></th>
  68. </tr>
  69. {/if}
  70. {/if}
  71. <tr class="{cycle values="light,dark"} projectRow {if $loginenabled && !$proj->UserCanAccess($loggedinuser)}disabled{/if}">
  72. <td class="projectName">
  73. {if !$loginenabled || $proj->UserCanAccess($loggedinuser)}
  74. <a href="{geturl project=$proj}" class="list {if $currentcategory != ''}indent{/if}"><span>{$proj->GetProject()}</span></a>
  75. {else}
  76. <span {if $currentcategory != ''}class="indent"{/if}>{$proj->GetProject()}</span>
  77. {/if}
  78. </td>
  79. <td class="projectDescription">
  80. {if !$loginenabled || $proj->UserCanAccess($loggedinuser)}
  81. <a href="{geturl project=$proj}" class="list"><span>{$proj->GetDescription()|escape}</span></a>
  82. {else}
  83. <span>{$proj->GetDescription()|escape}</span>
  84. {/if}
  85. </td>
  86. <td class="projectOwner"><em>{$proj->GetOwner()|escape:'html'}</em></td>
  87. {assign var=projecthead value=$proj->GetHeadCommit()}
  88. <td class="projectAge">
  89. {if $projecthead}
  90. {if $proj->GetAge() < 7200} {* 60*60*2, or 2 hours *}
  91. <span class="agehighlight"><strong><em><time datetime="{$proj->GetEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+00:00"}">{agestring age=$proj->GetAge()}</time></em></strong></span>
  92. {elseif $proj->GetAge() < 172800} {* 60*60*24*2, or 2 days *}
  93. <span class="agehighlight"><em><time datetime="{$proj->GetEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+00:00"}">{agestring age=$proj->GetAge()}</time></em></span>
  94. {else}
  95. <em><time datetime="{$proj->GetEpoch()|date_format:"%Y-%m-%dT%H:%M:%S+00:00"}">{agestring age=$proj->GetAge()}</time></em>
  96. {/if}
  97. {else}
  98. <em class="empty">{t}No commits{/t}</em>
  99. {/if}
  100. </td>
  101. <td class="link">
  102. {if !$loginenabled || $proj->UserCanAccess($loggedinuser)}
  103. <a href="{geturl project=$proj}">{t}summary{/t}</a>
  104. {if $projecthead}
  105. |
  106. <a href="{geturl project=$proj action=shortlog}">{t}shortlog{/t}</a> |
  107. <a href="{geturl project=$proj action=log}">{t}log{/t}</a> |
  108. <a href="{geturl project=$proj action=tree}">{t}tree{/t}</a> |
  109. <a href="{geturl project=$proj action=snapshot hash=HEAD}" class="snapshotTip">{t}snapshot{/t}</a>
  110. {/if}
  111. {/if}
  112. </td>
  113. </tr>
  114. {foreachelse}
  115. {if $search}
  116. <div class="message">{t 1=$search}No matches found for "%1"{/t}</div>
  117. {else}
  118. <div class="message">{t}No projects found{/t}</div>
  119. {/if}
  120. {/foreach}
  121. </table>
  122. {/block}
  123. {block name=footer}
  124. <a href="{geturl action=opml}" class="rss_logo">{t}OPML{/t}</a>
  125. <a href="{geturl action=projectindex}" class="rss_logo">{t}TXT{/t}</a>
  126. {/block}