Updates webui directory forms

This commit is contained in:
Mark J. Berger 2013-08-30 10:03:58 -04:00 committed by Brian Warner
parent 61395328c3
commit 52859423ba
2 changed files with 23 additions and 19 deletions

View File

@ -1616,7 +1616,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
d.addCallback(lambda res: self.GET(self.public_url + "/foo/empty/"))
def _check4(res):
self.failUnlessIn("directory is empty", res)
MKDIR_BUTTON_RE=re.compile('<input type="hidden" name="t" value="mkdir" />.*<legend class="freeform-form-label">Create a new directory in this directory</legend>.*<input type="submit" value="Create" />', re.I)
MKDIR_BUTTON_RE=re.compile('<input type="hidden" name="t" value="mkdir" />.*<legend class="freeform-form-label">Create a new directory in this directory</legend>.*<input type="submit" class="btn" value="Create" />', re.I)
self.failUnless(MKDIR_BUTTON_RE.search(res), res)
d.addCallback(_check4)

View File

@ -815,11 +815,13 @@ class DirectoryAsHTML(rend.Page):
T.input(type="hidden", name="t", value="mkdir"),
T.input(type="hidden", name="when_done", value="."),
T.legend(class_="freeform-form-label")["Create a new directory in this directory"],
"New directory name:"+SPACE,
"New directory name:"+SPACE, T.br,
T.input(type="text", name="name"), SPACE,
T.input(type="submit", value="Create"), SPACE*2,
mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[" SDMF"], SPACE,
mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[" MDMF (experimental)"],
T.div(class_="form-inline")[
mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[SPACE, "SDMF"], SPACE*2,
mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[SPACE, "MDMF (experimental)"]
],
T.input(type="submit", class_="btn", value="Create")
]]
forms.append(T.div(class_="freeform-form")[mkdir_form])
@ -839,25 +841,27 @@ class DirectoryAsHTML(rend.Page):
T.legend(class_="freeform-form-label")["Upload a file to this directory"],
"Choose a file to upload:"+SPACE,
T.input(type="file", name="file", class_="freeform-input-file"), SPACE,
T.input(type="submit", value="Upload"), SPACE*2,
upload_chk, T.label(for_="upload-chk") [" Immutable"], SPACE,
upload_sdmf, T.label(for_="upload-sdmf")[" SDMF"], SPACE,
upload_mdmf, T.label(for_="upload-mdmf")[" MDMF (experimental)"],
T.div(class_="form-inline")[
upload_chk, T.label(for_="upload-chk") [SPACE, "Immutable"], SPACE*2,
upload_sdmf, T.label(for_="upload-sdmf")[SPACE, "SDMF"], SPACE*2,
upload_mdmf, T.label(for_="upload-mdmf")[SPACE, "MDMF (experimental)"]
],
T.input(type="submit", class_="btn", value="Upload"), SPACE*2,
]]
forms.append(T.div(class_="freeform-form")[upload_form])
attach_form = T.form(action=".", method="post",
enctype="multipart/form-data")[
T.fieldset[
T.input(type="hidden", name="t", value="uri"),
T.input(type="hidden", name="when_done", value="."),
T.legend(class_="freeform-form-label")["Add a link to a file or directory which is already in Tahoe-LAFS."],
"New child name:"+SPACE,
T.input(type="text", name="name"), SPACE*2,
"URI of new child:"+SPACE,
T.input(type="text", name="uri"), SPACE,
T.input(type="submit", value="Attach"),
]]
T.fieldset[ T.div(class_="form-inline")[
T.input(type="hidden", name="t", value="uri"),
T.input(type="hidden", name="when_done", value="."),
T.legend(class_="freeform-form-label")["Add a link to a file or directory which is already in Tahoe-LAFS."],
"New child name:"+SPACE,
T.input(type="text", name="name"), SPACE*2,
"URI of new child:"+SPACE,
T.input(type="text", name="uri"), SPACE,
T.input(type="submit", class_="btn", value="Attach"),
]]]
forms.append(T.div(class_="freeform-form")[attach_form])
return forms