From: Brian Warner Date: Tue, 7 Oct 2008 20:18:45 +0000 (-0700) Subject: web/directory: t=manifest output=html: make the caps into clickable hrefs X-Git-Url: https://git.rkrishnan.org/simplejson/...?a=commitdiff_plain;h=cd236efc689b1c01a9a4febe40ec3ba5a90196b5;p=tahoe-lafs%2Ftahoe-lafs.git web/directory: t=manifest output=html: make the caps into clickable hrefs --- diff --git a/src/allmydata/web/directory.py b/src/allmydata/web/directory.py index 6ca04dfd..34860039 100644 --- a/src/allmydata/web/directory.py +++ b/src/allmydata/web/directory.py @@ -716,7 +716,15 @@ class Manifest(rend.Page): def render_row(self, ctx, (path, cap)): ctx.fillSlots("path", self.slashify_path(path)) - ctx.fillSlots("cap", cap) + root = get_root(ctx) + # TODO: we need a clean consistent way to get the type of a cap string + if cap.startswith("URI:CHK") or cap.startswith("URI:SSK"): + nameurl = urllib.quote(path[-1].encode("utf-8")) + uri_link = "%s/file/%s/@@named=/%s" % (root, urllib.quote(cap), + nameurl) + else: + uri_link = "%s/uri/%s" % (root, urllib.quote(cap)) + ctx.fillSlots("cap", T.a(href=uri_link)[cap]) return ctx.tag def DeepSize(ctx, dirnode):