Chris Han | 1 | {* | |
Chris Han | 2 | * projectlist.tpl | |
Chris Han | 3 | * gitphp: A PHP git repository browser | |
4 | * Component: Project list template | ||
5 | * | ||
6 | * Copyright (C) 2009 Christopher Han <xiphux@gmail.com> | ||
7 | *} | ||
Chris Han | 8 | {include file='header.tpl'} | |
9 | |||
Chris Han | 10 | <div class="index_header"> | |
11 | {if file_exists('templates/hometext.tpl') } | ||
Chris Han | 12 | {include file='hometext.tpl'} | |
Chris Han | 13 | {else} | |
14 | {* default header *} | ||
15 | <p> | ||
16 | git source code archive | ||
17 | </p> | ||
18 | {/if} | ||
19 | </div> | ||
Chris Han | 20 | ||
Chris Han | 21 | <div class="projectSearch"> | |
Chris Han | 22 | <form method="get" action="index.php" id="projectSearchForm" enctype="application/x-www-form-urlencoded"> | |
23 | {t}Search projects{/t}: <input type="text" name="s" class="projectSearchBox" {if $search}value="{$search}"{/if} /> <a href="index.php" class="clearSearch" {if !$search}style="display: none;"{/if}>X</a> {if $javascript}<img src="images/search-loader.gif" class="searchSpinner" style="display: none;" />{/if} | ||
Chris Han | 24 | </form> | |
25 | </div> | ||
26 | |||
Chris Han | 27 | <table cellspacing="0" class="projectList"> | |
Chris Han | 28 | {foreach name=projects from=$projectlist item=proj} | |
Chris Han | 29 | {if $smarty.foreach.projects.first} | |
30 | {* Header *} | ||
31 | <tr> | ||
32 | {if $order == "project"} | ||
Chris Han | 33 | <th>{t}Project{/t}</th> | |
Chris Han | 34 | {else} | |
Chris Han | 35 | <th><a class="header" href="{$SCRIPT_NAME}?o=project">{t}Project{/t}</a></th> | |
Chris Han | 36 | {/if} | |
37 | {if $order == "descr"} | ||
Chris Han | 38 | <th>{t}Description{/t}</th> | |
Chris Han | 39 | {else} | |
Chris Han | 40 | <th><a class="header" href="{$SCRIPT_NAME}?o=descr">{t}Description{/t}</a></th> | |
Chris Han | 41 | {/if} | |
42 | {if $order == "owner"} | ||
Chris Han | 43 | <th>{t}Owner{/t}</th> | |
Chris Han | 44 | {else} | |
Chris Han | 45 | <th><a class="header" href="{$SCRIPT_NAME}?o=owner">{t}Owner{/t}</a></th> | |
Chris Han | 46 | {/if} | |
47 | {if $order == "age"} | ||
Chris Han | 48 | <th>{t}Last Change{/t}</th> | |
Chris Han | 49 | {else} | |
Chris Han | 50 | <th><a class="header" href="{$SCRIPT_NAME}?o=age">{t}Last Change{/t}</a></th> | |
Chris Han | 51 | {/if} | |
Chris Han | 52 | <th>{t}Actions{/t}</th> | |
Chris Han | 53 | </tr> | |
54 | {/if} | ||
Chris Han | 55 | ||
Chris Han | 56 | {if $currentcategory != $proj->GetCategory()} | |
57 | {assign var=currentcategory value=$proj->GetCategory()} | ||
Chris Han | 58 | {if $currentcategory != ''} | |
Chris Han | 59 | <tr class="light categoryRow"> | |
60 | <th class="categoryName">{$currentcategory}</th> | ||
Chris Han | 61 | <th></th> | |
62 | <th></th> | ||
63 | <th></th> | ||
64 | <th></th> | ||
Chris Han | 65 | </tr> | |
Chris Han | 66 | {/if} | |
Chris Han | 67 | {/if} | |
68 | |||
Chris Han | 69 | <tr class="{cycle values="light,dark"} projectRow"> | |
70 | <td class="projectName"> | ||
Christian Weiske | 71 | <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary" class="list {if $currentcategory != ''}indent{/if}">{$proj->GetProject()}</a> | |
Chris Han | 72 | </td> | |
Chris Han | 73 | <td class="projectDescription"><a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary" class="list">{$proj->GetDescription()}</a></td> | |
74 | <td class="projectOwner"><em>{$proj->GetOwner()}</em></td> | ||
75 | <td class="projectAge"> | ||
Chris Han | 76 | {assign var=projecthead value=$proj->GetHeadCommit()} | |
Chris Han | 77 | {if $projecthead} | |
78 | {if $projecthead->GetAge() < 7200} {* 60*60*2, or 2 hours *} | ||
79 | <span class="agehighlight"><strong><em>{$projecthead->GetAge()|agestring}</em></strong></span> | ||
80 | {elseif $projecthead->GetAge() < 172800} {* 60*60*24*2, or 2 days *} | ||
81 | <span class="agehighlight"><em>{$projecthead->GetAge()|agestring}</em></span> | ||
82 | {else} | ||
83 | <em>{$projecthead->GetAge()|agestring}</em> | ||
84 | {/if} | ||
85 | {/if} | ||
Chris Han | 86 | </td> | |
87 | <td class="link"> | ||
Christian Weiske | 88 | <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary">{t}summary{/t}</a> | |
Chris Han | 89 | {if $projecthead} | |
90 | | | ||
Christian Weiske | 91 | <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=shortlog">{t}shortlog{/t}</a> | | |
92 | <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=log">{t}log{/t}</a> | | ||
93 | <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=tree">{t}tree{/t}</a> | | ||
Chris Han | 94 | <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=snapshot&h=HEAD" class="snapshotTip">{t}snapshot{/t}</a> | |
Chris Han | 95 | {/if} | |
Chris Han | 96 | </td> | |
97 | </tr> | ||
98 | {foreachelse} | ||
Chris Han | 99 | <div class="message">{t}No projects found{/t}</div> | |
Chris Han | 100 | {/foreach} | |
101 | |||
102 | </table> | ||
Chris Han | 103 | ||
104 | {include file='footer.tpl'} | ||
105 | |||
106 |