No longer used
No longer used

file:a/gitphp.css -> file:b/gitphp.css
--- a/gitphp.css
+++ b/gitphp.css
@@ -105,4 +105,17 @@
 div.error {
 	color: #ff0000;
 }
+.indent {
+	margin-left: 8px;
+}
+table.code td {
+	padding: 0px 0px;
+	font-family:monospace; font-size:12px; white-space:pre;
+}
+table.code td.num {
+	text-align: right;
+}
+table.code td.codeline {
+	padding-left: 5px;
+}
 

--- a/include/display.git_blob.php
+++ b/include/display.git_blob.php
@@ -63,6 +63,7 @@
 					if (isset($lang) && (strlen($lang) > 0)) {
 						$geshi->set_source($catout);
 						$geshi->set_language($lang);
+						$geshi->set_header_type(GESHI_HEADER_DIV);
 						$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
 						$tpl->assign("geshiout",$geshi->parse_code());
 						$usedgeshi = TRUE;

--- a/include/display.git_commitdiff_plain.php
+++ b/include/display.git_commitdiff_plain.php
@@ -14,7 +14,7 @@
  require_once('gitutil.git_diff_tree.php');
  require_once('gitutil.git_rev_list.php');
  require_once('gitutil.read_info_ref.php');
- require_once('display.git_diff_print.php');
+ require_once('gitutil.git_diff.php');
 
 function git_commitdiff_plain($projectroot,$project,$hash,$hash_parent)
 {
@@ -50,18 +50,19 @@
 		$tpl->assign("tagname",$tagname);
 	$tpl->assign("url",script_url() . "?p=" . $project . "&a=commitdiff&h=" . $hash);
 	$tpl->assign("comment",$co['comment']);
-	$tpl->display("diff_plaintext.tpl");
-	echo "\n\n";
+	$diffs = array();
 	foreach ($difftree as $i => $line) {
 		if (ereg("^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$",$line,$regs)) {
 			if ($regs[5] == "A")
-				git_diff_print($projectroot . $project, null, "/dev/null", $regs[4], "b/" . $regs[6], "plain");
+				$diffs[] = git_diff($projectroot . $project, null, "/dev/null", $regs[4], "b/" . $regs[6]);
 			else if ($regs[5] == "D")
-				git_diff_print($projectroot . $project, $regs[3], "a/" . $regs[6], null, "/dev/null", "plain");
+				$diffs[] = git_diff($projectroot . $project, $regs[3], "a/" . $regs[6], null, "/dev/null");
 			else if ($regs[5] == "M")
-				git_diff_print($projectroot . $project, $regs[3], "a/" . $regs[6], $regs[4], "b/" . $regs[6], "plain");
+				$diffs[] = git_diff($projectroot . $project, $regs[3], "a/" . $regs[6], $regs[4], "b/" . $regs[6]);
 		}
 	}
+	$tpl->assign("diffs",$diffs);
+	$tpl->display("diff_plaintext.tpl");
 }
 
 ?>

--- a/include/display.git_diff_print.php
+++ /dev/null
@@ -1,52 +1,1 @@
-<?php
-/*
- *  display.git_diff_print.php
- *  gitphp: A PHP git repository browser
- *  Component: Display - print a diff
- *
- *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
- */
 
- require_once('gitutil.git_diff.php');
-
-function git_diff_print($proj,$from,$from_name,$to,$to_name,$format = "html")
-{
-	global $tpl;
-	$diffout = git_diff($proj, $from, $from_name, $to, $to_name);
-	if ($format == "plain")
-		echo $diffout;
-	else {
-		$line = strtok($diffout,"\n");
-		while ($line !== false) {
-			$start = substr($line,0,1);
-			unset($class);
-			if ($start == "+")
-				$class = "diffplus";
-			else if ($start == "-")
-				$class = "diffminus";
-			else if ($start == "@")
-				$class = "diffat";
-			if ($start != "\\") {
-			/*
-				while (($pos = strpos($line,"\t")) !== false) {
-					if ($c = (8 - (($pos - 1) % 8))) {
-						$spaces = "";
-						for ($i = 0; $i < $c; $i++)
-							$spaces .= " ";
-						preg_replace('/\t/',$spaces,$line,1);
-					}
-				}
-			 */
-				$tpl->clear_all_assign();
-				$tpl->assign("line",htmlentities($line));
-				if (isset($class))
-					$tpl->assign("class",$class);
-				$tpl->display("diff_line.tpl");
-			}
-			$line = strtok("\n");
-		}
-	}
-}
-
-?>
-

--- a/include/display.git_heads.php
+++ b/include/display.git_heads.php
@@ -17,26 +17,9 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("head",$head);
-	$tpl->display("heads_nav.tpl");
-	$tpl->display("heads_header.tpl");
-	$taglist = git_read_refs($projectroot, $project, "refs/heads");
-	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->display("heads_item.tpl");
-		}
-	}
-	$tpl->clear_all_assign();
-	$tpl->display("heads_footer.tpl");
+	$headlist = git_read_refs($projectroot, $project, "refs/heads");
+	$tpl->assign("headlist",$headlist);
+	$tpl->display("heads.tpl");
 }
 
 ?>

--- a/include/display.git_history.php
+++ b/include/display.git_history.php
@@ -27,47 +27,38 @@
 	if (isset($refs[$hash]))
 		$tpl->assign("hashbaseref",$refs[$hash]);
 	$tpl->assign("tree",$co['tree']);
-	$tpl->display("history_nav.tpl");
 	$tpl->assign("title",$co['title']);
 	$paths = git_path_trees($projectroot . $project, $hash, $file);
 	$tpl->assign("paths",$paths);
-	$tpl->display("history_header.tpl");
 	$cmdout = git_history_list($projectroot . $project, $hash, $file);
-	$alternate = FALSE;
 	$lines = explode("\n", $cmdout);
+	$historylines = array();
 	foreach ($lines as $i => $line) {
 		if (ereg("^([0-9a-fA-F]{40})",$line,$regs))
 			$commit = $regs[1];
 		else if (ereg(":([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$",$line,$regs) && isset($commit)) {
+				$historyline = array();
 				$co = git_read_commit($projectroot . $project, $commit);
-				$tpl->clear_all_assign();
-				if ($alternate)
-					$tpl->assign("class","dark");
-				else
-					$tpl->assign("class","light");
-				$alternate = !$alternate;
-				$tpl->assign("project",$project);
-				$tpl->assign("agestringage",$co['age_string_age']);
-				$tpl->assign("agestringdate",$co['age_string_date']);
-				$tpl->assign("authorname",$co['author_name']);
-				$tpl->assign("commit",$commit);
-				$tpl->assign("file",$file);
-				$tpl->assign("title",$co['title_short']);
+				$historyline["agestringage"] = $co['age_string_age'];
+				$historyline["agestringdate"] = $co['age_string_date'];
+				$historyline["authorname"] = $co['author_name'];
+				$historyline["commit"] = $commit;
+				$historyline["file"] = $file;
+				$historyline["title"] = $co['title_short'];
 				if (isset($refs[$commit]))
-					$tpl->assign("commitref",$refs[$commit]);
+					$historyline["commitref"] = $refs[$commit];
 				$blob = git_get_hash_by_path($projectroot . $project, $hash,$file);
 				$blob_parent = git_get_hash_by_path($projectroot . $project, $commit,$file);
 				if ($blob && $blob_parent && ($blob != $blob_parent)) {
-					$tpl->assign("blob",$blob);
-					$tpl->assign("blobparent",$blob_parent);
-					$tpl->assign("difftocurrent",TRUE);
+					$historyline["blob"] = $blob;
+					$historyline["blobparent"] = $blob_parent;
 				}
-				$tpl->display("history_item.tpl");
+				$historylines[] = $historyline;
 				unset($commit);
 		}
 	}
-	$tpl->clear_all_assign();
-	$tpl->display("history_footer.tpl");
+	$tpl->assign("historylines",$historylines);
+	$tpl->display("history.tpl");
 }
 
 ?>

--- a/include/display.git_log.php
+++ b/include/display.git_log.php
@@ -25,50 +25,44 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("hash",$hash);
-	$tpl->display("log_nav.tpl");
+	$tpl->assign("head",$head);
+
+	if ($page)
+		$tpl->assign("page",$page);
 
 	$revlist = git_read_revlist($projectroot . $project, $hash, 101, ($page * 100));
 
