Fix form validators in admin application.
This commit is contained in:
@@ -34,14 +34,14 @@ def editlanguagefile(path,file):
|
|||||||
def file_upload_form(location):
|
def file_upload_form(location):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
||||||
INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file'))
|
INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file'))
|
||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)))
|
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)))
|
||||||
return form
|
return form
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ def editlanguagefile(path,file):
|
|||||||
def file_upload_form(location):
|
def file_upload_form(location):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
INPUT(_type="submit",_value=T("submit")),_action=URL('upload_file'))
|
INPUT(_type="submit",_value=T("submit")),_action=URL('upload_file'))
|
||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
INPUT(_type="submit",_value=T("submit")),_action=URL('create_file'))
|
INPUT(_type="submit",_value=T("submit")),_action=URL('create_file'))
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ def file_upload_form(location, anchor=None):
|
|||||||
LABEL(T("upload file:")),
|
LABEL(T("upload file:")),
|
||||||
INPUT(_type="file",_name="file"),
|
INPUT(_type="file",_name="file"),
|
||||||
LABEL(T("and rename it:")),
|
LABEL(T("and rename it:")),
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY,_class=""),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY(),_class=""),
|
||||||
DIV(TAG['BUTTON'](T("Upload"),_type="submit",_class="btn"),_class="controls"),
|
DIV(TAG['BUTTON'](T("Upload"),_type="submit",_class="btn"),_class="controls"),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="token",_value=session.token),
|
INPUT(_type="hidden",_name="token",_value=session.token),
|
||||||
@@ -36,7 +36,7 @@ def file_upload_form(location, anchor=None):
|
|||||||
def file_create_form(location, anchor=None, helptext=""):
|
def file_create_form(location, anchor=None, helptext=""):
|
||||||
form=FORM(
|
form=FORM(
|
||||||
LABEL(T("create file with filename:")),
|
LABEL(T("create file with filename:")),
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY,_class=''),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY(),_class=''),
|
||||||
TAG['SMALL'](helptext,_class="help-block"),
|
TAG['SMALL'](helptext,_class="help-block"),
|
||||||
DIV(TAG['BUTTON'](T("Create"),_type="submit",_class="btn"),_class="controls"),
|
DIV(TAG['BUTTON'](T("Create"),_type="submit",_class="btn"),_class="controls"),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def editlanguagefile(path,file):
|
|||||||
def file_upload_form(location):
|
def file_upload_form(location):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="token",_value=session.token),
|
INPUT(_type="hidden",_name="token",_value=session.token),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
@@ -28,7 +28,7 @@ def file_upload_form(location):
|
|||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="token",_value=session.token),
|
INPUT(_type="hidden",_name="token",_value=session.token),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design/'+app)),
|
||||||
|
|||||||
Reference in New Issue
Block a user