]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
web: add a 'return to welcome page' link
authorBrian Warner <warner@lothar.com>
Sun, 8 Jul 2007 04:30:04 +0000 (21:30 -0700)
committerBrian Warner <warner@lothar.com>
Sun, 8 Jul 2007 04:30:04 +0000 (21:30 -0700)
src/allmydata/web/directory.xhtml
src/allmydata/webish.py

index 8f7da30b7c8d9e4acb32160bfbee448ef5938309..b8a7ab8373895df462cdd86c4a0ca89c16186628 100644 (file)
@@ -12,7 +12,8 @@
 <h2 n:render="header"></h2>
 
 <div><a href=".">Refresh this view</a></div>
-<div><a href="..">Parent Directory</a></div>
+<div n:render="welcome" />
+
 <div>Other representations of this directory:
 <a href="?t=manifest">manifest</a>,
 <a href="?t=uri">URI</a>,
index fe465e63ced6a13d967c2698703240171c58adb6..044f4aefda034529e021a2916984ddc22ac379c7 100644 (file)
@@ -69,6 +69,11 @@ class Directory(rend.Page):
         header.append(":")
         return ctx.tag[header]
 
+    def render_welcome(self, ctx, data):
+        depth = len(self._dirpath) + 2
+        link = "/".join([".."] * depth)
+        return T.div[T.a(href=link)["Return to Welcome page"]]
+
     def data_share_uri(self, ctx, data):
         return self._dirnode.get_uri()
     def data_share_readonly_uri(self, ctx, data):