-	if (($hash != $head) || $page)
-		$tpl->assign("headlink",TRUE);
-	if ($page > 0) {
-		$tpl->assign("prevlink",TRUE);
-		$tpl->assign("prevpage",$page-1);
-	}
-	if (count($revlist) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("log_pagenav.tpl");
+	$revlistcount = count($revlist);
+	$tpl->assign("revlistcount",$revlistcount);
 
 	if (!$revlist) {
-		$tpl->clear_all_assign();
-		$tpl->assign("project",$project);
+		$tpl->assign("norevlist",TRUE);
 		$co = git_read_commit($hash);
-		$tpl->assign("age_string",$co['age_string']);
-		$tpl->display("log_info.tpl");
+		$tpl->assign("lastchange",$co['age_string']);
 	}
-	$commitcount = min(100,count($revlist));
+
+	$commitlines = array();
+	$commitcount = min(100,$revlistcount);
 	for ($i = 0; $i < $commitcount; $i++) {
 		$commit = $revlist[$i];
 		if (isset($commit) && strlen($commit) > 1) {
-			$tpl->clear_all_assign();
+			$commitline = array();
 			$co = git_read_commit($projectroot . $project, $commit);
 			$ad = date_str($co['author_epoch']);
-			$tpl->assign("project",$project);
-			$tpl->assign("commit",$commit);
+			$commitline["project"] = $project;
+			$commitline["commit"] = $commit;
 			if (isset($refs[$commit]))
-				$tpl->assign("commitref",$refs[$commit]);
-			$tpl->assign("agestring",$co['age_string']);
-			$tpl->assign("title",$co['title']);
-			$tpl->assign("authorname",$co['author_name']);
-			$tpl->assign("rfc2822",$ad['rfc2822']);
-			$tpl->assign("comment",$co['comment']);
-			if (count($co['comment']) > 0)
-				$tpl->assign("notempty",TRUE);
-			$tpl->display("log_item.tpl");
+				$commitline["commitref"] = $refs[$commit];
+			$commitline["agestring"] = $co['age_string'];
+			$commitline["title"] = $co['title'];
+			$commitline["authorname"] = $co['author_name'];
+			$commitline["rfc2822"] = $ad['rfc2822'];
+			$commitline["comment"] = $co['comment'];
+			$commitlines[] = $commitline;
 		}
 	}
+	$tpl->assign("commitlines",$commitlines);
+	$tpl->display("log.tpl");
 }
 
 ?>

--- a/include/display.git_opml.php
+++ b/include/display.git_opml.php
@@ -9,8 +9,6 @@
 
  require_once('util.script_url.php');
  require_once('gitutil.git_read_projects.php');
- require_once('gitutil.git_read_head.php');
- require_once('gitutil.git_read_commit.php');
 
 function git_opml($projectroot,$projectlist)
 {
@@ -19,32 +17,19 @@
 	header("Content-type: text/xml; charset=UTF-8");
 	$tpl->clear_all_assign();
 	$tpl->assign("title",$gitphp_conf['title']);
-	$tpl->display("opml_header.tpl");
-	echo "\n";
+	$tpl->assign("self",script_url());
+	$opmllist = array();
 	foreach ($projlist as $cat => $plist) {
 		if (is_array($plist)) {
 			foreach ($plist as $i => $proj) {
-				$head = git_read_head($projectroot . $proj);
-				$co = git_read_commit($projectroot . $proj, $head);
-				$tpl->clear_all_assign();
-				$tpl->assign("proj",$proj);
-				$tpl->assign("self",script_url());
-				$tpl->display("opml_item.tpl");
-				echo "\n";
+				$opmllist[] = $proj;
 			}
 		} else {
-			$head = git_read_head($projectroot . $plist);
-			$co = git_read_commit($projectroot . $plist, $head);
-			$tpl->clear_all_assign();
-			$tpl->assign("proj",$plist);
-			$tpl->assign("self",script_url());
-			$tpl->display("opml_item.tpl");
-			echo "\n";
+			$opmllist[] = $plist;
 		}
 	}
-
-	$tpl->clear_all_assign();
-	$tpl->display("opml_footer.tpl");
+	$tpl->assign("opmllist",$opmllist);
+	$tpl->display("opml.tpl");
 }
 
 ?>

--- a/include/display.git_project_list.php
+++ b/include/display.git_project_list.php
@@ -11,19 +11,17 @@
  require_once('util.descrcmp.php');
  require_once('util.ownercmp.php');
  require_once('util.agecmp.php');
- require_once('display.git_project_listentry.php');
  require_once('gitutil.git_read_projects.php');
 
 function git_project_list($projectroot,$projectlist,$order = "project")
 {
 	global $tpl,$git_projects;
-	$projects = git_read_projects($projectroot,$projectlist);
+	$projects = git_read_projects($projectroot,$projectlist, TRUE);
 	if (is_array($projects)) {
 		if (count($projects) > 0) {
 			$tpl->clear_all_assign();
 			if ($order)
 				$tpl->assign("order",$order);
-			$tpl->display("projlist_header.tpl");
 			if (!isset($git_projects)) {
 				switch ($order) {
 					case "project":
@@ -39,46 +37,31 @@
 						usort($projects,"agecmp");
 						break;
 				}
+				$tpl->assign("projects",$projects);
+			} else {
+				foreach ($projects as $cat => $plist) {
+					switch ($order) {
+						case "project":
+							usort($projects[$cat],"projectcmp");
+							break;
+						case "descr":
+							usort($projects[$cat],"descrcmp");
+							break;
+						case "owner":
+							usort($projects[$cat],"ownercmp");
+							break;
+						case "age":
+							usort($projects[$cat],"agecmp");
+							break;
+					}
+				}
+				$tpl->assign("categorizedprojects",$projects);
 			}
-			$alternate = false;
-			foreach ($projects as $cat => $plist) {
-				if (is_array($plist)) {
-					if ($cat != "none") {
-						$tpl->clear_all_assign();
-						$tpl->assign("category",$cat);
-						$tpl->display("projlist_category.tpl");
-					}
-					if (isset($git_projects)) {
-						switch ($order) {
-							case "project":
-								usort($plist,"projectcmp");
-								break;
-							case "descr":
-								usort($plist,"descrcmp");
-								break;
-							case "owner":
-								usort($plist,"ownercmp");
-								break;
-							case "age":
-								usort($plist,"agecmp");
-								break;
-						}
-					}
-					foreach ($plist as $i => $proj) {
-						git_project_listentry($projectroot,$proj,($alternate?"dark":"light"),($cat=="none"?FALSE:TRUE));
-						$alternate = !$alternate;
-					}
-				} else {
-					git_project_listentry($projectroot,$plist,($alternate?"dark":"light"),FALSE);
-					$alternate = !$alternate;
-				}
-			}
-			$tpl->clear_all_assign();
-			$tpl->display("projlist_footer.tpl");
 		} else
-			echo "No projects found";
+			$tpl->assign("errmsg","No projects found");
 	} else
-		echo $projects;
+		$tpl->assign("errmsg",$projects);
+	$tpl->display("projectlist.tpl");
 }
 
 ?>

--- a/include/display.git_project_listentry.php
+++ /dev/null
@@ -1,36 +1,1 @@
-<?php
-/*
- *  display.git_project_listentry.php
- *  gitphp: A PHP git repository browser
- *  Component: Display - single project list item
- *
- *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
- */
 
- require_once('gitutil.git_project_descr.php');
- require_once('gitutil.git_project_owner.php');
- require_once('gitutil.git_read_head.php');
- require_once('gitutil.git_read_commit.php');
-
-function git_project_listentry($projectroot,$project,$class,$indent)
-{
-	global $tpl;
-	$tpl->clear_all_assign();
-	$tpl->assign("class",$class);
-	$tpl->assign("project",$project);
-	$tpl->assign("descr",git_project_descr($projectroot,$project,TRUE));
-	$tpl->assign("owner",git_project_owner($projectroot,$project));
-	if ($indent)
-		$tpl->assign("idt",TRUE);
-	$head = git_read_head($projectroot . $project);
-	$commit = git_read_commit($projectroot . $project,$head);
-	if ($commit['age'] < 60*60*24*2)
-		$tpl->assign("age_colored",TRUE);
-	if ($commit['age'] < 60*60*2)
-		$tpl->assign("age_bold",TRUE);
-	$tpl->assign("age_string",$commit['age_string']);
-	$tpl->display("projlist_item.tpl");
-}
-
-?>
-

--- a/include/display.git_rss.php
+++ b/include/display.git_rss.php
@@ -24,8 +24,8 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("self",script_url());
 	$tpl->assign("project",$project);
-	$tpl->display("rss_header.tpl");
 
+	$commitlines = array();
 	for ($i = 0; $i <= count($revlist); $i++) {
 		$commit = $revlist[$i];
 		$co = git_read_commit($projectroot . $project, $commit);
@@ -40,24 +40,21 @@
 				$difftree[] = $regs[7];
 			$tok = strtok("\n");
 		}
-		$tpl->clear_all_assign();
-		$tpl->assign("cdmday",$cd['mday']);
-		$tpl->assign("cdmonth",$cd['month']);
-		$tpl->assign("cdhour",$cd['hour']);
-		$tpl->assign("cdminute",$cd['minute']);
-		$tpl->assign("title",htmlentities($co['title']));
-		$tpl->assign("author",htmlentities($co['author']));
-		$tpl->assign("cdrfc2822",$cd['rfc2822']);
-		$tpl->assign("self",script_url());
-		$tpl->assign("project",$project);
-		$tpl->assign("commit",$commit);
-		$tpl->assign("comment",$co['comment']);
-		$tpl->assign("difftree",$difftree);
-		$tpl->display("rss_item.tpl");
+		$commitline = array();
+		$commitline["cdmday"] = $cd['mday'];
+		$commitline["cdmonth"] = $cd['month'];
+		$commitline["cdhour"] = $cd['hour'];
+		$commitline["cdminute"] = $cd['minute'];
+		$commitline["title"] = $co['title'];
+		$commitline["author"] = $co['author'];
+		$commitline["cdrfc2822"] = $cd['rfc2822'];
+		$commitline["commit"] = $commit;
+		$commitline["comment"] = $co['comment'];
+		$commitline["difftree"] = $difftree;
+		$commitlines[] = $commitline;
 	}
