From: Brian Warner Date: Wed, 5 Dec 2007 07:15:13 +0000 (-0700) Subject: webish: fix overwrite form display X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/(%5B%5E?a=commitdiff_plain;h=51af1fa2e3be5d8d70837f78291a86fe0f261712;p=tahoe-lafs%2Ftahoe-lafs.git webish: fix overwrite form display --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index f051ee04..300018a2 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -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 diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index 63b64ed5..99cf926a 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -40,7 +40,7 @@ -
+ diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index c20403a4..6353dbeb 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -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",