mirror of https://gitlab.com/bashrc2/epicyon
Required text fields
parent
f91d93ba05
commit
9358e9bd2c
|
@ -360,9 +360,9 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
'itemQty', 1, 1, 999999, 1)
|
'itemQty', 1, 1, 999999, 1)
|
||||||
extraFields += '<br>' + \
|
extraFields += '<br>' + \
|
||||||
editTextField(translate['Type of shared item. eg. hat'] + ':',
|
editTextField(translate['Type of shared item. eg. hat'] + ':',
|
||||||
'itemType', '')
|
'itemType', '', '', True)
|
||||||
catStr = translate['Category of shared item. eg. clothing']
|
catStr = translate['Category of shared item. eg. clothing']
|
||||||
extraFields += editTextField(catStr + ':', 'category', '')
|
extraFields += editTextField(catStr + ':', 'category', '', '', True)
|
||||||
extraFields += '<br>'
|
extraFields += '<br>'
|
||||||
extraFields += \
|
extraFields += \
|
||||||
editNumberField(translate['Duration of listing in days'],
|
editNumberField(translate['Duration of listing in days'],
|
||||||
|
|
|
@ -1155,7 +1155,7 @@ def endEditSection() -> str:
|
||||||
|
|
||||||
|
|
||||||
def editTextField(label: str, name: str, value: str = "",
|
def editTextField(label: str, name: str, value: str = "",
|
||||||
placeholder: str = "") -> str:
|
placeholder: str = "", required: bool = False) -> str:
|
||||||
"""Returns html for editing a text field
|
"""Returns html for editing a text field
|
||||||
"""
|
"""
|
||||||
if value is None:
|
if value is None:
|
||||||
|
@ -1163,10 +1163,13 @@ def editTextField(label: str, name: str, value: str = "",
|
||||||
placeholderStr = ''
|
placeholderStr = ''
|
||||||
if placeholder:
|
if placeholder:
|
||||||
placeholderStr = ' placeholder="' + placeholder + '"'
|
placeholderStr = ' placeholder="' + placeholder + '"'
|
||||||
|
requiredStr = ''
|
||||||
|
if required:
|
||||||
|
requiredStr = ' required'
|
||||||
return \
|
return \
|
||||||
'<label class="labels">' + label + '</label><br>\n' + \
|
'<label class="labels">' + label + '</label><br>\n' + \
|
||||||
' <input type="text" name="' + name + '" value="' + \
|
' <input type="text" name="' + name + '" value="' + \
|
||||||
value + '"' + placeholderStr + '>\n'
|
value + '"' + placeholderStr + requiredStr + '>\n'
|
||||||
|
|
||||||
|
|
||||||
def editNumberField(label: str, name: str, value: int = 1,
|
def editNumberField(label: str, name: str, value: int = 1,
|
||||||
|
|
Loading…
Reference in New Issue