-
-	$tpl->clear_all_assign();
-	$tpl->display("rss_footer.tpl");
+	$tpl->assign("commitlines",$commitlines);
+	$tpl->display("rss.tpl");
 }
 
 ?>

--- a/include/display.git_search.php
+++ b/include/display.git_search.php
@@ -16,15 +16,14 @@
 {
 	global $tpl,$gitphp_conf;
 
+	$tpl->clear_all_assign();
 	if (!$gitphp_conf['search']) {
-		$tpl->clear_all_assign();
 		$tpl->assign("message","Search has been disabled");
 		$tpl->display("message.tpl");
 		return;
 	}
 
 	if (!isset($search) || (strlen($search) < 2)) {
-		$tpl->clear_all_assign();
 		$tpl->assign("error",TRUE);
 		$tpl->assign("message","You must enter search text of at least 2 characters");
 		$tpl->display("message.tpl");
@@ -39,77 +38,51 @@
 
 	$revlist = explode("\n",trim(git_rev_list($projectroot . $project, $hash, 101, ($page * 100), FALSE, FALSE, $searchtype, $search)));
 	if (count($revlist) < 1 || (strlen($revlist[0]) < 1)) {
-		$tpl->clear_all_assign();
 		$tpl->assign("message","No matches for '" . $search . "'.");
 		$tpl->display("message.tpl");
 		return;
 	}
 
-	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("hash",$hash);
 	$tpl->assign("treehash",$co['tree']);
-	$tpl->display("search_nav.tpl");
 
 	$tpl->assign("search",$search);
 	$tpl->assign("searchtype",$searchtype);
-	if ($page > 0) {
-		$tpl->assign("firstlink",TRUE);
-		$tpl->assign("prevlink",TRUE);
-		if ($page > 1)
-			$tpl->assign("prevpage",$page-1);
-	}
-	if (count($revlist) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("search_pagenav.tpl");
+	$tpl->assign("page",$page);
+	$revlistcount = count($revlist);
+	$tpl->assign("revlistcount",$revlistcount);
 
 	$tpl->assign("title",$co['title']);
-	$tpl->display("search_header.tpl");
 
-	$alternate = FALSE;
-	$commitcount = min(100,count($revlist));
+	$commitlines = array();
+	$commitcount = min(100,$revlistcount);
 	for ($i = 0; $i < $commitcount; $i++) {
-		$tpl->clear_all_assign();
 		$commit = $revlist[$i];
 		if (strlen(trim($commit)) > 0) {
+			$commitline = array();
 			$co2 = git_read_commit($projectroot . $project, $commit);
-			if ($alternate)
-				$tpl->assign("class","dark");
-			else
-				$tpl->assign("class","light");
-			$alternate = !$alternate;
-			$tpl->assign("project",$project);
-			$tpl->assign("commit",$commit);
-			$tpl->assign("agestringage",$co2['age_string_age']);
-			$tpl->assign("agestringdate",$co2['age_string_date']);
-			$tpl->assign("authorname",$co2['author_name']);
-			$tpl->assign("title_short",$co2['title_short']);
+			$commitline["commit"] = $commit;
+			$commitline["agestringage"] = $co2['age_string_age'];
+			$commitline["agestringdate"] = $co2['age_string_date'];
+			$commitline["authorname"] = $co2['author_name'];
+			$commitline["title_short"] = $co2['title_short'];
 			if (strlen($co2['title_short']) < strlen($co2['title']))
-				$tpl->assign("title",$co2['title']);
-			$tpl->assign("committree",$co2['tree']);
+				$commitline["title"] = $co2['title'];
+			$commitline["committree"] = $co2['tree'];
 			$matches = array();
 			foreach ($co2['comment'] as $comline) {
 				$hl = highlight($comline, $search, "searchmatch", GITPHP_TRIM_LENGTH);
 				if ($hl && (strlen($hl) > 0))
 					$matches[] = $hl;
 			}
-			$tpl->assign("matches",$matches);
-			$tpl->display("search_item.tpl");
+			$commitline["matches"] = $matches;
+			$commitlines[] = $commitline;
 		}
 	}
-
-	$tpl->clear_all_assign();
-	$tpl->assign("project",$project);
-	$tpl->assign("hash",$hash);
-	$tpl->assign("search",$search);
-	$tpl->assign("searchtype",$searchtype);
-	if (count($revlist) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("search_footer.tpl");
+	
+	$tpl->assign("commitlines",$commitlines);
+	$tpl->display("search.tpl");
 }
 
 ?>

--- a/include/display.git_search_files.php
+++ b/include/display.git_search_files.php
@@ -16,15 +16,14 @@
 {
 	global $tpl,$gitphp_conf;
 
+	$tpl->clear_all_assign();
 	if (!($gitphp_conf['search'] && $gitphp_conf['filesearch'])) {
-		$tpl->clear_all_assign();
 		$tpl->assign("message","File search has been disabled");
 		$tpl->display("message.tpl");
 		return;
 	}
 
 	if (!isset($search) || (strlen($search) < 2)) {
-		$tpl->clear_all_assign();
 		$tpl->assign("error",TRUE);
 		$tpl->assign("message","You must enter search text of at least 2 characters");
 		$tpl->display("message.tpl");
@@ -40,47 +39,28 @@
 	$filesearch = git_filesearch($projectroot . $project, $hash, $search, false, ($page * 100), 101);
 
 	if (count($filesearch) < 1) {
-		$tpl->clear_all_assign();
 		$tpl->assign("message","No matches for '" . $search . "'.");
 		$tpl->display("message.tpl");
 		return;
 	}
 
-	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("hash",$hash);
 	$tpl->assign("treehash",$co['tree']);
-	$tpl->display("search_nav.tpl");
 
 	$tpl->assign("search",$search);
 	$tpl->assign("searchtype","file");
-	if ($page > 0) {
-		$tpl->assign("firstlink",TRUE);
-		$tpl->assign("prevlink",TRUE);
-		if ($page > 1)
-			$tpl->assign("prevpage",$page-1);
-	}
-	if (count($filesearch) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("search_pagenav.tpl");
+	$tpl->assign("page",$page);
+	$filesearchcount = count($filesearch);
+	$tpl->assign("filesearchcount",$filesearchcount);
 
 	$tpl->assign("title",$co['title']);
-	$tpl->display("search_header.tpl");
 
-	$alternate = FALSE;
+	$filesearchlines = array();
 	$i = 0;
 	foreach ($filesearch as $file => $data) {
-		$tpl->clear_all_assign();
-		if ($alternate)
-			$tpl->assign("class","dark");
-		else
-			$tpl->assign("class","light");
-		$alternate = !$alternate;
-		$tpl->assign("project",$project);
-		$tpl->assign("hashbase",$hash);
-		$tpl->assign("file",$file);
+		$filesearchline = array();
+		$filesearchline["file"] = $file;
 		if (strpos($file,"/") !== false) {
 			$f = basename($file);
 			$d = dirname($file);
@@ -92,12 +72,12 @@
 		} else
 			$hlt = highlight($file, $search, "searchmatch");
 		if ($hlt)
-			$tpl->assign("filename",$hlt);
+			$filesearchline["filename"] = $hlt;
 		else
-			$tpl->assign("filename",$file);
-		$tpl->assign("hash",$data['hash']);
+			$filesearchline["filename"] = $file;
+		$filesearchline["hash"] = $data['hash'];
 		if ($data['type'] == "tree")
-			$tpl->assign("tree",TRUE);
+			$filesearchline["tree"] = TRUE;
 		if (isset($data['lines'])) {
 			$matches = array();
 			foreach ($data['lines'] as $line) {
@@ -106,24 +86,15 @@
 					$matches[] = $hlt;
 			}
 			if (count($matches) > 0)
-				$tpl->assign("matches",$matches);
+				$filesearchline["matches"] = $matches;
 		}
-		$tpl->display("search_fileitem.tpl");
+		$filesearchlines[] = $filesearchline;
 		$i++;
 		if ($i >= 100)
 			break;
 	}
-
-	$tpl->clear_all_assign();
-	$tpl->assign("project",$project);
-	$tpl->assign("hash",$hash);
-	$tpl->assign("search",$search);
-	$tpl->assign("searchtype","file");
-	if (count($filesearch) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("search_footer.tpl");
+	$tpl->assign("filesearchlines",$filesearchlines);
+	$tpl->display("searchfiles.tpl");
 }
 
 ?>

--- a/include/display.git_shortlog.php
+++ b/include/display.git_shortlog.php
@@ -25,57 +25,38 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("hash",$hash);
-	$tpl->display("shortlog_nav.tpl");
+	$tpl->assign("head",$head);
+
+	if ($page)
+		$tpl->assign("page",$page);
 
 	$revlist = git_read_revlist($projectroot . $project, $hash, 101, ($page * 100));
 
-	if (($hash != $head) || $page)
-		$tpl->assign("headlink",TRUE);
-	if ($page > 0) {
-		$tpl->assign("prevlink",TRUE);
-		$tpl->assign("prevpage",$page-1);
-	}
-	if (count($revlist) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("shortlog_pagenav.tpl");
+	$revlistcount = count($revlist);
+	$tpl->assign("revlistcount",$revlistcount);
 
-	$alternate = FALSE;
+	$commitlines = array();
 	$commitcount = min(100,count($revlist));
 	for ($i = 0; $i < $commitcount; $i++) {
-		$tpl->clear_all_assign();
 		$commit = $revlist[$i];
 		if (strlen(trim($commit)) > 0) {
+			$commitline = array();
 			if (isset($refs[$commit]))
-				$tpl->assign("commitref",$refs[$commit]);
+				$commitline["commitref"] = $refs[$commit];
 			$co = git_read_commit($projectroot . $project, $commit);
 			$ad = date_str($co['author_epoch']);
-			if ($alternate)
-				$tpl->assign("class","dark");
-			else
-				$tpl->assign("class","light");
-			$alternate = !$alternate;
-			$tpl->assign("project",$project);
-			$tpl->assign("commit",$commit);
-			$tpl->assign("agestringage",$co['age_string_age']);
-			$tpl->assign("agestringdate",$co['age_string_date']);
-			$tpl->assign("authorname",$co['author_name']);
-			$tpl->assign("title_short",$co['title_short']);
+			$commitline["commit"] = $commit;
+			$commitline["agestringage"] = $co['age_string_age'];
+			$commitline["agestringdate"] = $co['age_string_date'];
+			$commitline["authorname"] = $co['author_name'];
+			$commitline["title_short"] = $co['title_short'];
 			if (strlen($co['title_short']) < strlen($co['title']))
-				$tpl->assign("title",$co['title']);
-			$tpl->display("shortlog_item.tpl");
+				$commitline["title"] = $co['title'];
+			$commitlines[] = $commitline;
 		}
 	}
-
-	$tpl->clear_all_assign();
-	$tpl->assign("project",$project);
-	$tpl->assign("hash",$hash);
-	if (count($revlist) > 100) {
-		$tpl->assign("nextlink",TRUE);
-		$tpl->assign("nextpage",$page+1);
-	}
-	$tpl->display("shortlog_footer.tpl");
+	$tpl->assign("commitlines",$commitlines);
+	$tpl->display("shortlog.tpl");
 }
 
 ?>

--- a/include/display.git_summary.php
+++ b/include/display.git_summary.php
@@ -28,106 +28,46 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("head",$head);
-	$tpl->display("project_nav.tpl");
-	$tpl->clear_all_assign();
 	$tpl->assign("description",$descr);
 	$tpl->assign("owner",$owner);
 	$tpl->assign("lastchange",$commitdate['rfc2822']);
-	$tpl->display("project_brief.tpl");
-	$tpl->clear_all_assign();
-	$tpl->assign("project",$project);
-	$tpl->display("project_revlist_header.tpl");
 	$revlist = git_read_revlist($projectroot . $project, $head, 17);
-	$alternate = FALSE;
 	foreach ($revlist as $i => $rev) {
-		$tpl->clear_all_assign();
+		$revdata = array();
 		$revco = git_read_commit($projectroot . $project, $rev);
 		$authordate = date_str($revco['author_epoch']);
-		if ($alternate)
-			$tpl->assign("class","dark");
-		else
-			$tpl->assign("class","light");
-		$alternate = !$alternate;
-		$tpl->assign("project",$project);
-		if ($i <= 16) {
-			$tpl->assign("commit",$rev);
-			if (isset($refs[$rev]))
-				$tpl->assign("commitref",$refs[$rev]);
-			$tpl->assign("commitage",$revco['age_string']);
-			$tpl->assign("commitauthor",$revco['author_name']);
-			if (strlen($revco['title_short']) < strlen($revco['title'])) {
-				$tpl->assign("title",$revco['title']);
-				$tpl->assign("title_short",$revco['title_short']);
-			} else
-				$tpl->assign("title_short",$revco['title']);
-		} else {
-			$tpl->assign("truncate",TRUE);
-		}
-		$tpl->display("project_revlist_item.tpl");
+		$revdata["commit"] = $rev;
+		if (isset($refs[$rev]))
+			$revdata["commitref"] = $refs[$rev];
+		$revdata["commitage"] = $revco['age_string'];
+		$revdata["commitauthor"] = $revco['author_name'];
+		if (strlen($revco['title_short']) < strlen($revco['title'])) {
+			$revdata["title"] = $revco['title'];
+			$revdata["title_short"] = $revco['title_short'];
+		} else
+			$revdata["title_short"] = $revco['title'];
+		$revlist[$i] = $revdata;
 	}
-	$tpl->clear_all_assign();
-	$tpl->display("project_revlist_footer.tpl");
+	$tpl->assign("revlist",$revlist);
 
 	$taglist = git_read_refs($projectroot,$project,"refs/tags");
 	if (isset($taglist) && (count($taglist) > 0)) {
-		$tpl->clear_all_assign();
-		$tpl->assign("project",$project);
-		$tpl->display("project_taglist_header.tpl");
-		$alternate = FALSE;
 		foreach ($taglist as $i => $tag) {
-			$tpl->clear_all_assign();
-			$tpl->assign("project",$project);
-			if ($alternate)
-				$tpl->assign("class","dark");
-			else
-				$tpl->assign("class","light");
-			$alternate = !$alternate;
-			if ($i < 16) {
-				$tpl->assign("tagage",$tag['age']);
-				$tpl->assign("tagname",$tag['name']);
-				$tpl->assign("tagid",$tag['id']);
-				$tpl->assign("tagtype",$tag['type']);
-				$tpl->assign("refid",$tag['refid']);
-				$tpl->assign("reftype",$tag['reftype']);
-				if (isset($tag['comment'])) {
-					$com = trim($tag['comment'][0]);
-					if (strlen($com) > GITPHP_TRIM_LENGTH)
-						$com = substr($trimmed,0,GITPHP_TRIM_LENGTH) . "...";
-					$tpl->assign("comment",$com);
-				}
-			} else
-				$tpl->assign("truncate",TRUE);
-			$tpl->display("project_taglist_item.tpl");
+			if (isset($tag['comment'])) {
+				$com = trim($tag['comment'][0]);
+				if (strlen($com) > GITPHP_TRIM_LENGTH)
+					$com = substr($trimmed,0,GITPHP_TRIM_LENGTH) . "...";
+				$taglist[$i]['comment'] = $com;
+			}
 		}
-		$tpl->clear_all_assign();
-		$tpl->display("project_taglist_footer.tpl");
+		$tpl->assign("taglist",$taglist);
 	}
 
 	$headlist = git_read_refs($projectroot,$project,"refs/heads");
 	if (isset($headlist) && (count($headlist) > 0)) {
-		$tpl->clear_all_assign();
-		$tpl->assign("project",$project);
-		$tpl->display("project_headlist_header.tpl");
-		$alternate = FALSE;
-		foreach ($headlist as $i => $head) {
-			$tpl->clear_all_assign();
-			$tpl->assign("project",$project);
-			if ($alternate)
-				$tpl->assign("class","dark");
-			else
-				$tpl->assign("class","light");
-			$alternate = !$alternate;
-			if ($i < 16) {
-				$tpl->assign("headage",$head['age']);
-				$tpl->assign("headname",$head['name']);
-			} else
-				$tpl->assign("truncate",TRUE);
-			$tpl->display("project_headlist_item.tpl");
-		}
-
-		$tpl->clear_all_assign();
-		$tpl->display("project_headlist_footer.tpl");
+		$tpl->assign("headlist",$headlist);
 	}
+	$tpl->display("project.tpl");
 }
 
 ?>

--- /dev/null
+++ b/include/gitutil.git_project_info.php
@@ -1,1 +1,29 @@
+<?php
+/*
+ *  gitutil.git_project_info.php
+ *  gitphp: A PHP git repository browser
+ *  Component: Git utility - single project info
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ */
 
+ require_once('gitutil.git_project_descr.php');
+ require_once('gitutil.git_project_owner.php');
+ require_once('gitutil.git_read_head.php');
+ require_once('gitutil.git_read_commit.php');
+
+function git_project_info($projectroot,$project)
+{
+	$projinfo = array();
+	$projinfo["project"] = $project;
+	$projinfo["descr"] = git_project_descr($projectroot,$project,TRUE);
+	$projinfo["owner"] = git_project_owner($projectroot,$project);
+	$head = git_read_head($projectroot . $project);
+	$commit = git_read_commit($projectroot . $project,$head);
+	$projinfo["age"] = $commit['age'];
+	$projinfo["age_string"] = $commit['age_string'];
+	return $projinfo;
+}
+
+?>
+

--- a/include/gitutil.git_read_projects.php
+++ b/include/gitutil.git_read_projects.php
@@ -8,8 +8,9 @@
  */
 
  require_once('gitutil.git_recurse_projects.php');
+ require_once('gitutil.git_project_info.php');
 
-function git_read_projects($projectroot,$projectlist)
+function git_read_projects($projectroot,$projectlist,$projdata = FALSE)
 {
 	$projects = array();
 	if (isset($projectroot)) {
@@ -19,8 +20,12 @@
 					if (is_array($plist)) {
 						$projs = array();
 						foreach ($plist as $pname => $ppath) {
-							if (is_dir($projectroot . $ppath) && is_file($projectroot . $ppath . "/HEAD"))
-								$projs[] = $ppath;
+							if (is_dir($projectroot . $ppath) && is_file($projectroot . $ppath . "/HEAD")) {
+								if ($projdata)
+									$projs[] = git_project_info($projectroot, $ppath);
+								else
+									$projs[] = $ppath;
+							}
 						}
 						if (count($projs) > 0) {
 							sort($projs);
@@ -33,7 +38,11 @@
 				$len = count($projects);
 				$cut = strlen($projectroot);
 				for ($i = 0; $i < $len; $i++) {
-					$projects[$i] = substr($projects[$i],$cut + 1);
+					$p = substr($projects[$i],$cut + 1);
+					if ($projdata)
+						$projects[$i] = git_project_info($projectroot, $p);
+					else
+						$projects[$i] = $p;
 				}
 			}
 		} else

--- a/include/util.agecmp.php
+++ b/include/util.agecmp.php
@@ -7,17 +7,11 @@
  *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
  */
 
- require_once('gitutil.git_read_commit.php');
- require_once('gitutil.git_read_head.php');
-
 function agecmp($a,$b)
 {
-	global $gitphp_conf;
-	$ca = git_read_commit($gitphp_conf['projectroot'] . $a, git_read_head($gitphp_conf['projectroot'] . $a));
-	$cb = git_read_commit($gitphp_conf['projectroot'] . $b, git_read_head($gitphp_conf['projectroot'] . $b));
-	if ($ca['age'] == $cb['age'])
+	if ($a["age"] == $b["age"])
 		return 0;
-	return ($ca['age'] < $cb['age'] ? -1 : 1);
+	return ($a["age"] < $b["age"] ? -1 : 1);
 }
 
 ?>

--- a/include/util.descrcmp.php
+++ b/include/util.descrcmp.php
@@ -7,12 +7,9 @@
  *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
  */
 
- require_once('gitutil.git_project_descr.php');
-
 function descrcmp($a,$b)
 {
-	global $gitphp_conf;
-	return strcmp(git_project_descr($gitphp_conf['projectroot'],$a),git_project_descr($gitphp_conf['projectroot'],$b));
+	return strcmp($a["descr"],$b["descr"]);
 }
 
 ?>

--- a/include/util.ownercmp.php
+++ b/include/util.ownercmp.php
@@ -7,12 +7,9 @@
  *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
  */
 
- require_once('gitutil.git_project_owner.php');
-
 function ownercmp($a,$b)
 {
-	global $gitphp_conf;
-	return strcmp(git_project_owner($gitphp_conf['projectroot'],$a),git_project_owner($gitphp_conf['projectroot'],$b));
+	return strcmp($a["owner"],$b["owner"]);
 }
 
 ?>

--- a/include/util.projectcmp.php
+++ b/include/util.projectcmp.php
@@ -9,7 +9,7 @@
 
 function projectcmp($a,$b)
 {
-	return strcmp($a,$b);
+	return strcmp($a["project"],$b["project"]);
 }
 
 ?>

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -28,6 +28,14 @@
   */
  require_once($gitphp_conf['smarty_prefix'] . "Smarty.class.php");
  $tpl =& new Smarty;
+ if (isset($_GET['a']) &&
+     ($_GET['a'] != "commitdiff_plain") &&
+     ($_GET['a'] != "blob_plain") &&
+     ($_GET['a'] != "blobdiff_plain") &&
+     ($_GET['a'] != "opml")) {
+	$tpl->load_filter('output','trimwhitespace');
+}
+
 
  $rss_link = FALSE;
  $suppress_headers = FALSE;

--- a/templates/blob.tpl
+++ b/templates/blob.tpl
@@ -53,11 +53,13 @@
      {$geshiout}
    {else}
      {* Just plain display *}
-     <div class="pre">
+     <table class="code">
      {foreach from=$lines item=line name=lines}
-       {if $smarty.foreach.lines.iteration < 10} {/if}{if $smarty.foreach.lines.iteration < 100} {/if}{if $smarty.foreach.lines.iteration < 1000} {/if}<a id="l{$smarty.foreach.lines.iteration}" href="#l{$smarty.foreach.lines.iteration}" class="linenr">{$smarty.foreach.lines.iteration}</a> {$line|escape:'htmlall'}
+       <tr>
+         <td class="num"><a id="l{$smarty.foreach.lines.iteration}" href="#l{$smarty.foreach.lines.iteration}" class="linenr">{$smarty.foreach.lines.iteration}</a></td>
+	 <td class="codeline">{$line|escape:'htmlall'}</td>
      {/foreach}
-     </div>
+     </table>
    {/if}
  </div>
 

--- a/templates/commitdiff.tpl
+++ b/templates/commitdiff.tpl
@@ -5,6 +5,7 @@
  *
  *  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&h={$hash}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | commitdiff | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a><br /><a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff_plain&h={$hash}&hp={$hashparent}">plain</a>
  </div>
@@ -19,6 +20,7 @@
      {$line}<br />
    {/foreach}
    <br />
+   {* Diff each file changed *}
    {section name=difftree loop=$difftreelines}
      {if $difftreelines[difftree].status == "A"}
        <div class="diff_info">

file:a/templates/diff_line.tpl (deleted)
--- a/templates/diff_line.tpl
+++ /dev/null
@@ -1,9 +1,1 @@
-{*
- *  diff_line.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Diff line template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div class="pre{if $class} {$class}{/if}">{$line}</div>
 

--- a/templates/diff_plaintext.tpl
+++ b/templates/diff_plaintext.tpl
@@ -18,3 +18,8 @@
 {/foreach}
 ---
 
+
+{foreach from=$diffs item=diffout}
+{$diffout}
+{/foreach}
+

--- /dev/null
+++ b/templates/heads.tpl
@@ -1,1 +1,26 @@
+{*
+ *  heads_nav.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Head 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>
+ <table cellspacing="0">
+   {* Loop and display each head *}
+   {foreach from=$headlist item=head}
+     <tr class="{cycle values="light,dark"}">
+       <td><i>{$head.age}</i></td>
+       <td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$head.name}" class="list"><b>{$head.name}</b></a></td>
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$head.name}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/heads/{$head.name}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h=refs/heads/{$head.name}&hb={$head.name}">tree</a></td>
+     </tr>
+   {/foreach}
+ </table>
 

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

--- a/templates/heads_header.tpl
+++ /dev/null
@@ -1,10 +1,1 @@
-{*
- *  heads_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Head 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">
 

--- a/templates/heads_item.tpl
+++ /dev/null
@@ -1,13 +1,1 @@
-{*
- *  heads_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Head 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=shortlog&h=refs/heads/{$name}" class="list"><b>{$name}</b></a></td>
- <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$name}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/heads/{$name}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h=refs/heads/{$name}&hb={$name}">tree</a></td>
- </tr>
 

file:a/templates/heads_nav.tpl (deleted)
--- a/templates/heads_nav.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  heads_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Head 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>
 

--- /dev/null
+++ b/templates/history.tpl
@@ -1,1 +1,45 @@
+{*
+ *  history.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: History view template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+ {* Page header *}
+ <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={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a>
+   <br /><br />
+ </div>
+ <div>
+   <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}
+   {if $hashbaseref}
+     <span class="tag">{$hashbaseref}</span>
+   {/if}
+   </a>
+ </div>
+ <div class="page_path">
+   {* File path *}
+   <b>
+     <a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$hash}">[{$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}&f={$path.full}">{$path.short}</a>
+       {else}
+         <a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$path.tree}&f={$path.full}">{$path.short}</a> / 
+       {/if}
+     {/foreach}
+   </b>
+ </div>
+ <table cellspacing="0">
+   {* Display each history line *}
+   {section name=history loop=$historylines}
+     <tr class="{cycle values="light,dark"}">
+       <td title="{$historylines[history].agestringage}"><i>{$historylines[history].agestringdate}</i></td>
+       <td><i>{$historylines[history].authorname}</i></td>
+       <td><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$historylines[history].commit}" class="list"><b>{$historylines[history].title}{if $historylines[history].commitref} <span class="tag">{$historylines[history].commitref}</span>{/if}</b></a></td>
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$historylines[history].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$historylines[history].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=blob&hb={$historylines[history].commit}&f={$historylines[history].file}">blob</a>{if $historylines[history].blob && $historylines[history].blobparent} | <a href="{$SCRIPT_NAME}?p={$project}&a=blobdiff&h={$historylines[history].blob}&hp={$historylines[history].blobparent}&hb={$historylines[history].commit}&f={$historylines[history].file}">diff to current</a>{/if}
+       </td>
+     </tr>
+   {/section}
+ </table>
 

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

--- a/templates/history_header.tpl
+++ /dev/null
@@ -1,16 +1,1 @@
-{*
- *  history_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: History view header template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}
- {if $hashbaseref}
- <span class="tag">{$hashbaseref}</span>
- {/if}
- </a>
- </div>
- <div class="page_path"><b><a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$hash}">[{$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}&f={$path.full}">{$path.short}</a>{else}<a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$path.tree}&f={$path.full}">{$path.short}</a> / {/if}{/foreach}</b></div>
- <table cellspacing="0">
 

--- a/templates/history_item.tpl
+++ /dev/null
@@ -1,14 +1,1 @@
-{*
- *  history_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: History view item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <tr class="{$class}">
- <td title="{$agestringage}"><i>{$agestringdate}</i></td>
- <td><i>{$authorname}</i></td>
- <td><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}" class="list"><b>{$title}{if $commitref} <span class="tag">{$commitref}</span>{/if}</b></a></td>
- <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=blob&hb={$commit}&f={$file}">blob</a>{if $difftocurrent} | <a href="{$SCRIPT_NAME}?p={$project}&a=blobdiff&h={$blob}&hp={$blobparent}&hb={$commit}&f={$file}">diff to current</a>{/if}
- </td></tr>
 

--- a/templates/history_nav.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  history_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: History 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={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$tree}&hb={$hash}">tree</a>
- <br /><br />
- </div>
 

file:b/templates/log.tpl (new)
--- /dev/null
+++ b/templates/log.tpl
@@ -1,1 +1,65 @@
+{*
+ *  log.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Log 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&h={$hash}">shortlog</a> | log | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hash}">tree</a>
+   <br />
+   {if ($hash != $head) || $page}
+     <a href="{$SCRIPT_NAME}?p={$project}&a=log">HEAD</a>
+   {else}
+     HEAD
+   {/if}
+   &sdot; 
+   {if $page > 0}
+     <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$page-1}" accesskey="p" title="Alt-p">prev</a>
+   {else}
+     prev
+   {/if}
+   &sdot; 
+   {if $revlistcount > 100}
+     <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$page+1}" accesskey="n" title="Alt-n">next</a>
+   {else}
+     next
+   {/if}
+   <br />
+ </div>
+ {if $norevlist}
+   <div>
+     <a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp</a>
+   </div>
+   <div class="page_body">
+     Last change {$lastchange}.
+     <br /><br />
+   </div>
+ {/if}
+ {* Display each commit *}
+ {section name=log loop=$commitlines}
+   <div>
+     <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}" class="title"><span class="age">{$commitlines[log].agestring}</span>{$commitlines[log].title}
+       {if $commitlines[log].commitref}
+         <span class="tag">{$commitlines[log].commitref}</span>
+       {/if}
+     </a>
+   </div>
+   <div class="title_text">
+     <div class="log_link">
+       <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commitlines[log].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commitlines[log].commit}&hb={$commitlines[log].commit}">tree</a>
+       <br />
+     </div>
+     <i>{$commitlines[log].authorname} [{$commitlines[log].rfc2822}]</i><br />
+   </div>
+   <div class="log_body">
+     {foreach from=$commitlines[log].comment item=line}
+       {$line}<br />
+     {/foreach}
+     {if count($commitlines[log].comment) > 0}
+       <br />
+     {/if}
+   </div>
+ {/section}
 

file:a/templates/log_info.tpl (deleted)
--- a/templates/log_info.tpl
+++ /dev/null
@@ -1,13 +1,1 @@
-{*
- *  log_info.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Log view info template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div>
- <a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp</a>
- </div>
- <div class="page_body"> Last change {$agestring}.<br /><br />
- </div>
 

file:a/templates/log_item.tpl (deleted)
--- a/templates/log_item.tpl
+++ /dev/null
@@ -1,30 +1,1 @@
-{*
- *  log_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Log view item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div>
- <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}" class="title"><span class="age">{$agestring}</span>{$title}
- {if $commitref}
-  <span class="tag">{$commitref}</span>
- {/if}
- </a>
- </div>
- <div class="title_text">
- <div class="log_link">
- <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commit}&hb={$commit}">tree</a>
- <br />
- </div>
- <i>{$authorname} [{$rfc2822}]</i><br />
- </div>
- <div class="log_body">
- {foreach from=$comment item=line}
- {$line}<br />
- {/foreach}
- {if $notempty}
- <br />
- {/if}
- </div>
 

file:a/templates/log_nav.tpl (deleted)
--- a/templates/log_nav.tpl
+++ /dev/null
@@ -1,11 +1,1 @@
-{*
- *  log_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Log 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&h={$hash}">shortlog</a> | log | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hash}">tree</a>
- <br />
 

--- a/templates/log_pagenav.tpl
+++ /dev/null
@@ -1,11 +1,1 @@
-{*
- *  log_pagenav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Log view page nav template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- {if $headlink}<a href="{$SCRIPT_NAME}?p={$project}&a=log">{/if}HEAD{if $headlink}</a>{/if} &sdot; {if $prevlink}<a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$prevpage}" accesskey="p" title="Alt-p">{/if}prev{if $prevlink}</a>{/if} &sdot; {if $nextlink}<a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}&pg={$nextpage}" accesskey="n" title="Alt-n">{/if}next{if $nextlink}</a>{/if}
- <br />
- </div>
 

--- /dev/null
+++ b/templates/opml.tpl
@@ -1,1 +1,23 @@
+{*
+ *  opml.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: OPML template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+<?xml version="1.0" encoding="utf-8"?>
+<opml version="1.0">
+  <head>
+    <title>{$title} OPML Export</title>
+  </head>
+  <body>
+    <outline text="git RSS feeds">
 
+      {foreach from=$opmllist item=proj}
+      <outline type="rss" text="{$proj}" title="{$proj}" xmlUrl="{$self}?p={$proj}&amp;a=rss" htmlUrl="{$self}?p={$proj}&amp;a=summary" />
+
+      {/foreach}
+    </outline>
+  </body>
+</opml>
+

--- a/templates/opml_footer.tpl
+++ /dev/null
@@ -1,11 +1,1 @@
-{*
- *  opml_footer.tpl
- *  gitphp: A PHP git repository browser
- *  Component: OPML footer template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- </outline>
- </body>
- </opml>
 

--- a/templates/opml_header.tpl
+++ /dev/null
@@ -1,16 +1,1 @@
-{*
- *  opml_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: OPML header template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<?xml version="1.0" encoding="utf-8"?>
-<opml version="1.0">
-<head>
-  <title>{$title} OPML Export</title>
-</head>
-<body>
-<outline text="git RSS feeds">
 
-

file:a/templates/opml_item.tpl (deleted)
--- a/templates/opml_item.tpl
+++ /dev/null
@@ -1,9 +1,1 @@
-{*
- *  opml_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: OPML item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<outline type="rss" text="{$proj}" title="{$proj}" xmlUrl="{$self}?p={$proj}&amp;a=rss" htmlUrl="{$self}?p={$proj}&amp;a=summary"/>
 

--- /dev/null
+++ b/templates/project.tpl
@@ -1,1 +1,89 @@
+{*
+ *  project.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Project template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+ <div class="page_nav">
+   summary | <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">tree</a>
+   <br /><br />
+ </div>
+ <div class="title">&nbsp;</div>
+ <table cellspacing="0">
+   <tr><td>description</td><td>{$description}</td></tr>
+   <tr><td>owner</td><td>{$owner}</td></tr>
+   <tr><td>last change</td><td>{$lastchange}</td></tr>
+ </table>
+ <div>
+   <a class="title" href="{$SCRIPT_NAME}?p={$project}&a=shortlog">shortlog</a>
+ </div>
+ <table cellspacing="0">
+   {section name=rev max=17 loop=$revlist}
+     {if $smarty.section.rev.index == 16}
+       <tr class="light">
+         <td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">...</a></td>
+       </tr>
+     {else}
+         <tr class="{cycle name=revs values="light,dark"}">
+         <td><i>{$revlist[rev].commitage}</i></td>
+         <td><i>{$revlist[rev].commitauthor}</i></td>
+         <td>
+           <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$revlist[rev].commit}" class="list" {if $revlist[rev].title}title="{$revlist[rev].title}"{/if}><b>{$revlist[rev].title_short}
+             {if $revlist[rev].commitref}
+               <span class="tag">{$revlist[rev].commitref}</span>
+             {/if}
+           </b>
+         </td>
+         <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$revlist[rev].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$revlist[rev].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$revlist[rev].commit}&hb={$revlist[rev].commit}">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$revlist[rev].commit}">snapshot</a></td>
+       </tr>
+     {/if}
+   {/section}
+ </table>
+ {if $taglist}
+   <div>
+     <a href="{$SCRIPT_NAME}?p={$project}&a=tags" class="title">tags</a>
+   </div>
+   <table cellspacing="0">
+     {section name=tag max=17 loop=$taglist}
+       <tr class="{cycle name=tags values="light,dark"}">
+         {if $smarty.section.tag.index == 16}
+           <td><a href="{$SCRIPT_NAME}?p={$project}&a=tags">...</a></td>
+         {else}
+           <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 $taglist[tag].comment}
+               <a class="list" href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$taglist[tag].id}">{$taglist[tag].comment}</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>
+         {/if}
+       </tr>
+     {/section}
+   </table>
+ {/if}
+ {if $headlist}
+   <div>
+     <a href="{$SCRIPT_NAME}?p={$project}&a=heads" class="title">heads</a>
+   </div>
+   <table cellspacing="0">
+     {section name=head max=17 loop=$headlist}
+       <tr class="{cycle name=heads values="light,dark"}">
+         {if $smarty.section.head.index == 16}
+           <td><a href="{$SCRIPT_NAME}?p={$project}&a=heads">...</a></td>
+         {else}
+           <td><i>{$headlist[head].age}</i></td>
+           <td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$headlist[head].name}" class="list"><b>{$headlist[head].name}</b></td>
+           <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$headlist[head].name}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/heads/{$headlist[head].name}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h=refs/heads/{$headlist[head].name}&hb={$headlist[head].name}">tree</a></td>
+         {/if}
+       </tr>
+     {/section}
+   </table>
+ {/if}
 

--- a/templates/project_brief.tpl
+++ /dev/null
@@ -1,14 +1,1 @@
-{*
- *  project_brief.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project brief info template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div class="title">&nbsp;</div>
- <table cellspacing="0">
- <tr><td>description</td><td>{$description}</td></tr>
- <tr><td>owner</td><td>{$owner}</td></tr>
- <tr><td>last change</td><td>{$lastchange}</td></tr>
- </table>
 

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

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

--- a/templates/project_headlist_item.tpl
+++ /dev/null
@@ -1,17 +1,1 @@
-{*
- *  project_headlist_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project head list item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <tr class="{$class}">
- {if $truncate}
-   <td><a href="{$SCRIPT_NAME}?p={$project}&a=heads">...</a></td>
- {else}
-   <td><i>{$headage}</i></td>
-   <td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$headname}" class="list"><b>{$headname}</b></td>
-   <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h=refs/heads/{$headname}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/heads/{$headname}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h=refs/heads/{$headname}&hb={$headname}">tree</a></td>
- {/if}
- </tr>
 

--- a/templates/project_nav.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  project_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project navbar template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <div class="page_nav">
- summary | <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">tree</a>
- <br /><br />
- </div>
 

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

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

--- a/templates/project_revlist_item.tpl
+++ /dev/null
@@ -1,25 +1,1 @@
-{*
- *  project_revlist_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project revision list item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- {if $truncate}
- <tr class="light">
-  <td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">...</td>
- {else}
- <tr class="{$class}">
-  <td><i>{$commitage}</i></td>
-  <td><i>{$commitauthor}</i></td>
-  <td>
-  <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}" class="list" {if $title}title="{$title}"{/if}><b>{$title_short}
-  {if $commitref}
-  <span class="tag">{$commitref}</span>
-  {/if}
-  </b>
-  </td>
-  <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commit}&hb={$commit}">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$commit}">snapshot</a></td>
-  </tr>
- {/if}
 

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

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

--- a/templates/project_taglist_item.tpl
+++ /dev/null
@@ -1,27 +1,1 @@
-{*
- *  project_taglist_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project tag list item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <tr class="{$class}">
- {if $truncate}
-   <td><a href="{$SCRIPT_NAME}?p={$project}&a=tags">...</a></td>
- {else}
-   <td><i>{$tagage}</i></td>
-   <td><a href="{$SCRIPT_NAME}?p={$project}&a={$reftype}&h={$refid}" class="list"><b>{$tagname}</b></a></td>
-   <td>
-   {if $comment}
-     <a class="list" href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$tagid}">{$comment}</a>
-   {/if}
-   </td>
-   <td class="link">
-   {if $tagtype == "tag"}
-   	<a href="{$SCRIPT_NAME}?p={$project}&a=tag&h={$tagid}">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/{$tagname}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h=refs/tags/{$tagname}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$refid}">snapshot</a>{/if}
-   </td>
- {/if}
- </tr>
 

