mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-21 05:53:12 +00:00
webish: fix overwrite form display
This commit is contained in:
parent
53e865cf49
commit
51af1fa2e3
@ -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
|
||||||
|
@ -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>
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user