Adjust projects slightly
Adjust projects slightly

--- a/include/display.git_project_list.php
+++ b/include/display.git_project_list.php
@@ -37,8 +37,8 @@
 						usort($projects,"agecmp");
 						break;
 				}
+				$tpl->assign("projects",$projects);
 			} else {
-				$tpl->assign("categorized",TRUE);
 				foreach ($projects as $cat => $plist) {
 					switch ($order) {
 						case "project":
@@ -55,13 +55,13 @@
 							break;
 					}
 				}
+				$tpl->assign("categorizedprojects",$projects);
 			}
-			$tpl->assign("projects",$projects);
 		} else
 			$tpl->assign("errmsg","No projects found");
 	} else
 		$tpl->assign("errmsg",$projects);
-	$tpl->display("projlist.tpl");
+	$tpl->display("projectlist.tpl");
 }
 
 ?>

--- /dev/null
+++ b/templates/projectlist.tpl
@@ -1,1 +1,99 @@
+{*
+ *  projectlist.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Project list template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+{if $errmsg}
+  {* Something is wrong; display an error message instead of trying to list *}
+  {$errmsg}
+{else}
+  <table cellspacing="0">
+    {* Header *}
+    <tr>
+      {if $order == "project"}
+        <th>Project</th>
+      {else}
+        <th><a class="header" href="{$SCRIPT_NAME}?o=project">Project</a></th>
+      {/if}
+      {if $order == "descr"}
+        <th>Description</th>
+      {else}
+        <th><a class="header" href="{$SCRIPT_NAME}?o=descr">Description</a></th>
+      {/if}
+      {if $order == "owner"}
+        <th>Owner</th>
+      {else}
+        <th><a class="header" href="{$SCRIPT_NAME}?o=owner">Owner</a></th>
+      {/if}
+      {if $order == "age"}
+        <th>Last Change</th>
+      {else}
+        <th><a class="header" href="{$SCRIPT_NAME}?o=age">Last Change</a></th>
+      {/if}
+      <th>Actions</th>
+    </tr>
 
+    {if $categorizedprojects}
+      {* Show categorized; categorized project lists nested associatively in the project
+         list by category key *}
+      {foreach from=$categorizedprojects key=categ item=plist}
+        {if $categ != "none"}
+          <tr>
+            <th>{$categ}</th>
+            <th></th>
+            <th></th>
+            <th></th>
+            <th></th>
+          </tr>
+	{/if}
+        {section name=proj loop=$plist}
+          <tr class="{cycle values="light,dark"}">
+            <td>
+              <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=summary" class="list {if $categ != "none"}indent{/if}">{$plist[proj].project}</a>
+            </td>
+            <td>{$plist[proj].descr}</td>
+            <td><i>{$plist[proj].owner}</i></td>
+            <td>
+              {if $plist[proj].age < 7200}   {* 60*60*2, or 2 hours *}
+                <span class="agehighlight"><b><i>{$plist[proj].age_string}</i></b></span>
+	      {elseif $plist[proj].age < 172800}   {* 60*60*24*2, or 2 days *}
+                <span class="agehighlight"><i>{$plist[proj].age_string}</i></span>
+              {else}
+                <i>{$plist[proj].age_string}</i>
+              {/if}
+            </td>
+            <td class="link"><a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=tree">tree</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=snapshot&h=HEAD">snapshot</a></td>
+          </tr>
+        {/section}
+      {/foreach}
+
+    {else}
+      
+      {* Show flat uncategorized project array *}
+      {section name=proj loop=$projects}
+        <tr class="{cycle values="light,dark"}">
+          <td>
+            <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=summary" class="list">{$projects[proj].project}</a>
+          </td>
+          <td>{$projects[proj].descr}</td>
+          <td><i>{$projects[proj].owner}</i></td>
+          <td>
+            {if $projects[proj].age < 7200}   {* 60*60*2, or 2 hours *}
+              <span class="agehighlight"><b><i>{$projects[proj].age_string}</i></b></span>
+	    {elseif $projects[proj].age < 172800}   {* 60*60*24*2, or 2 days *}
+              <span class="agehighlight"><i>{$projects[proj].age_string}</i></span>
+	    {else}
+              <i>{$projects[proj].age_string}</i>
+            {/if}
+          </td>
+          <td class="link"><a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=tree">tree</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=snapshot&h=HEAD">snapshot</a></td>
+        </tr>
+      {/section}
+
+    {/if}
+
+  </table>
+{/if}
+

file:a/templates/projlist.tpl (deleted)
--- a/templates/projlist.tpl
+++ /dev/null
@@ -1,99 +1,1 @@
-{*
- *  projlist.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project list template
- *
- *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
- *}
-{if $errmsg}
-  {* Something is wrong; display an error message instead of trying to list *}
-  {$errmsg}
-{else}
-  <table cellspacing="0">
-    {* Header *}
-    <tr>
-      {if $order == "project"}
-        <th>Project</th>
-      {else}
-        <th><a class="header" href="{$SCRIPT_NAME}?o=project">Project</a></th>
-      {/if}
-      {if $order == "descr"}
-        <th>Description</th>
-      {else}
-        <th><a class="header" href="{$SCRIPT_NAME}?o=descr">Description</a></th>
-      {/if}
-      {if $order == "owner"}
-        <th>Owner</th>
-      {else}
-        <th><a class="header" href="{$SCRIPT_NAME}?o=owner">Owner</a></th>
-      {/if}
-      {if $order == "age"}
-        <th>Last Change</th>
-      {else}
-        <th><a class="header" href="{$SCRIPT_NAME}?o=age">Last Change</a></th>
-      {/if}
-      <th>Actions</th>
-    </tr>
 
-    {if $categorized}
-      {* Show categorized; categorized project lists nested associatively in the project
-         list by category key *}
-      {foreach from=$projects key=categ item=plist}
-        {if $categ != "none"}
-          <tr>
-            <th>{$categ}</th>
-            <th></th>
-            <th></th>
-            <th></th>
-            <th></th>
-          </tr>
-	{/if}
-        {section name=proj loop=$plist}
-          <tr class="{cycle values="light,dark"}">
-            <td>
-              <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=summary" class="list {if $categ != "none"}indent{/if}">{$plist[proj].project}</a>
-            </td>
-            <td>{$plist[proj].descr}</td>
-            <td><i>{$plist[proj].owner}</i></td>
-            <td>
-              {if $plist[proj].age < 7200}   {* 60*60*2, or 2 hours *}
-                <span class="agehighlight"><b><i>{$plist[proj].age_string}</i></b></span>
-	      {elseif $plist[proj].age < 172800}   {* 60*60*24*2, or 2 days *}
-                <span class="agehighlight"><i>{$plist[proj].age_string}</i></span>
-              {else}
-                <i>{$plist[proj].age_string}</i>
-              {/if}
-            </td>
-            <td class="link"><a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=tree">tree</a> | <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=snapshot&h=HEAD">snapshot</a></td>
-          </tr>
-        {/section}
-      {/foreach}
-
-    {else}
-      
-      {* Show flat uncategorized project array *}
-      {section name=proj loop=$projects}
-        <tr class="{cycle values="light,dark"}">
-          <td>
-            <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=summary" class="list">{$projects[proj].project}</a>
-          </td>
-          <td>{$projects[proj].descr}</td>
-          <td><i>{$projects[proj].owner}</i></td>
-          <td>
-            {if $projects[proj].age < 7200}   {* 60*60*2, or 2 hours *}
-              <span class="agehighlight"><b><i>{$projects[proj].age_string}</i></b></span>
-	    {elseif $projects[proj].age < 172800}   {* 60*60*24*2, or 2 days *}
-              <span class="agehighlight"><i>{$projects[proj].age_string}</i></span>
-	    {else}
-              <i>{$projects[proj].age_string}</i>
-            {/if}
-          </td>
-          <td class="link"><a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=tree">tree</a> | <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=snapshot&h=HEAD">snapshot</a></td>
-        </tr>
-      {/section}
-
-    {/if}
-
-  </table>
-{/if}
-

comments