--- /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}
+

--- a/templates/projlist_category.tpl
+++ /dev/null
@@ -1,15 +1,1 @@
-{*
- *  projlist_category.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project list category template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<tr>
-<th>{$category}</th>
-<th></th>
-<th></th>
-<th></th>
-<th></th>
-</tr>
 

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

--- a/templates/projlist_header.tpl
+++ /dev/null
@@ -1,32 +1,1 @@
-{*
- *  projlist_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project list header template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<table cellspacing="0">
-<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>
 

--- a/templates/projlist_item.tpl
+++ /dev/null
@@ -1,33 +1,1 @@
-{*
- *  projlist_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Project list item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<tr class="{$class}">
-<td>
-{if $idt}<span class="respectwhitespace">  {/if}<a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="list">{$project}</a>{if $idt}</span>{/if}
-</td>
-<td>{$descr}</td>
-<td><i>{$owner}</i></td>
-<td>
-{if $age_colored}
-<span class="agehighlight">
-{/if}
-{if $age_bold}
-<b>
-{/if}
-<i>
-{$age_string}
-</i>
-{if $age_bold}
-</b>
-{/if}
-{if $age_colored}
-</span>
-{/if}
-</td>
-<td class="link"><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=tree">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h=HEAD">snapshot</a></td>
-</tr>
 

file:b/templates/rss.tpl (new)
--- /dev/null
+++ b/templates/rss.tpl
@@ -1,1 +1,39 @@
+{*
+ *  rss.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: RSS template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
+  <channel>
+    <title>{$project}</title>
+    <link>{$self}?p={$project}&amp;a=summary</link>
+    <description>{$project} log</description>
+    <language>en</language>
 
+    {section name=rssitem loop=$commitlines}
+      <item>
+        <title>{$commitlines[rssitem].cdmday} {$commitlines[rssitem].cdmonth} {$commitlines[rssitem].cdhour}:{$commitlines[rssitem].cdminute} - {$commitlines[rssitem].title|escape:'htmlall'}</title>
+        <author>{$commitlines[rssitem].author|escape:'htmlall'}</author>
+        <pubDate>{$commitlines[rssitem].cdrfc2822}</pubDate>
+        <guid isPermaLink="true">{$self}?p={$project}&amp;a=commit&amp;h={$commitlines[rssitem].commit}</guid>
+        <link>{$self}?p={$project}&amp;a=commit&amp;h={$commitlines[rssitem].commit}</link>
+        <description>{$commitlines[rssitem].title|escape:'htmlall'}</description>
+        <content:encoded>
+          <![CDATA[
+          {foreach from=$commitlines[rssitem].comment item=line}
+            {$line}<br />
+          {/foreach}
+          {foreach from=$commitlines[rssitem].difftree item=line}
+            {$line}<br />
+          {/foreach}
+          ]]>
+        </content:encoded>
+      </item>
+    {/section}
+
+  </channel>
+</rss>
+

--- a/templates/rss_footer.tpl
+++ /dev/null
@@ -1,10 +1,1 @@
-{*
- *  rss_footer.tpl
- *  gitphp: A PHP git repository browser
- *  Component: RSS footer template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-</channel>
-</rss>
 

--- a/templates/rss_header.tpl
+++ /dev/null
@@ -1,15 +1,1 @@
-{*
- *  rss_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: RSS header template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<?xml version="1.0" encoding="utf-8"?>
-<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
-<channel>
-<title>{$project}</title>
-<link>{$self}?p={$project}&amp;a=summary</link>
-<description>{$project} log</description>
-<language>en</language>
 

file:a/templates/rss_item.tpl (deleted)
--- a/templates/rss_item.tpl
+++ /dev/null
@@ -1,26 +1,1 @@
-{*
- *  rss_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: RSS item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
-<item>
-<title>{$cdmday} {$cdmonth} {$cdhour}:{$cdminute} - {$title}</title>
-<author>{$author}</author>
-<pubDate>{$cdrfc2822}</pubDate>
-<guid isPermaLink="true">{$self}?p={$project}&amp;a=commit&amp;h={$commit}</guid>
-<link>{$self}?p={$project}&amp;a=commit&amp;h={$commit}</link>
-<description>{$title}</description>
-<content:encoded>
-<![CDATA[
-{foreach from=$comment item=line}
-{$line}<br />
-{/foreach}
-{foreach from=$difftree item=line}
-{$line}<br />
-{/foreach}
-]]>
-</content:encoded>
-</item>
 

--- /dev/null
+++ b/templates/search.tpl
@@ -1,1 +1,56 @@
+{*
+ *  search.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Search 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&h={$hash}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$treehash}&hb={$hash}">tree</a>
+  <br />
+  {if $page > 0}
+    <a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}">first</a>
+  {else}
+    first
+  {/if}
+    &sdot; 
+  {if $page > 0}
+    <a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}{if $page > 1}&pg={$page-1}{/if}" accesskey="p" title="Alt-p">prev</a>
+  {else}
+    prev
+  {/if}
+    &sdot; 
+  {if $revlistcount > 100}
+    <a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}&pg={$page+1}" accesskey="n" title="Alt-n">next</a>
+  {else}
+    next
+  {/if}
+  <br />
+</div>
+<div>
+  <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}</a>
+</div>
+<table cellspacing="0">
+  {* Print each match *}
+  {section name=match loop=$commitlines}
+    <tr class="{cycle values="light,dark"}">
+      <td title="{$commitlines[match].agestringage}"><i>{$commitlines[match].agestringdate}</i></td>
+      <td><i>{$commitlines[match].authorname}</i></td>
+      <td><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[match].commit}" class="list" {if $title}title="{$commitlines[match].title}"{/if}><b>{$commitlines[match].title_short}</b>
+        {foreach from=$commitlines[match].matches item=line name=match}
+          {if $smarty.foreach.match.first}<br />{/if}{$line}<br />
+        {/foreach}
+      </td>
+      <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[match].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commitlines[match].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commitlines[match].committree}&hb={$commitlines[match].commit}">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$commitlines[match].commit}">snapshot</a>
+      </td>
+    </tr>
+  {/section}
 
+  {if $revlistcount > 100}
+    <tr>
+      <td><a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}&pg={$page+1}" title="Alt-n">next</a></td>
+    </tr>
+  {/if}
+</table>
+

