Switch to gettext for i18n
[gitphp.git] / templates / projectlist.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{*
 *  projectlist.tpl
 *  gitphp: A PHP git repository browser
 *  Component: Project list template
 *
 *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
 *}

{include file='header.tpl'}

{include file='hometext.tpl'}

<table cellspacing="0">
  {foreach name=projects from=$projectlist item=proj}
    {if $smarty.foreach.projects.first}
      {* Header *}
      <tr>
        {if $order == "project"}
          <th>{$resources->GetResource('Project', 'Header')}</th>
        {else}
          <th><a class="header" href="{$SCRIPT_NAME}?o=project">{$resources->GetResource('Project', 'Header')}</a></th>
        {/if}
        {if $order == "descr"}
          <th>{$resources->GetResource('Description', 'Header')}</th>
        {else}
          <th><a class="header" href="{$SCRIPT_NAME}?o=descr">{$resources->GetResource('Description', 'Header')}</a></th>
        {/if}
        {if $order == "owner"}
          <th>{$resources->GetResource('Owner', 'Header')}</th>
        {else}
          <th><a class="header" href="{$SCRIPT_NAME}?o=owner">{$resources->GetResource('Owner', 'Header')}</a></th>
        {/if}
        {if $order == "age"}
          <th>{$resources->GetResource('Last Change', 'Header')}</th>
        {else}
          <th><a class="header" href="{$SCRIPT_NAME}?o=age">{$resources->GetResource('Last Change', 'Header')}</a></th>
        {/if}
        <th>{$resources->GetResource('Actions', 'Header')}</th>
      </tr>
    {/if}

    {if $currentcategory != $proj->GetCategory()}
      {assign var=currentcategory value=$proj->GetCategory()}
      {if $currentcategory != ''}
        <tr class="light">
          <th>{$currentcategory}</th>
          <th></th>
          <th></th>
          <th></th>
          <th></th>
        </tr>
      {/if}
    {/if}

    <tr class="{cycle values="light,dark"}">
      <td>
        <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary" class="list {if $currentcategory != ''}indent{/if}">{$proj->GetProject()}</a>
      </td>
      <td><a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary" class="list">{$proj->GetDescription()}</a></td>
      <td><em>{$proj->GetOwner()}</em></td>
      <td>
        {assign var=projecthead value=$proj->GetHeadCommit()}
	{if $projecthead}
          {if $projecthead->GetAge() < 7200}   {* 60*60*2, or 2 hours *}
            <span class="agehighlight"><strong><em>{$projecthead->GetAge()|agestring}</em></strong></span>
          {elseif $projecthead->GetAge() < 172800}   {* 60*60*24*2, or 2 days *}
            <span class="agehighlight"><em>{$projecthead->GetAge()|agestring}</em></span>
          {else}
            <em>{$projecthead->GetAge()|agestring}</em>
          {/if}
	{/if}
      </td>
      <td class="link">
        <a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=summary">{$resources->GetResource('summary')}</a>
	{if $projecthead}
	| 
	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=shortlog">{$resources->GetResource('shortlog')}</a> | 
	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=log">{$resources->GetResource('log')}</a> | 
	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=tree">{$resources->GetResource('tree')}</a> | 
	<a href="{$SCRIPT_NAME}?p={$proj->GetProject()|urlencode}&a=snapshot&h=HEAD">{$resources->GetResource('snapshot')}</a>
	{/if}
      </td>
    </tr>
  {foreachelse}
    <div class="message">No projects found</div>
  {/foreach}

</table>

{include file='footer.tpl'}


comments