Make browsing files in tree root easier.
Mon Jul 31 05:10:03 UTC 2006 Alberto Bertogli <albertito@gmail.com>
* Make browsing files in tree root easier.
This patch makes it easier to browse files in the root of the tree, by making
it simpler to return to the root tree view.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2013-11-22 21:13:29.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2013-11-22 21:13:30.000000000 +0000
@@ -1776,21 +1776,24 @@
print_header()
print_navbar(f = fname)
filepath = os.path.dirname(fname)
- print """
- <div class="title"><b>
- """
- # and the linked, with links
- parts = filepath.split('/')
- print '/ '
- sofar = '/'
- for p in parts:
- if not p: continue
- sofar += '/' + p
- print '<a href="%s;a=tree;f=%s">%s</a> /' % \
- (config.myreponame, sofar, p)
+ if filepath == '/':
+ print '<div><a class="title" href="%s;a=tree">/</a></div>' % \
+ (config.myreponame)
+ else:
+ print '<div class="title"><b>'
- print '</b></div>'
+ # and the linked, with links
+ parts = filepath.split('/')
+ print '/ '
+ sofar = '/'
+ for p in parts:
+ if not p: continue
+ sofar += '/' + p
+ print '<a href="%s;a=tree;f=%s">%s</a> /' % \
+ (config.myreponame, sofar, p)
+
+ print '</b></div>'
print_blob(fname)
print_footer()