Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clan update and create message validations #531

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion public/styles/abstracts/_mixins.sass
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ button
font-size: 0.75em
margin: 0.25em
padding: 0.5em

.bigButton
@include button
font-size: 1em
margin: 0.75em
padding: 1em
.descriptionMain
//background-color: variables.$background-secondary
padding: 10px
Expand Down
7 changes: 4 additions & 3 deletions src/backend/routes/views/clans/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ module.exports = [
)
.notEmpty()
.isLength({ max: 3 }),
body('clan_description', 'Please add a description for your clan')
.notEmpty()
.isLength({ max: 1000 }),
body('clan_description', 'Cannot exceed 1000 characters').isLength({
max: 1000,
}),
body('clan_description', 'Cannot be empty').notEmpty(),
body('clan_name', "Please indicate your clan's name")
.notEmpty()
.isLength({ max: 40 }),
Expand Down
7 changes: 4 additions & 3 deletions src/backend/routes/views/clans/post/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ exports = module.exports = [
)
.notEmpty()
.isLength({ max: 3 }),
body('clan_description', 'Please add a description for your clan')
.notEmpty()
.isLength({ max: 1000 }),
body('clan_description', 'Cannot exceed 1000 characters').isLength({
max: 1000,
}),
body('clan_description', 'Cannot be empty').notEmpty(),
body('clan_name', "Please indicate your clan's name")
.notEmpty()
.isLength({ max: 40 }),
Expand Down
4 changes: 2 additions & 2 deletions src/backend/templates/views/clans/create.pug
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ block content
name='clan_description',
title='description',
required='required',
placeholder='The description players will see when they look your clan'
placeholder='The description players will see when they view your clan'
) #{ clan_description }
br

button.bigButton(type='submit') Create your Clan
button.bigButton(type='submit') Create Your Clan
6 changes: 3 additions & 3 deletions src/backend/templates/views/clans/manage.pug
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ block content
name='clan_description',
title='description',
required='required',
placeholder='The description players will see when they look your clan'
placeholder='The description players will see when they view your clan'
) #{ clan_description }
br

button(type='submit') Update Clan Settings
button.bigButton(type='submit') Update Clan Settings
br
br
hr
Expand All @@ -56,5 +56,5 @@ block content
action='/clans/destroy',
onsubmit='return confirm(\'THIS OPERATION IS DEFINITIVE. Press OK to confirm you want to delete your clan\');'
)
button(type='submit') Delete my clan
button(type='submit') Delete My Clan
br