--- a/templates/search_fileitem.tpl
+++ /dev/null
@@ -1,21 +1,1 @@
-{*
- *  search_fileitem.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Search file item template
- *
- *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
- *}
-<tr class="{$class}">
-<td>
-{if $tree}
-<a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hashbase}&f={$file}" class="list"><b>{$filename}</b></a>
-{else}
-<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hash}&hb={$hashbase}&f={$file}" class="list"><b>{$filename}</b></a>
-{foreach from=$matches item=line name=match}
-{if $smarty.foreach.match.first}<br />{/if}<span class="respectwhitespace">{$line}</span><br />
-{/foreach}
-{/if}
-</td>
-<td class="link">{if $tree}<a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hashbase}&f={$file}">tree</a>{else}<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$hash}&hb={$hashbase}&f={$file}">blob</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=history&h={$hashbase}&f={$file}">history</a>{/if}</td>
-</tr>
 

--- a/templates/search_footer.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  search_footer.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Search view footer template
- *
- *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
- *}
- {if $nextlink}
- <tr><td><a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}&pg={$nextpage}" title="Alt-n">next</a></td></tr>
- {/if}
- </table>
 

--- a/templates/search_header.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  search_header.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Search header 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>
-<table cellspacing="0">
 

--- a/templates/search_item.tpl
+++ /dev/null
@@ -1,19 +1,1 @@
-{*
- *  search_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Search view item template
- *
- *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
- *}
-<tr class="{$class}">
-<td title="{$agestringage}"><i>{$agestringdate}</i></td>
-<td><i>{$authorname}</i></td>
-<td><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}" class="list" {if $title}title="{$title}"{/if}><b>{$title_short}</b>
-{foreach from=$matches item=line name=match}
-{if $smarty.foreach.match.first}<br />{/if}{$line}<br />
-{/foreach}
-</td>
-<td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$committree}&hb={$commit}">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$commit}">snapshot</a>
-</td>
-</tr>
 

