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)
|
||||
extraFields += '<br>' + \
|
||||
editTextField(translate['Type of shared item. eg. hat'] + ':',
|
||||
'itemType', '')
|
||||
'itemType', '', '', True)
|
||||
catStr = translate['Category of shared item. eg. clothing']
|
||||
extraFields += editTextField(catStr + ':', 'category', '')
|
||||
extraFields += editTextField(catStr + ':', 'category', '', '', True)
|
||||
extraFields += '<br>'
|
||||
extraFields += \
|
||||
editNumberField(translate['Duration of listing in days'],
|
||||
|
|
|
@ -1155,7 +1155,7 @@ def endEditSection() -> 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
|
||||
"""
|
||||
if value is None:
|
||||
|
@ -1163,10 +1163,13 @@ def editTextField(label: str, name: str, value: str = "",
|
|||
placeholderStr = ''
|
||||
if placeholder:
|
||||
placeholderStr = ' placeholder="' + placeholder + '"'
|
||||
requiredStr = ''
|
||||
if required:
|
||||
requiredStr = ' required'
|
||||
return \
|
||||
'<label class="labels">' + label + '</label><br>\n' + \
|
||||
' <input type="text" name="' + name + '" value="' + \
|
||||
value + '"' + placeholderStr + '>\n'
|
||||
value + '"' + placeholderStr + requiredStr + '>\n'
|
||||
|
||||
|
||||
def editNumberField(label: str, name: str, value: int = 1,
|
||||
|
|
Loading…
Reference in New Issue