From 7c0f060e14581d66bee0dc25fe883c56a5c2e10f Mon Sep 17 00:00:00 2001 From: JWLD Date: Wed, 7 Jun 2017 09:39:52 +0300 Subject: [PATCH] create add product form #53 --- public/scripts/new_product.js | 3 +++ public/style/sass/_form.scss | 2 +- public/style/sass/_reset.scss | 2 +- src/routes/new_product.js | 5 +++++ src/routes/router.js | 7 ++++--- views/new_product.hbs | 34 ++++++++++++++++++++++++++++++++++ views/partials/header.hbs | 2 +- 7 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 public/scripts/new_product.js create mode 100644 src/routes/new_product.js create mode 100644 views/new_product.hbs diff --git a/public/scripts/new_product.js b/public/scripts/new_product.js new file mode 100644 index 0000000..bccde28 --- /dev/null +++ b/public/scripts/new_product.js @@ -0,0 +1,3 @@ +(function() { + console.log(123); +})(); diff --git a/public/style/sass/_form.scss b/public/style/sass/_form.scss index 1e699b6..770a551 100644 --- a/public/style/sass/_form.scss +++ b/public/style/sass/_form.scss @@ -33,7 +33,7 @@ } } - input, textarea { + input, textarea, select { width: 100%; margin-top: .5rem; padding: .5rem 0; diff --git a/public/style/sass/_reset.scss b/public/style/sass/_reset.scss index 5d5326a..e3b5c51 100644 --- a/public/style/sass/_reset.scss +++ b/public/style/sass/_reset.scss @@ -1,4 +1,4 @@ -body, header, h1, a, div, input, textarea, p { +body, header, h1, a, div, input, textarea, p, select { margin: 0; padding: 0; border: 0; diff --git a/src/routes/new_product.js b/src/routes/new_product.js new file mode 100644 index 0000000..f6d2a82 --- /dev/null +++ b/src/routes/new_product.js @@ -0,0 +1,5 @@ +module.exports = (req, res) => { + res.render('new_product', { + title: 'Add New Product' + }); +}; diff --git a/src/routes/router.js b/src/routes/router.js index 1029141..4d4e0e2 100644 --- a/src/routes/router.js +++ b/src/routes/router.js @@ -1,14 +1,15 @@ const router = require('express').Router(); const auth = require('./validate.js'); -router.post('/authenticate', require('./authenticate')); +router.post('/authenticate', require('./authenticate.js')); router.get('/', require('./home.js')); router.get('/register', require('./register.js')); router.get('/login', require('./login.js')); router.get('/create', auth, require('./create.js')); -router.get('/sign-s3', require('./sign_s3')); +router.get('/sign-s3', require('./sign_s3.js')); router.post('/add-user', require('./add_user.js')); router.post('/add-profile', require('./add_profile.js')); -router.get('/profile', require('./profile')); +router.get('/profile', require('./profile.js')); +router.get('/new-product', require('./new_product.js')); module.exports = router; diff --git a/views/new_product.hbs b/views/new_product.hbs new file mode 100644 index 0000000..5356e7d --- /dev/null +++ b/views/new_product.hbs @@ -0,0 +1,34 @@ +{{>header}} + +
+
+
+ + + + + + + +
+ +
+
+ + diff --git a/views/partials/header.hbs b/views/partials/header.hbs index 08064ef..8d7aef7 100644 --- a/views/partials/header.hbs +++ b/views/partials/header.hbs @@ -2,7 +2,7 @@

{{title}}