mirror of https://gitgud.io/fatchan/jschan.git
add required fields in html forms and add * to labels according to board settings for required OP subject, message or file.
parent
3a03351a80
commit
2c6ee4d9ee
11 changed files with 64 additions and 34 deletions
@ -0,0 +1,4 @@ |
|||||||
|
section.board-header |
||||||
|
img.board-banner(src=`/banners?board=${board._id}` width='300' height='100') |
||||||
|
br |
||||||
|
h1.board-title Catalog (#[a.no-decoration(href=`/${board._id}/index.html`) /#{board._id}/]) |
@ -1,48 +1,58 @@ |
|||||||
|
- const isThread = thread != null |
||||||
section.form-wrapper.flex-center |
section.form-wrapper.flex-center |
||||||
a.toggle-summary(href='#postform') Show Post Form |
a.toggle-summary(href='#postform') Show Post Form |
||||||
form.form-post#postform(action=`/forms/board/${board._id}/post`, enctype='multipart/form-data', method='POST') |
form.form-post#postform(action=`/forms/board/${board._id}/post`, enctype='multipart/form-data', method='POST') |
||||||
input(type='hidden' name='thread' value=thread != null ? thread.postId : null) |
input(type='hidden' name='thread' value=isThread ? thread.postId : null) |
||||||
unless board.settings.forceAnon |
unless board.settings.forceAnon |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Name |
.postform-label Name |
||||||
input#name(type='text', name='name', placeholder=board.settings.defaultName autocomplete='off' maxlength='50') |
input(type='text', name='name', placeholder=board.settings.defaultName autocomplete='off' maxlength='50') |
||||||
a.close.postform-style.ml-1(href='#!') X |
a.close.postform-style.ml-1(href='#!') X |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Subject |
.postform-label Subject |
||||||
input#title(type='text', name='subject', autocomplete='off' maxlength='50') |
if !isThread && board.settings.forceOPSubject |
||||||
|
.required * |
||||||
|
input(type='text', name='subject', autocomplete='off' maxlength='50' required=!isThread && board.settings.forceOPSubject) |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Email |
.postform-label Email |
||||||
input#name(type='text', name='email', autocomplete='off' maxlength='50') |
input(type='text', name='email', autocomplete='off' maxlength='50') |
||||||
else |
else |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Sage |
.postform-label Sage |
||||||
label.postform-style.ph-5 |
label.postform-style.ph-5 |
||||||
input#spoiler(type='checkbox', name='email', value='sage') |
input(type='checkbox', name='email', value='sage') |
||||||
| Sage |
| Sage |
||||||
a.close.postform-style.ml-1(href='#!') X |
a.close.postform-style.ml-1(href='#!') X |
||||||
if !thread |
if !isThread |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Subject |
.postform-label Subject |
||||||
input#title(type='text', name='subject', autocomplete='off' maxlength='50') |
if board.settings.forceOPSubject |
||||||
|
.required * |
||||||
|
input(type='text', name='subject', autocomplete='off' maxlength='50' required=board.settings.forceOPSubject) |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Message |
.postform-label Message |
||||||
textarea#message(name='message', rows='5', autocomplete='off' maxlength='4000') |
if !isThread && board.settings.forceOPMessage |
||||||
|
.required * |
||||||
|
textarea(name='message', rows='5', autocomplete='off' maxlength='4000' required=!isThread && board.settings.forceOPMessage) |
||||||
if board.settings.maxFiles !== 0 |
if board.settings.maxFiles !== 0 |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Files |
.postform-label Files |
||||||
input#file(type='file', name='file' multiple) |
if !isThread && board.settings.forceOPFile |
||||||
|
.required * |
||||||
|
input(type='file', name='file' multiple required=!isThread && board.settings.forceOPFile) |
||||||
if board.settings.userPostSpoiler |
if board.settings.userPostSpoiler |
||||||
label.postform-style.ph-5.ml-1 |
label.postform-style.ph-5.ml-1 |
||||||
input#spoiler(type='checkbox', name='spoiler', value='true') |
input(type='checkbox', name='spoiler', value='true') |
||||||
| Spoiler |
| Spoiler |
||||||
if board.settings.userPostSpoiler || board.settings.userPostDelete || board.settings.userPostUnlink |
if board.settings.userPostSpoiler || board.settings.userPostDelete || board.settings.userPostUnlink |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Password |
.postform-label Password |
||||||
input#password(type='password', name='password', autocomplete='off' placeholder='password to delete/spoiler/unlink later' maxlength='50') |
input(type='password', name='password', autocomplete='off' placeholder='password to delete/spoiler/unlink later' maxlength='50') |
||||||
if board.settings.captcha |
if board.settings.captcha |
||||||
section.postform-row |
section.postform-row |
||||||
.postform-label Captcha |
.postform-label Captcha |
||||||
|
.required * |
||||||
.postform-col |
.postform-col |
||||||
iframe.captcha(src='/captcha.html' width=200 height=110 scrolling='no') |
iframe.captcha(src='/captcha.html' width=200 height=110 scrolling='no') |
||||||
input#captcha(type='text', name='captcha', autocomplete='off' placeholder='captcha text' maxlength='6') |
input(type='text', name='captcha', autocomplete='off' placeholder='captcha text' maxlength='6' required) |
||||||
input(type='submit', value=`New ${threads ? 'Thread' : 'Reply'}`) |
input(type='submit', value=`New ${isThread ? 'Reply' : 'Thread'}`) |
||||||
|
Loading…
Reference in new issue