--- a/templates/search_nav.tpl
+++ /dev/null
@@ -1,11 +1,1 @@
-{*
- *  search_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Search view nav 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&h={$hash}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$treehash}&hb={$hash}">tree</a>
-<br />
 

--- a/templates/search_pagenav.tpl
+++ /dev/null
@@ -1,11 +1,1 @@
-{*
- *  search_pagenav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Log view page nav template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- {if $firstlink}<a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}">{/if}first{if $firstlink}</a>{/if} &sdot; {if $prevlink}<a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}{if $prevpage}&pg={$prevpage}{/if}" accesskey="p" title="Alt-p">{/if}prev{if $prevlink}</a>{/if} &sdot; {if $nextlink}<a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}&pg={$nextpage}" accesskey="n" title="Alt-n">{/if}next{if $nextlink}</a>{/if}
- <br />
- </div>
 

--- /dev/null
+++ b/templates/searchfiles.tpl
@@ -1,1 +1,64 @@
+{*
+ *  searchfiles.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Search files 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&h={$hash}">shortlog</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$treehash}&hb={$hash}">tree</a>
+  <br />
+  {if $page > 0}
+    <a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}">first</a>
+  {else}
+    first
+  {/if}
+    &sdot; 
+  {if $page > 0}
+    <a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}{if $page > 1}&pg={$page-1}{/if}" accesskey="p" title="Alt-p">prev</a>
+  {else}
+    prev
+  {/if}
+    &sdot; 
+  {if $filesearchcount > 100}
+    <a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}&pg={$page+1}" accesskey="n" title="Alt-n">next</a>
+  {else}
+    next
+  {/if}
+  <br />
+</div>
+<div>
+  <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}</a>
+</div>
+<table cellspacing="0">
+  {* Print each match *}
+  {section name=match loop=$filesearchlines}
+    <tr class="{cycle values="light,dark"}">
+      <td>
+        {if $filesearchlines[match].tree}
+          <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$filesearchlines[match].hash}&hb={$hash}&f={$filesearchlines[match].file}" class="list"><b>{$filesearchlines[match].filename}</b></a>
+        {else}
+          <a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$filesearchlines[match].hash}&hb={$hash}&f={$filesearchlines[match].file}" class="list"><b>{$filesearchlines[match].filename}</b></a>
+          {foreach from=$filesearchlines[match].matches item=line name=match}
+            {if $smarty.foreach.match.first}<br />{/if}<span class="respectwhitespace">{$line}</span><br />
+          {/foreach}
+        {/if}
+      </td>
+      <td class="link">
+        {if $filesearchlines[match].tree}
+          <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$filesearchlines[match].hash}&hb={$hash}&f={$filesearchlines[match].file}">tree</a>
+        {else}
+          <a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$filesearchlines[match].hash}&hb={$hash}&f={$filesearchlines[match].file}">blob</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=history&h={$hash}&f={$filesearchlines[match].file}">history</a>
+        {/if}
+      </td>
+    </tr>
+  {/section}
 
