webish: fix overwrite form display

This commit is contained in:
Brian Warner 2007-12-05 00:15:13 -07:00
parent 53e865cf49
commit 51af1fa2e3
3 changed files with 6 additions and 4 deletions

View File

@ -948,8 +948,9 @@ class Web(WebMixin, unittest.TestCase):
self.GET(self.public_url + "/foo", self.GET(self.public_url + "/foo",
followRedirect=True)) followRedirect=True))
def _check_page(res): def _check_page(res):
# TODO: assert something about the contents # TODO: assert more about the contents
pass self.failUnless("Overwrite" in res)
self.failUnless("Choose new file:" in res)
d.addCallback(_check_page) d.addCallback(_check_page)
return d return d

View File

@ -40,7 +40,7 @@
<td><n:slot name="size"/></td> <td><n:slot name="size"/></td>
<td><n:slot name="data"/></td> <td><n:slot name="data"/></td>
<td><n:slot name="delete"/></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="rename"/></td>
<td><n:slot name="check"/></td> <td><n:slot name="check"/></td>

View File

@ -176,6 +176,7 @@ class Directory(rend.Page):
T.input(type='hidden', name='when_done', value=url.here), T.input(type='hidden', name='when_done', value=url.here),
T.input(type='submit', value='check', name="check"), T.input(type='submit', value='check', name="check"),
] ]
ctx.fillSlots("overwrite", self.build_overwrite(ctx, (name, target)))
ctx.fillSlots("check", check) ctx.fillSlots("check", check)
# build the base of the uri_link link url # build the base of the uri_link link url
@ -331,7 +332,7 @@ class Directory(rend.Page):
T.div(class_="freeform-form")[mount], T.div(class_="freeform-form")[mount],
] ]
def render_overwrite(self, ctx, data): def build_overwrite(self, ctx, data):
name, target = data name, target = data
if IMutableFileNode.providedBy(target) and not target.is_readonly(): if IMutableFileNode.providedBy(target) and not target.is_readonly():
overwrite = T.form(action=".", method="post", overwrite = T.form(action=".", method="post",