Break into tree links on blobdiff page
Break into tree links on blobdiff page

--- a/include/display.git_blobdiff.php
+++ b/include/display.git_blobdiff.php
@@ -10,6 +10,7 @@
  require_once('util.prep_tmpdir.php');
  require_once('gitutil.git_read_commit.php');
  require_once('gitutil.read_info_ref.php');
+ require_once('gitutil.git_path_trees.php');
  require_once('display.git_diff_print.php');
 
 function git_blobdiff($projectroot,$project,$hash,$hashbase,$hashparent,$file)
@@ -46,6 +47,8 @@
 	$tpl->assign("hashparent",$hashparent);
 	$tpl->assign("hashbase",$hashbase);
 	$tpl->assign("hash",$hash);
+	$paths = git_path_trees($projectroot . $project, $hashbase, $file);
+	$tpl->assign("paths",$paths);
 	$tpl->display("blobdiff_header.tpl");
 	git_diff_print($projectroot . $project, $hashparent,($file?$file:$hashparent),$hash,($file?$file:$hash));
 	$tpl->clear_all_assign();

--- a/templates/blobdiff_header.tpl
+++ b/templates/blobdiff_header.tpl
@@ -5,9 +5,7 @@
  *
  *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
  *}
- {if $file}
- <div class="page_path"><b>/{$file}</b></div>
- {/if}
+ <div class="page_path"><b><a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hashbase}&h={$hashbase}">[{$project}]</a> / {foreach from=$paths item=path name=paths}{if $smarty.foreach.paths.last}<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$path.tree}&hb={$hashbase}&f={$path.full}">{$path.short}</a>{else}<a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hashbase}&h={$path.tree}&f={$path.full}">{$path.short}</a> / {/if}{/foreach}</b></div>
  <div class="page_body">
  <div class="diff_info">blob:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hashparent}&hb={$hashbase}&f={$file}">{if $file}a/{$file}{else}{$hashparent}{/if}</a> -&gt; blob:<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hash}&hb={$hashbase}&f={$file}">{if $file}b/{$file}{else}{$hash}{/if}</a></div>
 

comments