+  {if $filesearchcount > 100}
+    <tr>
+      <td><a href="{$SCRIPT_NAME}?p={$project}&a=search&h={$hash}&s={$search}&st={$searchtype}&pg={$page+1}" title="Alt-n">next</a></td>
+    </tr>
+  {/if}
+</table>
+

--- /dev/null
+++ b/templates/shortlog.tpl
@@ -1,1 +1,56 @@
+{*
+ *  shortlog.tpl
+ *  gitphp: A PHP git repository browser
+ *  Component: Shortlog view template
+ *
+ *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
+ *}
+ <div class="page_nav">
+   <a href="{$SCRIPT_NAME}?p={$project}&a=summary">summary</a> | shortlog | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hash}">tree</a>
+   <br />
+   {if ($hash != $head) || $page}
+     <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">HEAD</a>
+   {else}
+     HEAD
+   {/if}
+     &sdot; 
+   {if $page > 0}
+     <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}&pg={$page-1}" accesskey="p" title="Alt-p">prev</a>
+   {else}
+     prev
+   {/if}
+     &sdot; 
+   {if $revlistcount > 100}
+     <a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}&pg={$page+1}" accesskey="n" title="Alt-n">next</a>
+   {else}
+     next
+   {/if}
+   <br />
+ </div>
+ <div>
+   <a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp;</a>
+ </div>
+ <table cellspacing="0">
+   {section name=log loop=$commitlines}
+     <tr class="{cycle values="light,dark"}">
+       <td title="{$commitlines[log].agestringage}"><i>{$commitlines[log].agestringdate}</i></td>
+       <td><i>{$commitlines[log].authorname}</i></td>
+       <td>
+         <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}" class="list" {if $commitlines[log].title}title="{$commitlines[log].title}"{/if}><b>{$commitlines[log].title_short}
+         {if $commitlines[log].commitref}
+           <span class="tag">{$commitlines[log].commitref}</span>
+         {/if}
+         </b>
+       </td>
+       <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commitlines[log].commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commitlines[log].commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commitlines[log].commit}&hb={$commitlines[log].commit}">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$commitlines[log].commit}">snapshot</a>
+       </td>
+     </tr>
+   {/section}
 
