Anonymous avatar Anonymous committed 46d6da3

Added a legend to the diff viewer

Comments (0)

Files changed (3)

htdocs/svntrac.css

   width: 100%;
 }
 
-td.diff-changed { background-color: #ffcc66; }
-td.diff-unchanged {  }
+.diff-legend-added, .diff-legend-removed, 
+.diff-legend-modified, .diff-legend-unmodified
+{
+  border: thin solid black;
+  width: 1em;
+}
+
+table.diff-legend
+{ 
+}
+
+td.diff-modified, .diff-legend-modified { background-color: #ffcc66; }
+td.diff-unmodified, .diff-legend-unmodified { background-color: white }
 td.diff-line { background-color: #dddddd; border-bottom: thin solid gray}
 
-td.diff-remove-left { background-color: #ff8888; }
+td.diff-remove-left, .diff-legend-removed { background-color: #ff8888; }
 td.diff-remove-right { background-color: #ffaaaa; }
 td.diff-add-left { background-color: #ddffdd; }
-td.diff-add-right { background-color: #bbffbb; }
+td.diff-add-right, .diff-legend-added { background-color: #bbffbb; }
 
-td.diff-changed, td.diff-unchanged,
+td.diff-modified, td.diff-unmodified,
 td.diff-remove-left,td.diff-remove-right,
 td.diff-add-left,td.diff-add-right
 {
   font-family: monospace; 
   vertical-align: top;
-  }
+}
 
 body
 {

svntrac/Changeset.py

         print ('<tr><td class="diff-remove-left">%s</td>'
                '<td class="diff-remove-right"></td></tr>' % text)
     
-    def writeunchanged (self, text):
-        print ('<tr><td class="diff-unchanged">%s</td>'
-               '<td class="diff-unchanged">%s</td></tr>' %
+    def writeunmodified (self, text):
+        print ('<tr><td class="diff-unmodified">%s</td>'
+               '<td class="diff-unmodified">%s</td></tr>' %
                (text, text))
 
-    def writechanged (self, old, new):
-        print ('<tr><td class="diff-changed">%s</td>'
-               '<td class="diff-changed">%s</td></tr>' %
+    def writemodified (self, old, new):
+        print ('<tr><td class="diff-modified">%s</td>'
+               '<td class="diff-modified">%s</td></tr>' %
                (old, new))
         
     def print_block (self):
         if self.p_type == '-' and self.type == '+':
-            self.writechanged(string.join(self.p_block, '<br>'),
+            self.writemodified(string.join(self.p_block, '<br>'),
                               string.join(self.block, '<br>'))
         elif self.type == '+':
             self.writeadd(string.join(self.block, '<br>'))
         elif self.type == '-':
             self.writeremove(string.join(self.block, '<br>'))
         elif self.type == ' ':
-            self.writeunchanged(string.join(self.block, '<br>'))
+            self.writeunmodified(string.join(self.block, '<br>'))
         self.block = self.p_block = []
     
     def writeline(self, text):

templates/changeset.cs

 </tr>
 </table>
 
-<h3>diffs</h3>
+<h3>Legend</h3>
+<table class="diff-legend">
+<tr><td><div class="diff-legend-added">&nbsp;</div></td><td>&nbsp;Added</td></tr>
+<tr><td><div class="diff-legend-removed">&nbsp;</div></td><td>&nbsp;Removed</td></tr>
+<tr><td><div class="diff-legend-modified">&nbsp;</div></td><td>&nbsp;Modified</td></tr>
+<tr><td><div class="diff-legend-unmodified">&nbsp;</div></td><td>&nbsp;Unmodified</td></tr>
+</table>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.