diff --git a/gulp/res/css/style.css b/gulp/res/css/style.css index 68eb9465..03b1464b 100644 --- a/gulp/res/css/style.css +++ b/gulp/res/css/style.css @@ -174,11 +174,15 @@ object { border-style: solid none; } -.title { +.title, .required { color: maroon; font-weight: bold; } +.required { + margin-left: 5px; +} + .pinktext { color: #E0727F; } @@ -546,8 +550,7 @@ input[type="file"] { min-width: 80px; background: #98E; display: flex; - justify-content: center; - flex-direction: column; + align-items: center; font-weight: bold; margin-right: 1px; } diff --git a/helpers/files/deletetempfiles.js b/helpers/files/deletetempfiles.js index 6a383e10..1f49347e 100644 --- a/helpers/files/deletetempfiles.js +++ b/helpers/files/deletetempfiles.js @@ -2,7 +2,7 @@ const remove = require('fs-extra').remove; -module.exports = async (req) => { +module.exports = (req) => { if (req.files != null) { let files = []; diff --git a/models/pages/captcha.js b/models/pages/captcha.js index 56ad8d46..ef35b636 100644 --- a/models/pages/captcha.js +++ b/models/pages/captcha.js @@ -21,7 +21,8 @@ module.exports = async (req, res, next) => { .cookie('captchaid', captchaId.toString(), { 'maxAge': 5*60*1000, //5 minute cookie 'httpOnly': true, - 'secure': true + 'secure': true, + 'sameSite': 'lax' }) .redirect(`/captcha/${captchaId}.jpg`); diff --git a/views/includes/actionfooter.pug b/views/includes/actionfooter.pug index f808f22b..c3ac4edc 100644 --- a/views/includes/actionfooter.pug +++ b/views/includes/actionfooter.pug @@ -24,8 +24,8 @@ details.toggle-label | Global Report label input#report(type='text', name='report_reason', placeholder='report reason' autocomplete='off') - .actions - h4.no-m-p Staff Actions: + details.actions + summary(style='font-weight: bold') Staff Actions: label input.post-check(type='checkbox', name='delete_ip_board' value=1) | Delete from IP on board @@ -58,5 +58,5 @@ details.toggle-label .actions h4.no-m-p Captcha: 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#captcha(type='text', name='captcha', autocomplete='off' placeholder='captcha text' maxlength='6' required) input(type='submit', value='submit') diff --git a/views/includes/catalogheader.pug b/views/includes/catalogheader.pug new file mode 100644 index 00000000..70d632cc --- /dev/null +++ b/views/includes/catalogheader.pug @@ -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}/]) diff --git a/views/includes/postform.pug b/views/includes/postform.pug index 1a98b250..9cf38708 100644 --- a/views/includes/postform.pug +++ b/views/includes/postform.pug @@ -1,48 +1,58 @@ +- const isThread = thread != null section.form-wrapper.flex-center a.toggle-summary(href='#postform') Show Post Form 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 section.postform-row .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 section.postform-row .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 .postform-label Email - input#name(type='text', name='email', autocomplete='off' maxlength='50') + input(type='text', name='email', autocomplete='off' maxlength='50') else section.postform-row .postform-label Sage label.postform-style.ph-5 - input#spoiler(type='checkbox', name='email', value='sage') + input(type='checkbox', name='email', value='sage') | Sage a.close.postform-style.ml-1(href='#!') X - if !thread + if !isThread section.postform-row .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 .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 section.postform-row .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 label.postform-style.ph-5.ml-1 - input#spoiler(type='checkbox', name='spoiler', value='true') + input(type='checkbox', name='spoiler', value='true') | Spoiler if board.settings.userPostSpoiler || board.settings.userPostDelete || board.settings.userPostUnlink section.postform-row .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 section.postform-row .postform-label Captcha + .required * .postform-col 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='submit', value=`New ${threads ? 'Thread' : 'Reply'}`) + input(type='text', name='captcha', autocomplete='off' placeholder='captcha text' maxlength='6' required) + input(type='submit', value=`New ${isThread ? 'Reply' : 'Thread'}`) diff --git a/views/pages/catalog.pug b/views/pages/catalog.pug index be09ee56..7d5c6f64 100644 --- a/views/pages/catalog.pug +++ b/views/pages/catalog.pug @@ -5,7 +5,7 @@ block head title /#{board._id}/ - Catalog block content - include ../includes/boardheader.pug + include ../includes/catalogheader.pug br include ../includes/postform.pug br diff --git a/views/pages/changepassword.pug b/views/pages/changepassword.pug index daba045a..a0c0b0a8 100644 --- a/views/pages/changepassword.pug +++ b/views/pages/changepassword.pug @@ -9,19 +9,24 @@ block content //input(type='hidden' name='_csrf' value=csrf) section.postform-row .postform-label Username - input#username(type='text', name='username', maxlength='50') + .required * + input#username(type='text', name='username', maxlength='50' required) section.postform-row .postform-label Existing Password - input#password(type='password', name='password', maxlength='100') + .required * + input#password(type='password', name='password', maxlength='100' required) section.postform-row .postform-label New Password - input#password(type='password', name='newpassword', maxlength='100') + .required * + input#password(type='password', name='newpassword', maxlength='100' required) section.postform-row .postform-label Confirm New Password - input#password(type='password', name='newpasswordconfirm', maxlength='100') + .required * + input#password(type='password', name='newpasswordconfirm', maxlength='100' required) section.postform-row .postform-label Captcha + .required * span.postform-col 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#captcha(type='text', name='captcha', autocomplete='off' placeholder='captcha text' maxlength='6' required) input(type='submit', value='Change Password') diff --git a/views/pages/login.pug b/views/pages/login.pug index b9f19ca2..b9d59247 100644 --- a/views/pages/login.pug +++ b/views/pages/login.pug @@ -9,10 +9,12 @@ block content //input(type='hidden' name='_csrf' value=csrf) section.postform-row .postform-label Username - input#username(type='text', name='username', maxlength='50') + .required * + input#username(type='text', name='username', maxlength='50' required) section.postform-row .postform-label Password - input#password(type='password', name='password', maxlength='100') + .required * + input#password(type='password', name='password', maxlength='100' required) input(type='submit', value='submit') p No account? #[a(href='/register.html') Register] diff --git a/views/pages/manage.pug b/views/pages/manage.pug index 136f9134..97a484de 100644 --- a/views/pages/manage.pug +++ b/views/pages/manage.pug @@ -71,7 +71,8 @@ block content input(type='hidden' name='_csrf' value=csrf) section.postform-row .postform-label Upload - input#file(type='file', name='file' multiple) + .required * + input#file(type='file', name='file' multiple required) input(type='submit', value='submit') hr(size=1) if board.banners.length > 0 diff --git a/views/pages/register.pug b/views/pages/register.pug index 96f3c86e..9ad73ebe 100644 --- a/views/pages/register.pug +++ b/views/pages/register.pug @@ -9,17 +9,21 @@ block content //input(type='hidden' name='_csrf' value=csrf) section.postform-row .postform-label Username - input#username(type='text', name='username', maxlength='50') + .required * + input#username(type='text', name='username', maxlength='50' required) section.postform-row .postform-label Password - input#password(type='password', name='password', maxlength='100') + .required * + input#password(type='password', name='password', maxlength='100' required) section.postform-row .postform-label Confirm Password - input#password(type='password', name='passwordconfirm', maxlength='100') + .required * + input#password(type='password', name='passwordconfirm', maxlength='100' required) section.postform-row .postform-label Captcha + .required * span.postform-col 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#captcha(type='text', name='captcha', autocomplete='off' placeholder='captcha text' maxlength='6' required) input(type='submit', value='Register') p Already have an account? #[a(href='/login.html') Login]