+   {if $revlistcount > 100}
+     <tr>
+       <td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}&pg={$page+1}" title="Alt-n">next</a></td>
+     </tr>
+   {/if}
+ </table>
+

--- a/templates/shortlog_footer.tpl
+++ /dev/null
@@ -1,12 +1,1 @@
-{*
- *  shortlog_footer.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Shortlog view footer template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- {if $nextlink}
- <tr><td><a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}&pg={$nextpage}" title="Alt-n">next</a></td></tr>
- {/if}
- </table>
 

--- a/templates/shortlog_item.tpl
+++ /dev/null
@@ -1,21 +1,1 @@
-{*
- *  shortlog_item.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Shortlog view item template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- <tr class="{$class}">
- <td title="{$agestringage}"><i>{$agestringdate}</i></td>
- <td><i>{$authorname}</i></td>
- <td>
- <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}" class="list" {if $title}title="{$title}"{/if}><b>{$title_short}
- {if $commitref}
- <span class="tag">{$commitref}</span>
- {/if}
- </b>
- </td>
- <td class="link"><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$commit}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$commit}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$commit}&hb={$commit}">tree</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=snapshot&h={$commit}">snapshot</a>
- </td>
- </tr>
 

--- a/templates/shortlog_nav.tpl
+++ /dev/null
@@ -1,11 +1,1 @@
-{*
- *  shortlog_nav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Shortlog 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> | shortlog | <a href="{$SCRIPT_NAME}?p={$project}&a=log&h={$hash}">log</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}">commit</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=commitdiff&h={$hash}">commitdiff</a> | <a href="{$SCRIPT_NAME}?p={$project}&a=tree&h={$hash}&hb={$hash}">tree</a>
- <br />
 

--- a/templates/shortlog_pagenav.tpl
+++ /dev/null
@@ -1,15 +1,1 @@
-{*
- *  shortlog_pagenav.tpl
- *  gitphp: A PHP git repository browser
- *  Component: Shortlog view page nav template
- *
- *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
- *}
- {if $headlink}<a href="{$SCRIPT_NAME}?p={$project}&a=shortlog">{/if}HEAD{if $headlink}</a>{/if} &sdot; {if $prevlink}<a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}&pg={$prevpage}" accesskey="p" title="Alt-p">{/if}prev{if $prevlink}</a>{/if} &sdot; {if $nextlink}<a href="{$SCRIPT_NAME}?p={$project}&a=shortlog&h={$hash}&pg={$nextpage}" accesskey="n" title="Alt-n">{/if}next{if $nextlink}</a>{/if}
- <br />
- </div>
- <div>
- <a href="{$SCRIPT_NAME}?p={$project}&a=summary" class="title">&nbsp;</a>
- </div>
- <table cellspacing="0">
 

comments