From 37fd33f02f23eeabaa14bc3ea313f215c337e371 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 24 Jan 2024 18:42:32 +0000 Subject: [PATCH] Removed validate function --- public/styles.css | 16 +++++++--------- src/functions.js | 40 +--------------------------------------- src/server.js | 4 ++++ views/formPage.ejs | 4 ++++ 4 files changed, 16 insertions(+), 48 deletions(-) diff --git a/public/styles.css b/public/styles.css index cddd9b3..996c978 100644 --- a/public/styles.css +++ b/public/styles.css @@ -27,7 +27,6 @@ body { h1 { font-family: var(--font-titles); - text-align: center; } p { @@ -63,26 +62,25 @@ form { display: flex; flex-direction: column; flex-wrap: wrap; - background-color: var(--neutral); - + border: 0.3rem solid var(--neutral); + border-radius: 2px; padding: 1rem; width: auto; max-width: 100%; } -.backForm { - background: none; - padding: 0; -} +.backForm, .deleteForm { background: none; padding: 0; + border: none; } .nameAndDate { font-style: italic; justify-content: flex-end; font-size: small; + margin-bottom: 0.3rem; } ul { @@ -91,11 +89,11 @@ ul { } li { - background-color: var(--neutral); + border: 0.3rem solid var(--neutral); margin-bottom: 1rem; padding: 1rem; border-radius: 2px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + box-shadow: 6px 2px 4px rgba(0, 0, 0, 0.4); gap: 0.5 rem; } diff --git a/src/functions.js b/src/functions.js index 171dcae..7551946 100644 --- a/src/functions.js +++ b/src/functions.js @@ -1,33 +1,3 @@ -// function home(errors = {}, values = {}) { -// const title = 'Create post' -// const needBack = false -// const content = /*html*/ ` -//

New post

-//
-//

-// -// -// ${validation(errors.nickname)} -//

-//

-// -// -// ${validation(errors.message)} -//

-// -//
-// ` -// return layout(title, content, needBack) -// } - function sanitize(string) { return string .replace(/&/g, '&') @@ -37,12 +7,4 @@ function sanitize(string) { .replace(/'/g, ''') } -function validation(message) { - if (message) { - return `${message}` - } else { - return '' - } -} - -module.exports = { sanitize, validation } +module.exports = { sanitize } diff --git a/src/server.js b/src/server.js index 217d7ba..d7da562 100644 --- a/src/server.js +++ b/src/server.js @@ -73,4 +73,8 @@ server.post('/back', (req, res) => { res.redirect('/') }) +server.post('/showPosts', (req, res) => { + res.redirect('/posts') +}) + module.exports = server diff --git a/views/formPage.ejs b/views/formPage.ejs index e17413c..06863d4 100644 --- a/views/formPage.ejs +++ b/views/formPage.ejs @@ -28,5 +28,9 @@ +

+
+ +