]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: fix overwrite form display
authorBrian Warner <warner@allmydata.com>
Wed, 5 Dec 2007 07:15:13 +0000 (00:15 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 5 Dec 2007 07:15:13 +0000 (00:15 -0700)
src/allmydata/test/test_web.py
src/allmydata/web/directory.xhtml
src/allmydata/webish.py

index f051ee0455f84a86322ffe95a5d430305251a695..300018a27348bce263e89610826338a70b8e81c6 100644 (file)
@@ -948,8 +948,9 @@ class Web(WebMixin, unittest.TestCase):
                       self.GET(self.public_url + "/foo",
                                followRedirect=True))
         def _check_page(res):
-            # TODO: assert something about the contents
-            pass
+            # TODO: assert more about the contents
+            self.failUnless("Overwrite" in res)
+            self.failUnless("Choose new file:" in res)
         d.addCallback(_check_page)
 
         return d
index 63b64ed512942adf1c95d26285ae7be35cd43d18..99cf926abba68924b3aac30121a133f40c66a610 100644 (file)
@@ -40,7 +40,7 @@
     <td><n:slot name="size"/></td>
     <td><n:slot name="data"/></td>
     <td><n:slot name="delete"/></td>
-    <td><div n:render="overwrite"/></td>
+    <td><n:slot name="overwrite"/></td>
     <td><n:slot name="rename"/></td>
 
     <td><n:slot name="check"/></td>
index c20403a4cd84e3eeaf6976c74c9befc04923c76e..6353dbeb8faa73a92fb329f590d2d942ada5c2cd 100644 (file)
@@ -176,6 +176,7 @@ class Directory(rend.Page):
             T.input(type='hidden', name='when_done', value=url.here),
             T.input(type='submit', value='check', name="check"),
             ]
+        ctx.fillSlots("overwrite", self.build_overwrite(ctx, (name, target)))
         ctx.fillSlots("check", check)
 
         # build the base of the uri_link link url
@@ -331,7 +332,7 @@ class Directory(rend.Page):
                 T.div(class_="freeform-form")[mount],
                 ]
 
-    def render_overwrite(self, ctx, data):
+    def build_overwrite(self, ctx, data):
         name, target = data
         if IMutableFileNode.providedBy(target) and not target.is_readonly():
             overwrite = T.form(action=".", method="post",