Detach class names from model code so we can change them easily
Detach class names from model code so we can change them easily

--- a/css/gitphpskin.css
+++ b/css/gitphpskin.css
@@ -384,15 +384,15 @@
 	font-family: monospace;
 }
 
-table.diffTable td.diff-added {
+table.diffTable tr.diff-added {
 	background-color: #C1FFC1;
 }
 
-table.diffTable td.diff-modified {
+table.diffTable tr.diff-modified {
 	background-color: #DDEEFF;
 }
 
-table.diffTable td.diff-deleted {
+table.diffTable tr.diff-deleted {
 	background-color: #FFDDDD;
 }
 

--- a/include/git/FileDiff.class.php
+++ b/include/git/FileDiff.class.php
@@ -677,16 +677,16 @@
 		foreach($diffs as $d) {
 			while($idx+1 < $d['line']) {
 				$h = $blob[$idx];
-				$output[] = array(' ', $h, $h);
+				$output[] = array('', $h, $h);
 				$idx ++;
 			}
 
 			if(count($d['left']) == 0) {
-				$mode = '-added';
+				$mode = 'added';
 			} elseif(count($d['right']) == 0) {
-				$mode = '-deleted';
+				$mode = 'deleted';
 			} else {
-				$mode = '-modified';
+				$mode = 'modified';
 			}
 
 			for($i = 0; $i < count($d['left']) || $i < count($d['right']); $i++) {
@@ -700,7 +700,7 @@
 
 		while($idx < count($blob)) {
 			$h = $blob[$idx];
-			$output[] = array(' ', $h, $h);
+			$output[] = array('', $h, $h);
 			$idx ++;
 		}
 

--- a/templates/sidebyside.tpl
+++ b/templates/sidebyside.tpl
@@ -26,9 +26,17 @@
    {* Display the sidebysidediff *}
    <table class="diffTable pre">
    {foreach from=$filediff->GetDiffSplit() item=lineinfo}
+     {if $lineinfo[0]=='added'}
+     <tr class="diff-added">
+     {elseif $lineinfo[0]=='deleted'}
+     <tr class="diff-deleted">
+     {elseif $lineinfo[0]=='modified'}
+     <tr class="diff-modified">
+     {else}
      <tr>
-       <td class="diff{$lineinfo[0]} diff-left">{$lineinfo[1]|escape}</td>
-       <td class="diff{$lineinfo[0]}">{$lineinfo[2]|escape}</td>
+     {/if}
+       <td class="diff-left">{$lineinfo[1]|escape}</td>
+       <td>{$lineinfo[2]|escape}</td>
      </tr>
    {/foreach}
    </table>

comments