From: Brian Warner <warner@lothar.com> Date: Sun, 8 Jul 2007 04:30:04 +0000 (-0700) Subject: web: add a 'return to welcome page' link X-Git-Url: https://git.rkrishnan.org/specifications/%5B/%5D%20/uri/using.html?a=commitdiff_plain;h=e5482b525455e69509429acdf7b7b79409c0ff9f;p=tahoe-lafs%2Ftahoe-lafs.git web: add a 'return to welcome page' link --- diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index 8f7da30b..b8a7ab83 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -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>, diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index fe465e63..044f4aef 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -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):