<div><a href=".">Refresh this view</a></div>
<div><a href="..">Parent Directory</a></div>
+<div><a href="@manifest">Manifest for this directory</a></div>
<div>To share this directory, paste the following URI string into an
"Add Shared Directory" box:
<pre class="overflow" n:render="string" n:data="share_uri" /></div>
--- /dev/null
+<html xmlns:n="http://nevow.com/ns/nevow/0.1">
+ <head>
+ <title n:render="title"></title>
+ <!-- <link href="http://www.allmydata.com/common/css/styles.css"
+ rel="stylesheet" type="text/css"/> -->
+ <link href="/tahoe_css" rel="stylesheet" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+
+<h1><p n:render="header"></p></h1>
+
+
+<table n:render="sequence" n:data="items" border="1">
+ <tr n:pattern="header">
+ <td>Refresh Capabilities</td>
+ </tr>
+ <tr n:pattern="item" n:render="row">
+ <td><n:slot name="refresh_capability"/></td>
+ </tr>
+
+ <tr n:pattern="empty"><td>no items in the manifest!</td></tr>
+
+</table>
+
+ </body>
+</html>
def childFactory(self, ctx, name):
if name.startswith("freeform"): # ick
return None
+ if name == "@manifest": # ick, this time it's my fault
+ return Manifest(self._dirnode, self._dirname)
if self._dirname == "/":
dirname = "/" + name
else:
self._filenode.download(WebDownloadTarget(req))
return server.NOT_DONE_YET
+class Manifest(rend.Page):
+ docFactory = getxmlfile("manifest.xhtml")
+ def __init__(self, dirnode, dirname):
+ self._dirnode = dirnode
+ self._dirname = dirname
+
+ def render_title(self, ctx):
+ return T.title["Manifest of %s" % self._dirname]
+
+ def render_header(self, ctx):
+ return T.p["Manifest of %s" % self._dirname]
+
+ def data_items(self, ctx, data):
+ return self._dirnode.build_manifest()
+
+ def render_row(self, ctx, refresh_cap):
+ ctx.fillSlots("refresh_capability", refresh_cap)
+ return ctx.tag
class Root(rend.Page):