Commits

Anonymous committed 41084b0

Added an icon column to the file browser

Comments (0)

Files changed (5)

htdocs/file.png

Added
New image

htdocs/folder.png

Added
New image

htdocs/svntrac.css

   padding-right: 0.5em;
 }
 
+td.icon-column
+{
+  width: 16px;
+}
+
 td.name-column, td.report-column, td.ticket-column
 { 
   padding-left: 0.5em;

svntrac/Browser.py

 #
 # Author: Jonas Borgström <jonas@xyche.com>
 
+import StringIO
+import string
+
+from svn import fs, util, delta
+
 from Module import Module
 from util import *
 import perm
 
-import StringIO
-import string
-from svn import fs, util, delta
-
 class Browser (Module):
     template_name = 'browser.template'
 
         else:
             out.write ('<tr class="item-row-odd">\n')
         if item['is_dir']:
+            out.write ('<td class="icon-column"><img src="%s" width="16" height="16"></td>'
+                       % (self.namespace['htdocs_location'] + '/folder.png'))
             out.write ('<td class="name-column"><a href="%s">%s</a></td>'
                        % (browser_href (item['fullpath']), item['name']))
             out.write ('<td class="size-column">&nbsp;</td>')
             out.write ('<td class="rev-column">%s</td>' %
                        item['created_rev'])
         else:
+            out.write ('<td class="icon-column"><img src="%s" width="16" height="16"></td>'
+                       % (self.namespace['htdocs_location'] + '/file.png'))
             out.write ('<td class="name-column"><a href="%s">%s</a></td>'
                        % (log_href (item['fullpath']), item['name']))
             out.write ('<td class="size-column">%s</td>' %
         if self.path != '/':
             parent = string.join(self.path.split('/')[:-2], '/') + '/'
             out.write ('<tr class="item-row-odd">\n')
+            out.write ('<td class="icon-column"><img src="%s" width="16" height="16"></td>'
+                       % (self.namespace['htdocs_location'] + '/folder.png'))
             out.write ('<td class="name-column"><a href="%s">..</a></td><td class="size-column">&nbsp;</td><td class="rev-column">&nbsp;</td><td class="date-column">&nbsp;</td>' %
                        browser_href(parent))
             out.write ('</tr>')

templates/browser.template

 <br>
 
 <table class="listing" cellspacing="0" cellpadding="0">
-<tr class="listing-header"><th class="listing">name</th><th class="listing">size</th><th class="listing">rev</th><th class="listing">date</th></tr>
+<tr class="listing-header"><th class="listing">&nbsp;</th><th class="listing">name</th><th class="listing">size</th><th class="listing">rev</th><th class="listing">date</th></tr>
 %(dir_entries)s
 </table>