Unify tag template
Unify tag template

--- a/include/display.git_tag.php
+++ b/include/display.git_tag.php
@@ -19,26 +19,16 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("head",$head);
-	$tpl->display("tag_nav.tpl");
+	$tpl->assign("hash", $hash);
 
 	$tag = git_read_tag($projectroot . $project, $hash);
 
-	$tpl->clear_all_assign();
-	$tpl->assign("project", $project);
-	$tpl->assign("hash", $hash);
-	$tpl->assign("title",$tag['name']);
-	$tpl->assign("type",$tag['type']);
-	$tpl->assign("object",$tag['object']);
+	$tpl->assign("tag",$tag);
 	if (isset($tag['author'])) {
-		$tpl->assign("author",$tag['author']);
 		$ad = date_str($tag['epoch'],$tag['tz']);
-		$tpl->assign("adrfc2822",$ad['rfc2822']);
-		$tpl->assign("adhourlocal",$ad['hour_local']);
-		$tpl->assign("adminutelocal",$ad['minute_local']);
-		$tpl->assign("adtzlocal",$ad['tz_local']);
+		$tpl->assign("datedata",$ad);
 	}
-	$tpl->assign("comment",$tag['comment']);
-	$tpl->display("tag_data.tpl");
+	$tpl->display("tag.tpl");
 }
 
 ?>

file:b/templates/tag.tpl (new)
--- /dev/null
+++ b/templates/tag.tpl
@@ -1,1 +1,42 @@
+{*
+ *  tag.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>
+ {* Tag data *}
+ <div>
+   <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$tag.name}</a>
+ </div>
+ <div class="title_text">
+   <table cellspacing="0">
+     <tr>
+       <td>object</td>
+       <td class="monospace"><a href="{$SCRIPT_NAME}?p={$project}&a={$tag.type}&h={$tag.object}" class="list">{$tag.object}</a></td>
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a={$tag.type}&h={$tag.object}">{$tag.type}</a></td>
+     </tr>
+     {if $tag.author}
+       <tr>
+         <td>author</td>
+	 <td>{$tag.author}</td>
+       </tr>
+       <tr>
+         <td></td>
+	 <td> {$datedata.rfc2822} ({if $datedata.hour_local < 6}<span class="latenight">{/if}{$datedata.hour_local}:{$datedata.minute_local}{if $datedata.hour_local < 6}</span>{/if} {$datedata.tz_local})
+         </td>
+       </tr>
+     {/if}
+   </table>
+ </div>
+ <div class="page_body">
+   {foreach from=$tag.comment item=line}
+     {$line}<br />
+   {/foreach}
+ </div>
 

file:a/templates/tag_data.tpl (deleted)
--- a/templates/tag_data.tpl
+++ /dev/null
@@ -1,26 +1,1 @@
-{*
- *  tag_data.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Tag view data template
- *
- *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
- *}
- <div>
-   <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}</a>
- </div>
- <div class="title_text">
- <table cellspacing="0">
- <tr><td>object</td><td class="monospace"><a href="{$SCRIPT_NAME}?p={$project}&a={$type}&h={$object}" class="list">{$object}</a></td><td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a={$type}&h={$object}">{$type}</a></td></tr>
- {if $author}
- <tr><td>author</td><td>{$author}</td></tr>
- <tr><td></td><td> {$adrfc2822} ({if $adhourlocal < 6}<span class="latenight">{/if}{$adhourlocal}:{$adminutelocal}{if $adhourlocal < 6}</span>{/if} {$adtzlocal})
- </td></tr>
- {/if}
- </table>
- </div>
- <div class="page_body">
- {foreach from=$comment item=line}
- {$line}<br />
- {/foreach}
- </div>
 

file:a/templates/tag_nav.tpl (deleted)
--- a/templates/tag_nav.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  tag_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Tag navbar template
- *
- *  Copyright (C) 2009 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