Fixes to blame
[gitphp.git] / templates / blame.tpl
blob:a/templates/blame.tpl -> blob:b/templates/blame.tpl
--- a/templates/blame.tpl
+++ b/templates/blame.tpl
@@ -5,51 +5,36 @@
  *
  * Copyright (C) 2010 Christopher Han <xiphux@gmail.com>
  *}
-
- {include file='header.tpl'}
+{include file='header.tpl'}
 
  <div class="page_nav">
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=summary">summary</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=shortlog">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=log">log</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$hashbase->GetHash()}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commitdiff&h={$hashbase->GetHash()}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&h={$tree->GetHash()}&hb={$hashbase->GetHash()}">tree</a><br />
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blob_plain&h={$hash->GetHash()}&f={$hash->GetPath()}">plain</a> | 
-   {if $hashbase->GetHash() != $head->GetHash()}
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blame&hb=HEAD&f={$hash->GetPath()}">HEAD</a>
+   {include file='nav.tpl' treecommit=$commit}
+   <br />
+   <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blob_plain&amp;h={$blob->GetHash()}&amp;f={$blob->GetPath()}">{t}plain{/t}</a> | 
+   {if $commit->GetHash() != $head->GetHash()}
+     <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=blame&amp;hb=HEAD&amp;f={$blob->GetPath()}">{t}HEAD{/t}</a>
    {else}
-     HEAD
+     {t}HEAD{/t}
    {/if}
     | blame
    <br />
  </div>
- <div class="title">
-   <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$hashbase->GetHash()}" class="title">{$hashbase->GetTitle()}</a>
-   <span class="refs">
-   {foreach from=$hashbase->GetHeads() item=hashhead}
-     <span class="head">
-       <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=shortlog&h=refs/heads/{$hashhead->GetName()}">{$hashhead->GetName()}</a>
-     </span>
-   {/foreach}
-   {foreach from=$hashbase->GetTags() item=hashtag}
-     <span class="tag">
-       <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tag&h={$hashtag->GetName()}">{$hashtag->GetName()}</a>
-     </span>
-   {/foreach}
-   </span>
- </div>
- <div class="page_path">
-   {* The path to the file, with directories broken into tree links *}
-   <b>
-     <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&hb={$hashbase->GetHash()}&h={$hashbase->GetHash()}">[{$project->GetProject()}]</a> / 
-     {foreach from=$paths item=path name=paths}
-       {if $smarty.foreach.paths.last}
-         <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=blob_plain&h={$path.tree}&f={$path.full}">{$path.short}</a>
-       {else}
-         <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=tree&hb={$hashbase->GetHash()}&h={$path.tree}&f={$path.full}">{$path.short}</a> / 
-       {/if}
-     {/foreach}
-   </b>
- </div>
+
+ {include file='title.tpl' titlecommit=$commit}
+
+ {include file='path.tpl' pathobject=$blob target='blob'}
+ 
  <div class="page_body">
+   {if $geshi}
+     {$geshihead}
+       <td class="ln de1" id="blameData">
+        {include file='blamedata.tpl'}
+       </td>
+     {$geshibody}
+     {$geshifoot}
+   {else}
  	<table class="code">
-	{foreach from=$hash->GetData(true) item=blobline name=blob}
+	{foreach from=$blob->GetData(true) item=blobline name=blob}
 	  {assign var=blamecommit value=$blame[$smarty.foreach.blob.iteration]}
 	  {if $blamecommit}
 	    {cycle values="light,dark" assign=rowclass}
@@ -57,7 +42,7 @@
 	  <tr class="{$rowclass}">
 	    <td class="date">
 	      {if $blamecommit}
-	        <a href="{$SCRIPT_NAME}?p={$project->GetProject()}&a=commit&h={$blamecommit->GetHash()}" title="{$blamecommit->GetTitle()}">{$blamecommit->GetAuthorEpoch()|date_format:"%F %X"}</a>
+	        <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&amp;a=commit&amp;h={$blamecommit->GetHash()}" title="{$blamecommit->GetTitle()}" class="commitTip">{$blamecommit->GetAuthorEpoch()|date_format:"%Y-%m-%d %H:%M:%S"}</a>
 	      {/if}
 	    </td>
 	    <td class="author">
@@ -70,6 +55,7 @@
 	  </tr>
 	{/foreach}
 	</table>
+  {/if}
  </div>
 
  {include file='footer.tpl'}

comments