Unify tags template
Unify tags template

--- a/include/display.git_tags.php
+++ b/include/display.git_tags.php
@@ -17,32 +17,11 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("head",$head);
-	$tpl->display("tags_nav.tpl");
-	$tpl->display("tags_header.tpl");
 	$taglist = git_read_refs($projectroot, $project, "refs/tags");
 	if (isset($taglist) && (count($taglist) > 0)) {
-		$alternate = FALSE;
-		foreach ($taglist as $i => $entry) {
-			$tpl->clear_all_assign();
-			if ($alternate)
-				$tpl->assign("class","dark");
-			else
-				$tpl->assign("class","light");
-			$alternate = !$alternate;
-			$tpl->assign("project",$project);
-			$tpl->assign("age",$entry['age']);
-			$tpl->assign("name",$entry['name']);
-			$tpl->assign("reftype",$entry['reftype']);
-			$tpl->assign("refid",$entry['refid']);
-			$tpl->assign("id",$entry['id']);
-			$tpl->assign("type",$entry['type']);
-			if (isset($entry['comment']) && isset($entry['comment'][0]))
-				$tpl->assign("comment",$entry['comment'][0]);
-			$tpl->display("tags_item.tpl");
-		}
+		$tpl->assign("taglist",$taglist);
 	}
-	$tpl->clear_all_assign();
-	$tpl->display("tags_footer.tpl");
+	$tpl->display("tags.tpl");
 }
 
 ?>

--- /dev/null
+++ b/templates/tags.tpl
@@ -1,1 +1,39 @@
+{*
+ *  tags.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Tag view template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+ {* Nav *}
+ <div class="page_nav">
+   <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$head}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$head}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$head}">tree</a>
+   <br /><br />
+ </div>
+ <div>
+   <a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp;</a>
+ </div>
+ {* Display tags *}
+ <table cellspacing="0">
+   {section name=tag loop=$taglist}
+     <tr class="{cycle values="light,dark"}">
+       <td><i>{$taglist[tag].age}</i></td>
+       <td><a href="{$SCRIPT_NAME}?p={$project}&a={$taglist[tag].reftype}&h={$taglist[tag].refid}" class="list"><b>{$taglist[tag].name}</b></a></td>
+       <td>
+         {if count($taglist[tag].comment) > 0}
+           <a href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$taglist[tag].id}" class="list">{$taglist[tag].comment[0]}</a>
+         {/if}
+       </td>
+       <td class="link">
+         {if $taglist[tag].type == "tag"}
+	   <a href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$taglist[tag].id}">tag</a> | 
+	 {/if}
+	 <a href="{$SCRIPT_NAME}?p={$project}&a={$taglist[tag].reftype}&h={$taglist[tag].refid}">{$taglist[tag].reftype}</a>
+	 {if $taglist[tag].reftype == "commit"}
+	   | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/tags/{$taglist[tag].name}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/tags/{$taglist[tag].name}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$taglist[tag].refid}">snapshot</a>
+	 {/if}
+       </td>
+     </tr>
+   {/section}
+ </table>
 

--- a/templates/tags_footer.tpl
+++ /dev/null
@@ -1,9 +1,1 @@
-{*
- *  tags_footer.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Tag view footer template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- </table>
 

--- a/templates/tags_header.tpl
+++ /dev/null
@@ -1,10 +1,1 @@
-{*
- *  tags_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Tag view header template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div><a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp;</a></div>
- <table cellspacing="0">
 

file:a/templates/tags_item.tpl (deleted)
--- a/templates/tags_item.tpl
+++ /dev/null
@@ -1,20 +1,1 @@
-{*
- *  tags_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Tag view item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <tr class="{$class}">
- <td><i>{$age}</i></td>
- <td><a href="{$SCRIPT_NAME}?p={$project}&a={$reftype}&h={$refid}" class="list"><b>{$name}</b></a></td>
- <td>
- {if $comment}
- <a href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$id}" class="list">{$comment}</a>
- {/if}
- </td>
- <td class="link">
- {if $type == "tag"}<a href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$id}">tag</a> | {/if}<a href="{$SCRIPT_NAME}?p={$project}&a={$reftype}&h={$refid}">{$reftype}</a>{if $reftype == "commit"} | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/tags/{$name}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/tags/{$name}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$refid}">snapshot</a>{/if}
- </td>
- </tr>
 

file:a/templates/tags_nav.tpl (deleted)
--- a/templates/tags_nav.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  tags_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Tag view nav template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div class="page_nav">
- <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$head}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$head}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$head}">tree</a>
- <br /><br />
- </div>
 

comments