├── .gitignore ├── readme.md ├── starter-files ├── .npmrc ├── app.js ├── controllers │ └── .gitkeep ├── data │ ├── load-sample-data.js │ ├── reviews.json │ ├── stores.json │ └── users.json ├── handlers │ └── errorHandlers.js ├── helpers.js ├── models │ └── .gitkeep ├── package-lock.json ├── package.json ├── public │ ├── fonts │ │ ├── panama-bold-webfont.woff │ │ └── panama-bold-webfont.woff2 │ ├── images │ │ ├── icons │ │ │ ├── add.svg │ │ │ ├── cog.svg │ │ │ ├── doughnut.png │ │ │ ├── heart.svg │ │ │ ├── logo.svg │ │ │ ├── logout.svg │ │ │ ├── map.svg │ │ │ ├── pencil.svg │ │ │ ├── review.svg │ │ │ ├── store.svg │ │ │ ├── store2.svg │ │ │ ├── tag.svg │ │ │ └── top.svg │ │ └── photos │ │ │ ├── 1.jpg │ │ │ ├── 10.jpg │ │ │ ├── 11.jpeg │ │ │ ├── 12.jpg │ │ │ ├── 13.jpeg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ ├── 7.jpg │ │ │ ├── 8.jpg │ │ │ └── 9.jpg │ ├── javascripts │ │ ├── delicious-app.js │ │ └── modules │ │ │ └── bling.js │ ├── sass │ │ ├── partials │ │ │ ├── _credits.scss │ │ │ ├── _flashes.scss │ │ │ ├── _forms.scss │ │ │ ├── _heart.scss │ │ │ ├── _helpers.scss │ │ │ ├── _layout.scss │ │ │ ├── _map.scss │ │ │ ├── _nav.scss │ │ │ ├── _normalize.scss │ │ │ ├── _pagination.scss │ │ │ ├── _reviewer.scss │ │ │ ├── _reviews.scss │ │ │ ├── _search.scss │ │ │ ├── _single.scss │ │ │ ├── _store.scss │ │ │ ├── _table.scss │ │ │ ├── _tag.scss │ │ │ ├── _typography.scss │ │ │ └── _variables.scss │ │ └── style.scss │ └── uploads │ │ ├── .gitkeep │ │ ├── 0d3624fc-78ee-4297-8d15-e191b9775520.jpeg │ │ ├── 1b7870df-e238-4104-be4c-a267bd5f6257.jpeg │ │ ├── 3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg │ │ ├── 4a5cb791-0140-4fa2-864c-af786640157d.jpeg │ │ ├── 6c34119d-b9fd-4051-911e-948a16068229.jpeg │ │ ├── 6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg │ │ ├── 7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg │ │ ├── 7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg │ │ ├── 7ea7c02c-9054-442a-9126-788bf3471499.jpeg │ │ ├── 96a33834-d7aa-4758-b980-fca901ea5956.jpeg │ │ ├── 9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg │ │ ├── a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg │ │ ├── a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg │ │ ├── b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg │ │ ├── bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg │ │ ├── c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg │ │ ├── e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg │ │ └── store.png ├── readme.md ├── routes │ └── index.js ├── start.js ├── variables.env.sample ├── views │ ├── email │ │ ├── email-layout.pug │ │ ├── password-reset.pug │ │ └── styles.css │ ├── error.pug │ ├── layout.pug │ └── mixins │ │ └── .gitkeep └── webpack.config.js └── stepped-solutions ├── 10 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ └── mixins │ └── .gitkeep ├── 11 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ └── mixins │ ├── .gitkeep │ └── _storeForm.pug ├── 12 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ └── mixins │ ├── .gitkeep │ └── _storeForm.pug ├── 14 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ └── stores.pug ├── 15 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ └── stores.pug ├── 16 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ └── stores.pug ├── 17 └── public │ └── javascripts │ ├── delicious-app.js │ └── modules │ ├── autocomplete.js │ └── bling.js ├── 18 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ └── stores.pug ├── 19 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ └── stores.pug ├── 20 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── store.pug │ └── stores.pug ├── 21 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── store.pug │ └── stores.pug ├── 22 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 23 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── models │ ├── .gitkeep │ └── Store.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── mixins │ ├── .gitkeep │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 24 ├── controllers │ ├── .gitkeep │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── public │ ├── dist │ │ ├── App.bundle.js │ │ ├── App.bundle.js.map │ │ ├── style.css │ │ └── style.css.map │ ├── images │ │ ├── icons │ │ │ ├── add.svg │ │ │ ├── cog.svg │ │ │ ├── doughnut.png │ │ │ ├── heart.svg │ │ │ ├── logo.svg │ │ │ ├── logout.svg │ │ │ ├── map.svg │ │ │ ├── pencil.svg │ │ │ ├── review.svg │ │ │ ├── store.svg │ │ │ ├── store2.svg │ │ │ ├── tag.svg │ │ │ └── top.svg │ │ └── photos │ │ │ ├── 1.jpg │ │ │ ├── 10.jpg │ │ │ ├── 11.jpeg │ │ │ ├── 12.jpg │ │ │ ├── 13.jpeg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ ├── 7.jpg │ │ │ ├── 8.jpg │ │ │ └── 9.jpg │ ├── javascripts │ │ ├── delicious-app.js │ │ └── modules │ │ │ ├── autocomplete.js │ │ │ └── bling.js │ ├── sass │ │ ├── partials │ │ │ ├── _credits.scss │ │ │ ├── _flashes.scss │ │ │ ├── _forms.scss │ │ │ ├── _heart.scss │ │ │ ├── _helpers.scss │ │ │ ├── _layout.scss │ │ │ ├── _map.scss │ │ │ ├── _nav.scss │ │ │ ├── _normalize.scss │ │ │ ├── _pagination.scss │ │ │ ├── _reviewer.scss │ │ │ ├── _reviews.scss │ │ │ ├── _search.scss │ │ │ ├── _single.scss │ │ │ ├── _store.scss │ │ │ ├── _table.scss │ │ │ ├── _tag.scss │ │ │ ├── _typography.scss │ │ │ └── _variables.scss │ │ └── style.scss │ └── uploads │ │ ├── .gitkeep │ │ ├── 0d3624fc-78ee-4297-8d15-e191b9775520.jpeg │ │ ├── 1b7870df-e238-4104-be4c-a267bd5f6257.jpeg │ │ ├── 2eb3b200-74f5-4f14-8c2c-7b6f55d3f1f1.jpeg │ │ ├── 3057b89b-92dc-4626-bd4c-3af7a699ce18.jpeg │ │ ├── 3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg │ │ ├── 4a5cb791-0140-4fa2-864c-af786640157d.jpeg │ │ ├── 6c34119d-b9fd-4051-911e-948a16068229.jpeg │ │ ├── 6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg │ │ ├── 7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg │ │ ├── 7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg │ │ ├── 7ea7c02c-9054-442a-9126-788bf3471499.jpeg │ │ ├── 96a33834-d7aa-4758-b980-fca901ea5956.jpeg │ │ ├── 9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg │ │ ├── a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg │ │ ├── a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg │ │ ├── b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg │ │ ├── b79b2792-cb22-490e-ab3f-a06ce10f7a9f.jpeg │ │ ├── bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg │ │ ├── c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg │ │ ├── e30fbc3d-c6c4-45e9-8281-4d1e92768e8f.jpeg │ │ ├── e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg │ │ ├── e710830e-11bf-4593-8a9f-3b6f20abbdb6.jpeg │ │ └── store.png └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 25 ├── app.js ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 26 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 27 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 28 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 29 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 31 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 32 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 33 └── public │ └── javascripts │ ├── delicious-app.js │ └── modules │ ├── autocomplete.js │ ├── bling.js │ └── typeAhead.js ├── 34 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 35 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js └── public │ └── javascripts │ ├── delicious-app.js │ └── modules │ ├── autocomplete.js │ ├── bling.js │ ├── map.js │ └── typeAhead.js ├── 36 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Store.js │ └── User.js ├── public │ └── javascripts │ │ ├── delicious-app.js │ │ └── modules │ │ ├── autocomplete.js │ │ ├── bling.js │ │ ├── heart.js │ │ ├── map.js │ │ └── typeAhead.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── map.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 37 └── controllers │ ├── .gitkeep │ ├── authController.js │ ├── storeController.js │ └── userController.js ├── 38 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── reviewController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Review.js │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── map.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _reviewForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 39 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── reviewController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Review.js │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── map.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _review.pug │ ├── _reviewForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ └── tag.pug ├── 40 ├── controllers │ ├── .gitkeep │ ├── authController.js │ ├── reviewController.js │ ├── storeController.js │ └── userController.js ├── models │ ├── .gitkeep │ ├── Review.js │ ├── Store.js │ └── User.js ├── routes │ └── index.js └── views │ ├── account.pug │ ├── editStore.pug │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ ├── login.pug │ ├── map.pug │ ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _review.pug │ ├── _reviewForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug │ ├── register.pug │ ├── reset.pug │ ├── store.pug │ ├── stores.pug │ ├── tag.pug │ └── topStores.pug ├── 09 ├── controllers │ ├── .gitkeep │ └── storeController.js ├── routes │ └── index.js └── views │ ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css │ ├── error.pug │ ├── hello.pug │ ├── index.pug │ ├── layout.pug │ └── mixins │ └── .gitkeep └── 45 - Finished App ├── .npmrc ├── app.js ├── controllers ├── .gitkeep ├── authController.js ├── reviewController.js ├── storeController.js └── userController.js ├── data ├── load-sample-data.js ├── reviews.json ├── stores.json └── users.json ├── handlers ├── errorHandlers.js ├── mail.js └── passport.js ├── helpers.js ├── models ├── .gitkeep ├── Review.js ├── Store.js └── User.js ├── package-lock.json ├── package.json ├── public ├── fonts │ ├── panama-bold-webfont.woff │ └── panama-bold-webfont.woff2 ├── images │ ├── icons │ │ ├── add.svg │ │ ├── cog.svg │ │ ├── doughnut.png │ │ ├── heart.svg │ │ ├── logo.svg │ │ ├── logout.svg │ │ ├── map.svg │ │ ├── pencil.svg │ │ ├── review.svg │ │ ├── store.svg │ │ ├── store2.svg │ │ ├── tag.svg │ │ └── top.svg │ └── photos │ │ ├── 1.jpg │ │ ├── 10.jpg │ │ ├── 11.jpeg │ │ ├── 12.jpg │ │ ├── 13.jpeg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ └── 9.jpg ├── javascripts │ ├── delicious-app.js │ └── modules │ │ ├── autocomplete.js │ │ ├── bling.js │ │ ├── heart.js │ │ ├── map.js │ │ └── typeAhead.js ├── sass │ ├── partials │ │ ├── _credits.scss │ │ ├── _flashes.scss │ │ ├── _forms.scss │ │ ├── _heart.scss │ │ ├── _helpers.scss │ │ ├── _layout.scss │ │ ├── _map.scss │ │ ├── _nav.scss │ │ ├── _normalize.scss │ │ ├── _pagination.scss │ │ ├── _reviewer.scss │ │ ├── _reviews.scss │ │ ├── _search.scss │ │ ├── _single.scss │ │ ├── _store.scss │ │ ├── _table.scss │ │ ├── _tag.scss │ │ ├── _typography.scss │ │ └── _variables.scss │ └── style.scss └── uploads │ ├── .gitkeep │ ├── 0d3624fc-78ee-4297-8d15-e191b9775520.jpeg │ ├── 1068a0db-ccda-4b92-a8c8-30e127a4e5d1.jpeg │ ├── 1b7870df-e238-4104-be4c-a267bd5f6257.jpeg │ ├── 2eb3b200-74f5-4f14-8c2c-7b6f55d3f1f1.jpeg │ ├── 3057b89b-92dc-4626-bd4c-3af7a699ce18.jpeg │ ├── 3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg │ ├── 4a5cb791-0140-4fa2-864c-af786640157d.jpeg │ ├── 6c34119d-b9fd-4051-911e-948a16068229.jpeg │ ├── 6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg │ ├── 7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg │ ├── 7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg │ ├── 7ea7c02c-9054-442a-9126-788bf3471499.jpeg │ ├── 9251a9e5-8e7d-45ab-9157-8950107dc94d.jpeg │ ├── 96a33834-d7aa-4758-b980-fca901ea5956.jpeg │ ├── 9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg │ ├── a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg │ ├── a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg │ ├── b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg │ ├── b79b2792-cb22-490e-ab3f-a06ce10f7a9f.jpeg │ ├── bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg │ ├── c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg │ ├── c9d72871-3bd6-40c0-86c4-d7343fcbce39.jpeg │ ├── d61e7b49-41ba-4924-8877-9c117a905ac9.jpeg │ ├── e30fbc3d-c6c4-45e9-8281-4d1e92768e8f.jpeg │ ├── e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg │ ├── e710830e-11bf-4593-8a9f-3b6f20abbdb6.jpeg │ └── store.png ├── readme.md ├── routes └── index.js ├── start.js ├── views ├── account.pug ├── editStore.pug ├── email │ ├── email-layout.pug │ ├── password-reset.pug │ └── styles.css ├── error.pug ├── hello.pug ├── index.pug ├── layout.pug ├── login.pug ├── map.pug ├── mixins │ ├── .gitkeep │ ├── _forgot.pug │ ├── _loginForm.pug │ ├── _pagination.pug │ ├── _review.pug │ ├── _reviewForm.pug │ ├── _storeCard.pug │ └── _storeForm.pug ├── register.pug ├── reset.pug ├── store.pug ├── stores.pug ├── tag.pug └── topStores.pug └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | *.log 4 | .idea 5 | dist/ 6 | haters/ 7 | variables.env 8 | variables.env.now 9 | -------------------------------------------------------------------------------- /starter-files/.npmrc: -------------------------------------------------------------------------------- 1 | fund=false 2 | audit=false 3 | legacy-peer-deps=true 4 | -------------------------------------------------------------------------------- /starter-files/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/controllers/.gitkeep -------------------------------------------------------------------------------- /starter-files/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/models/.gitkeep -------------------------------------------------------------------------------- /starter-files/public/fonts/panama-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/fonts/panama-bold-webfont.woff -------------------------------------------------------------------------------- /starter-files/public/fonts/panama-bold-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/fonts/panama-bold-webfont.woff2 -------------------------------------------------------------------------------- /starter-files/public/images/icons/doughnut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/icons/doughnut.png -------------------------------------------------------------------------------- /starter-files/public/images/photos/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/1.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/10.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/11.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/11.jpeg -------------------------------------------------------------------------------- /starter-files/public/images/photos/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/12.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/13.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/13.jpeg -------------------------------------------------------------------------------- /starter-files/public/images/photos/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/2.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/3.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/4.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/5.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/6.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/7.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/8.jpg -------------------------------------------------------------------------------- /starter-files/public/images/photos/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/images/photos/9.jpg -------------------------------------------------------------------------------- /starter-files/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | -------------------------------------------------------------------------------- /starter-files/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_credits.scss: -------------------------------------------------------------------------------- 1 | // Heart by Alfa Design from the Noun Project 2 | // Pencil by Amit Ranjan from the Noun Project 3 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_forms.scss: -------------------------------------------------------------------------------- 1 | input, textarea { 2 | width:100%; 3 | padding:10px; 4 | border: 1px solid $grey; 5 | &.input { 6 | &--error { 7 | border-color: red; 8 | } 9 | } 10 | } 11 | 12 | label { 13 | padding: 10px 0; 14 | display: block; 15 | } 16 | 17 | .form { 18 | background: white; 19 | padding: 2rem; 20 | box-shadow: $grad; 21 | & + .form { 22 | margin-top: 4rem; 23 | } 24 | // I know this isn't bem but meh 25 | h2 { 26 | margin: 0; 27 | font-size: 2rem; 28 | padding-bottom: 2rem; 29 | margin-bottom: 2rem; 30 | border-bottom: 1px solid $grey; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_helpers.scss: -------------------------------------------------------------------------------- 1 | .hide { 2 | text-indent: -999999px; 3 | font-size: 0; 4 | } 5 | 6 | .button { 7 | border: 0; 8 | background: $yellow; 9 | color: $black; 10 | font-family: 'Panama'; 11 | font-weight: 600; 12 | } 13 | 14 | .avatar { 15 | min-width: 50px; 16 | height: 50px; 17 | border-radius: 50%; 18 | align-self: center; 19 | } 20 | 21 | .card { 22 | background: white; 23 | padding: 5rem; 24 | box-shadow: 0 1px 10px rgba(0,0,0,0.15); 25 | } 26 | 27 | pre.error { 28 | padding: 5rem; 29 | background: white; 30 | line-height: 3; 31 | white-space: pre-line; 32 | } 33 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_layout.scss: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 10px; 3 | } 4 | 5 | body { 6 | background: $purple; 7 | background:#efefef; 8 | &:before { 9 | content: ''; 10 | display: block; 11 | background: $grad; 12 | height: 10px; 13 | width: 100%; 14 | } 15 | } 16 | 17 | .inner { 18 | max-width:900px; 19 | margin: 0 auto; 20 | @media all and (max-width: 900px) { 21 | padding: 2rem; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_map.scss: -------------------------------------------------------------------------------- 1 | .map { 2 | padding: 20px; 3 | background: white; 4 | box-shadow: $shad; 5 | } 6 | #map { 7 | height: 500px; 8 | } 9 | 10 | .popup { 11 | width: 300px; 12 | img { 13 | width: 100%; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_table.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | width: 100%; 3 | td { 4 | padding: 5px; 5 | } 6 | tr:nth-child(even) { 7 | background: white; 8 | } 9 | tr:nth-child(odd):not(:first-child) { 10 | background: #f7f7f7; 11 | } 12 | thead tr { 13 | background: $black; 14 | color: white; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /starter-files/public/sass/partials/_variables.scss: -------------------------------------------------------------------------------- 1 | $black: #303030; 2 | $width: 800px; 3 | $purple: #262161; 4 | $yellow: #FFC40E; 5 | $pink: #EE7297; 6 | $green: #93FF00; 7 | $red: #E50714; 8 | $grey: lighten(grey, 40%); 9 | $shad: 0 0 10px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.05); 10 | $grad: linear-gradient(90deg, #48ded4 0%, #a026bf 20%, #e82c75 60%, $yellow 85%, #48ded4 95%); 11 | $verticalGrad: linear-gradient(0, #48ded4 0%, #a026bf 20%, #e82c75 60%, $yellow 85%, #48ded4 95%); 12 | -------------------------------------------------------------------------------- /starter-files/public/sass/style.scss: -------------------------------------------------------------------------------- 1 | @import 'partials/variables'; 2 | @import 'partials/layout'; 3 | @import 'partials/normalize'; 4 | @import 'partials/typography'; 5 | @import 'partials/forms'; 6 | @import 'partials/search'; 7 | @import 'partials/flashes'; 8 | @import 'partials/nav'; 9 | @import 'partials/table'; 10 | @import 'partials/store'; 11 | @import 'partials/tag'; 12 | @import 'partials/single'; 13 | @import 'partials/heart'; 14 | @import 'partials/reviews'; 15 | @import 'partials/reviewer'; 16 | @import 'partials/pagination'; 17 | @import 'partials/map'; 18 | @import 'partials/helpers'; 19 | -------------------------------------------------------------------------------- /starter-files/public/uploads/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/.gitkeep -------------------------------------------------------------------------------- /starter-files/public/uploads/0d3624fc-78ee-4297-8d15-e191b9775520.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/0d3624fc-78ee-4297-8d15-e191b9775520.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/1b7870df-e238-4104-be4c-a267bd5f6257.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/1b7870df-e238-4104-be4c-a267bd5f6257.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/4a5cb791-0140-4fa2-864c-af786640157d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/4a5cb791-0140-4fa2-864c-af786640157d.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/6c34119d-b9fd-4051-911e-948a16068229.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/6c34119d-b9fd-4051-911e-948a16068229.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/7ea7c02c-9054-442a-9126-788bf3471499.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/7ea7c02c-9054-442a-9126-788bf3471499.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/96a33834-d7aa-4758-b980-fca901ea5956.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/96a33834-d7aa-4758-b980-fca901ea5956.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg -------------------------------------------------------------------------------- /starter-files/public/uploads/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/public/uploads/store.png -------------------------------------------------------------------------------- /starter-files/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | 4 | // Do work here 5 | router.get('/', (req, res) => { 6 | res.send('Hey! It works!'); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /starter-files/variables.env.sample: -------------------------------------------------------------------------------- 1 | NODE_ENV=development 2 | DATABASE=mongodb://user:pass@host.com:port/database 3 | MAIL_USER=123 4 | MAIL_PASS=123 5 | MAIL_HOST=smtp.mailtrap.io 6 | MAIL_PORT=2525 7 | PORT=7777 8 | MAP_KEY=AIzaSyD9ycobB5RiavbXpJBo0Muz2komaqqvGv0 9 | SECRET=snickers 10 | KEY=sweetsesh 11 | -------------------------------------------------------------------------------- /starter-files/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /starter-files/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /starter-files/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/starter-files/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/09/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/09/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/09/controllers/storeController.js: -------------------------------------------------------------------------------- 1 | exports.homePage = (req, res) => { 2 | res.render('index'); 3 | }; 4 | -------------------------------------------------------------------------------- /stepped-solutions/09/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const storeController = require('../controllers/storeController'); 4 | 5 | router.get('/', storeController.homePage); 6 | 7 | module.exports = router; 8 | -------------------------------------------------------------------------------- /stepped-solutions/09/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/09/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/09/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/09/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/09/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/09/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/10/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/10/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/10/controllers/storeController.js: -------------------------------------------------------------------------------- 1 | exports.homePage = (req, res) => { 2 | console.log(req.name); 3 | res.render('index'); 4 | }; 5 | -------------------------------------------------------------------------------- /stepped-solutions/10/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/10/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/10/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const storeController = require('../controllers/storeController'); 4 | 5 | router.get('/', storeController.homePage); 6 | 7 | module.exports = router; 8 | -------------------------------------------------------------------------------- /stepped-solutions/10/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/10/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/10/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/10/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/10/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/10/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/11/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/11/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/11/controllers/storeController.js: -------------------------------------------------------------------------------- 1 | exports.homePage = (req, res) => { 2 | console.log(req.name); 3 | res.render('index'); 4 | }; 5 | 6 | exports.addStore = (req, res) => { 7 | res.render('editStore', { title: 'Add Store' }); 8 | }; 9 | 10 | exports.createStore = (req, res) => { 11 | res.json(req.body); 12 | }; 13 | -------------------------------------------------------------------------------- /stepped-solutions/11/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/11/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/11/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const storeController = require('../controllers/storeController'); 4 | 5 | router.get('/', storeController.homePage); 6 | router.get('/add', storeController.addStore); 7 | router.post('/add', storeController.createStore); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /stepped-solutions/11/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm() 9 | -------------------------------------------------------------------------------- /stepped-solutions/11/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/11/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/11/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/11/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/11/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/11/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/11/views/mixins/_storeForm.pug: -------------------------------------------------------------------------------- 1 | mixin storeForm(store = {}) 2 | form(action="/add" method="POST" class="card") 3 | label(for="name") Name 4 | input(type="text" name="name" id="name") 5 | label(for="description") Description 6 | textarea(name="description" id="description") 7 | - const choices = ['Wifi', 'Open Late', 'Family Friendly', 'Vegetarian', 'Licensed'] 8 | ul.tags 9 | each choice in choices 10 | .tag.tag__choice 11 | input(type="checkbox" id=choice value=choice name="tags") 12 | label(for=choice) #{choice} 13 | input(type="submit" value="Save →" class="button") 14 | -------------------------------------------------------------------------------- /stepped-solutions/12/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/12/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/12/controllers/storeController.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Store = mongoose.model('Store'); 3 | 4 | exports.homePage = (req, res) => { 5 | console.log(req.name); 6 | res.render('index'); 7 | }; 8 | 9 | exports.addStore = (req, res) => { 10 | res.render('editStore', { title: 'Add Store' }); 11 | }; 12 | 13 | exports.createStore = async (req, res) => { 14 | const store = new Store(req.body); 15 | await store.save(); 16 | res.redirect('/'); 17 | }; 18 | -------------------------------------------------------------------------------- /stepped-solutions/12/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/12/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/12/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const storeController = require('../controllers/storeController'); 4 | const { catchErrors } = require('../handlers/errorHandlers'); 5 | 6 | router.get('/', storeController.homePage); 7 | router.get('/add', storeController.addStore); 8 | router.post('/add', catchErrors(storeController.createStore)); 9 | 10 | module.exports = router; 11 | -------------------------------------------------------------------------------- /stepped-solutions/12/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm() 9 | -------------------------------------------------------------------------------- /stepped-solutions/12/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/12/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/12/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/12/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/12/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/12/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/12/views/mixins/_storeForm.pug: -------------------------------------------------------------------------------- 1 | mixin storeForm(store = {}) 2 | form(action="/add" method="POST" class="card") 3 | label(for="name") Name 4 | input(type="text" name="name") 5 | label(for="description") Description 6 | textarea(name="description") 7 | - const choices = ['Wifi', 'Open Late', 'Family Friendly', 'Vegatarian', 'Licensed'] 8 | ul.tags 9 | each choice in choices 10 | .tag.tag__choice 11 | input(type="checkbox" id=choice value=choice name="tags") 12 | label(for=choice) #{choice} 13 | input(type="submit" value="Save →" class="button") 14 | -------------------------------------------------------------------------------- /stepped-solutions/14/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/14/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/14/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/14/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/14/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const storeController = require('../controllers/storeController'); 4 | const { catchErrors } = require('../handlers/errorHandlers'); 5 | 6 | router.get('/', catchErrors(storeController.getStores)); 7 | router.get('/stores', catchErrors(storeController.getStores)); 8 | router.get('/add', storeController.addStore); 9 | router.post('/add', catchErrors(storeController.createStore)); 10 | 11 | 12 | module.exports = router; 13 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm() 9 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/14/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/14/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | button soon 6 | img(src=`/uploads/${store.photo || 'store.png'}`) 7 | h2.title 8 | a(href=`/store/${store.slug}`) #{store.name} 9 | .store__details 10 | p= store.description.split(' ').slice(0, 25).join(' ') 11 | 12 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/mixins/_storeForm.pug: -------------------------------------------------------------------------------- 1 | mixin storeForm(store = {}) 2 | form(action="/add" method="POST" class="card") 3 | label(for="name") Name 4 | input(type="text" name="name") 5 | label(for="description") Description 6 | textarea(name="description") 7 | - const choices = ['Wifi', 'Open Late', 'Family Friendly', 'Vegatarian', 'Licensed'] 8 | ul.tags 9 | each choice in choices 10 | .tag.tag__choice 11 | input(type="checkbox" id=choice value=choice name="tags") 12 | label(for=choice) #{choice} 13 | input(type="submit" value="Save →" class="button") 14 | -------------------------------------------------------------------------------- /stepped-solutions/14/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/15/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/15/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/15/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/15/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/15/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/15/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/15/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/15/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/15/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/15/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/15/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/15/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/15/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/16/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/16/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/16/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/16/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/16/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/16/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/16/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/16/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/16/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/16/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/16/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/16/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/16/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/17/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | import autocomplete from './modules/autocomplete'; 5 | 6 | autocomplete( $('#address'), $('#lat'), $('#lng') ); 7 | -------------------------------------------------------------------------------- /stepped-solutions/17/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /stepped-solutions/18/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/18/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/18/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/18/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/18/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/18/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/18/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/18/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/18/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/18/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/18/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/18/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/18/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/19/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/19/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/19/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/19/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/19/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/19/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/19/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/19/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/19/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/19/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/19/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/19/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/19/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/20/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/20/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/20/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/20/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/20/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/20/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/20/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/store.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .single 5 | .single__hero 6 | img.single__image(src=`/uploads/${store.photo || 'store.png'}`) 7 | h2.title.title--single 8 | a(href=`/store/${store.slug}`) #{store.name} 9 | 10 | .single__details.inner 11 | img.single__map(src=h.staticMap(store.location.coordinates)) 12 | p.single__location= store.location.address 13 | p= store.description 14 | 15 | if store.tags 16 | ul.tags 17 | each tag in store.tags 18 | li.tag 19 | a.tag__link(href=`/tags/${tag}`) 20 | span.tag__text ##{tag} 21 | -------------------------------------------------------------------------------- /stepped-solutions/20/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/21/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/21/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/21/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/21/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/21/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/21/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/21/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/store.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .single 5 | .single__hero 6 | img.single__image(src=`/uploads/${store.photo || 'store.png'}`) 7 | h2.title.title--single 8 | a(href=`/store/${store.slug}`) #{store.name} 9 | 10 | .single__details.inner 11 | img.single__map(src=h.staticMap(store.location.coordinates)) 12 | p.single__location= store.location.address 13 | p= store.description 14 | 15 | if store.tags 16 | ul.tags 17 | each tag in store.tags 18 | li.tag 19 | a.tag__link(href=`/tags/${tag}`) 20 | span.tag__text ##{tag} 21 | -------------------------------------------------------------------------------- /stepped-solutions/21/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/22/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/22/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/22/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/22/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/22/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/22/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/22/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/store.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .single 5 | .single__hero 6 | img.single__image(src=`/uploads/${store.photo || 'store.png'}`) 7 | h2.title.title--single 8 | a(href=`/store/${store.slug}`) #{store.name} 9 | 10 | .single__details.inner 11 | img.single__map(src=h.staticMap(store.location.coordinates)) 12 | p.single__location= store.location.address 13 | p= store.description 14 | 15 | if store.tags 16 | ul.tags 17 | each tag in store.tags 18 | li.tag 19 | a.tag__link(href=`/tags/${tag}`) 20 | span.tag__text ##{tag} 21 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/22/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 #{tag || 'Tags'} 6 | ul.tags 7 | each t in tags 8 | li.tag 9 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 10 | span.tag__text= t._id 11 | span.tag__count= t.count 12 | -------------------------------------------------------------------------------- /stepped-solutions/23/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/23/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/23/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/23/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/23/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/23/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/23/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/store.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .single 5 | .single__hero 6 | img.single__image(src=`/uploads/${store.photo || 'store.png'}`) 7 | h2.title.title--single 8 | a(href=`/store/${store.slug}`) #{store.name} 9 | 10 | .single__details.inner 11 | img.single__map(src=h.staticMap(store.location.coordinates)) 12 | p.single__location= store.location.address 13 | p= store.description 14 | 15 | if store.tags 16 | ul.tags 17 | each tag in store.tags 18 | li.tag 19 | a.tag__link(href=`/tags/${tag}`) 20 | span.tag__text ##{tag} 21 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/23/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/24/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/24/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/icons/doughnut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/icons/doughnut.png -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/1.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/10.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/11.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/11.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/12.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/13.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/13.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/2.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/3.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/4.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/5.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/6.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/7.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/8.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/images/photos/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/images/photos/9.jpg -------------------------------------------------------------------------------- /stepped-solutions/24/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | import autocomplete from './modules/autocomplete'; 5 | 6 | autocomplete( $('#address'), $('#lat'), $('#lng') ); 7 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_credits.scss: -------------------------------------------------------------------------------- 1 | // Heart by Alfa Design from the Noun Project 2 | // Pencil by Amit Ranjan from the Noun Project 3 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_helpers.scss: -------------------------------------------------------------------------------- 1 | .hide { 2 | text-indent: -999999px; 3 | font-size: 0; 4 | } 5 | 6 | .button { 7 | border: 0; 8 | background: $yellow; 9 | color: $black; 10 | font-family: 'Panama'; 11 | font-weight: 600; 12 | } 13 | 14 | .avatar { 15 | min-width: 50px; 16 | height: 50px; 17 | border-radius: 50%; 18 | align-self: center; 19 | } 20 | 21 | .card { 22 | background: white; 23 | padding: 5rem; 24 | box-shadow: 0 1px 10px rgba(0,0,0,0.15); 25 | } 26 | 27 | pre.error { 28 | padding: 5rem; 29 | background: white; 30 | line-height: 3; 31 | white-space: pre-line; 32 | } 33 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_layout.scss: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 10px; 3 | } 4 | 5 | body { 6 | background: $purple; 7 | background:#efefef; 8 | &:before { 9 | content: ''; 10 | display: block; 11 | background: $grad; 12 | height: 10px; 13 | width: 100%; 14 | } 15 | } 16 | 17 | .inner { 18 | max-width:900px; 19 | margin: 0 auto; 20 | @media all and (max-width: 900px) { 21 | padding: 2rem; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_map.scss: -------------------------------------------------------------------------------- 1 | .map { 2 | padding: 20px; 3 | background: white; 4 | box-shadow: $shad; 5 | } 6 | #map { 7 | height: 500px; 8 | } 9 | 10 | .popup { 11 | width: 300px; 12 | img { 13 | width: 100%; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_search.scss: -------------------------------------------------------------------------------- 1 | .search { 2 | position: relative; 3 | width: 100%; 4 | display: flex; 5 | &__results { 6 | background: white; 7 | position: absolute; 8 | width: 100%; 9 | top: 100%; 10 | box-shadow: 0 0 10px rgba(0,0,0,0.2); 11 | z-index: 5; 12 | } 13 | &__input { 14 | font-size: 30px; 15 | background: none; 16 | color: white; 17 | outline: 0; 18 | border: 0; 19 | } 20 | &__result { 21 | padding: 10px; 22 | display: block; 23 | border-bottom: 1px solid #ececec; 24 | &--active { 25 | background: #f1f1f1; 26 | } 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_table.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | width: 100%; 3 | td { 4 | padding: 5px; 5 | } 6 | tr:nth-child(even) { 7 | background: white; 8 | } 9 | tr:nth-child(odd):not(:first-child) { 10 | background: #f7f7f7; 11 | } 12 | thead tr { 13 | background: $black; 14 | color: white; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/partials/_variables.scss: -------------------------------------------------------------------------------- 1 | $black: #303030; 2 | $width: 800px; 3 | $purple: #262161; 4 | $yellow: #FFC40E; 5 | $pink: #EE7297; 6 | $green: #93FF00; 7 | $red: #E50714; 8 | $grey: lighten(grey, 40%); 9 | $shad: 0 0 10px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.05); 10 | $grad: linear-gradient(90deg, #48ded4 0%, #a026bf 20%, #e82c75 60%, $yellow 85%, #48ded4 95%); 11 | $verticalGrad: linear-gradient(0, #48ded4 0%, #a026bf 20%, #e82c75 60%, $yellow 85%, #48ded4 95%); 12 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/sass/style.scss: -------------------------------------------------------------------------------- 1 | @import 'partials/variables'; 2 | @import 'partials/layout'; 3 | @import 'partials/normalize'; 4 | @import 'partials/typography'; 5 | @import 'partials/forms'; 6 | @import 'partials/search'; 7 | @import 'partials/flashes'; 8 | @import 'partials/nav'; 9 | @import 'partials/table'; 10 | @import 'partials/store'; 11 | @import 'partials/tag'; 12 | @import 'partials/single'; 13 | @import 'partials/heart'; 14 | @import 'partials/reviews'; 15 | @import 'partials/reviewer'; 16 | @import 'partials/pagination'; 17 | @import 'partials/map'; 18 | @import 'partials/helpers'; 19 | -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/0d3624fc-78ee-4297-8d15-e191b9775520.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/0d3624fc-78ee-4297-8d15-e191b9775520.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/1b7870df-e238-4104-be4c-a267bd5f6257.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/1b7870df-e238-4104-be4c-a267bd5f6257.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/2eb3b200-74f5-4f14-8c2c-7b6f55d3f1f1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/2eb3b200-74f5-4f14-8c2c-7b6f55d3f1f1.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/3057b89b-92dc-4626-bd4c-3af7a699ce18.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/3057b89b-92dc-4626-bd4c-3af7a699ce18.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/4a5cb791-0140-4fa2-864c-af786640157d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/4a5cb791-0140-4fa2-864c-af786640157d.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/6c34119d-b9fd-4051-911e-948a16068229.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/6c34119d-b9fd-4051-911e-948a16068229.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/7ea7c02c-9054-442a-9126-788bf3471499.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/7ea7c02c-9054-442a-9126-788bf3471499.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/96a33834-d7aa-4758-b980-fca901ea5956.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/96a33834-d7aa-4758-b980-fca901ea5956.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/b79b2792-cb22-490e-ab3f-a06ce10f7a9f.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/b79b2792-cb22-490e-ab3f-a06ce10f7a9f.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/e30fbc3d-c6c4-45e9-8281-4d1e92768e8f.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/e30fbc3d-c6c4-45e9-8281-4d1e92768e8f.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/e710830e-11bf-4593-8a9f-3b6f20abbdb6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/e710830e-11bf-4593-8a9f-3b6f20abbdb6.jpeg -------------------------------------------------------------------------------- /stepped-solutions/24/public/uploads/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/public/uploads/store.png -------------------------------------------------------------------------------- /stepped-solutions/24/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | 5 | block content 6 | .inner 7 | +loginForm() 8 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/24/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/24/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/24/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/25/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/25/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/25/controllers/authController.js: -------------------------------------------------------------------------------- 1 | const passport = require('passport'); 2 | 3 | exports.login = passport.authenticate('local', { 4 | failureRedirect: '/login', 5 | failureFlash: 'Failed Login!', 6 | successRedirect: '/', 7 | successFlash: 'You are now logged in!' 8 | }); 9 | -------------------------------------------------------------------------------- /stepped-solutions/25/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/25/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/25/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | 5 | block content 6 | .inner 7 | +loginForm() 8 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/25/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/25/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/25/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/26/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/26/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/26/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/26/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/26/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | 5 | block content 6 | .inner 7 | +loginForm() 8 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/26/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/26/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/26/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/27/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/27/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/27/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/27/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/27/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | 5 | block content 6 | .inner 7 | +loginForm() 8 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/27/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/27/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/27/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/28/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/28/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/28/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/28/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/28/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/28/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/28/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/28/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/29/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/29/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/29/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/29/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/29/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/29/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/29/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | .store__action.store__action--edit 6 | a(href=`/stores/${store._id}/edit`) 7 | != h.icon('pencil') 8 | img(src=`/uploads/${store.photo || 'store.png'}`) 9 | h2.title 10 | a(href=`/store/${store.slug}`) #{store.name} 11 | .store__details 12 | p= store.description.split(' ').slice(0, 25).join(' ') 13 | 14 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/29/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/31/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/31/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/31/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/31/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/31/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/31/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/31/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | if user && store.author.equals(user._id) 6 | .store__action.store__action--edit 7 | a(href=`/stores/${store._id}/edit`) 8 | != h.icon('pencil') 9 | img(src=`/uploads/${store.photo || 'store.png'}`) 10 | h2.title 11 | a(href=`/store/${store.slug}`) #{store.name} 12 | .store__details 13 | p= store.description.split(' ').slice(0, 25).join(' ') 14 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/31/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/32/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/32/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/32/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/32/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/32/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/32/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/32/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | if user && store.author.equals(user._id) 6 | .store__action.store__action--edit 7 | a(href=`/stores/${store._id}/edit`) 8 | != h.icon('pencil') 9 | img(src=`/uploads/${store.photo || 'store.png'}`) 10 | h2.title 11 | a(href=`/store/${store.slug}`) #{store.name} 12 | .store__details 13 | p= store.description.split(' ').slice(0, 25).join(' ') 14 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/32/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/33/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | import autocomplete from './modules/autocomplete'; 5 | import typeAhead from './modules/typeAhead'; 6 | 7 | autocomplete( $('#address'), $('#lat'), $('#lng') ); 8 | 9 | typeAhead( $('.search') ); 10 | -------------------------------------------------------------------------------- /stepped-solutions/33/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /stepped-solutions/34/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/34/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/34/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/34/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/34/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/34/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/34/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/mixins/_storeCard.pug: -------------------------------------------------------------------------------- 1 | mixin storeCard(store = {}) 2 | .store 3 | .store__hero 4 | .store__actions 5 | if user && store.author.equals(user._id) 6 | .store__action.store__action--edit 7 | a(href=`/stores/${store._id}/edit`) 8 | != h.icon('pencil') 9 | img(src=`/uploads/${store.photo || 'store.png'}`) 10 | h2.title 11 | a(href=`/store/${store.slug}`) #{store.name} 12 | .store__details 13 | p= store.description.split(' ').slice(0, 25).join(' ') 14 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/34/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/35/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/35/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/35/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | import autocomplete from './modules/autocomplete'; 5 | import typeAhead from './modules/typeAhead'; 6 | import makeMap from './modules/map'; 7 | 8 | autocomplete( $('#address'), $('#lat'), $('#lng') ); 9 | 10 | typeAhead( $('.search') ); 11 | 12 | makeMap( $('#map') ); 13 | -------------------------------------------------------------------------------- /stepped-solutions/35/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /stepped-solutions/36/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/36/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/36/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/36/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/36/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | import autocomplete from './modules/autocomplete'; 5 | import typeAhead from './modules/typeAhead'; 6 | import makeMap from './modules/map'; 7 | import ajaxHeart from './modules/heart'; 8 | 9 | autocomplete( $('#address'), $('#lat'), $('#lng') ); 10 | 11 | typeAhead( $('.search') ); 12 | 13 | makeMap( $('#map') ); 14 | 15 | const heartForms = $$('form.heart'); 16 | heartForms.on('submit', ajaxHeart); 17 | -------------------------------------------------------------------------------- /stepped-solutions/36/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/map.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= title 6 | .map 7 | .autocomplete 8 | input.autocomplete__input(type="text" placeholder="Search for Anything" name="geolocate") 9 | #map 10 | p Loading Map... 11 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/36/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/36/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/36/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/37/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/37/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/38/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/38/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/38/controllers/reviewController.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Review = mongoose.model('Review'); 3 | 4 | exports.addReview = async (req, res) => { 5 | req.body.author = req.user._id; 6 | req.body.store = req.params.id; 7 | const newReview = new Review(req.body); 8 | await newReview.save(); 9 | req.flash('success', 'Review Saved!'); 10 | res.redirect('back'); 11 | }; 12 | -------------------------------------------------------------------------------- /stepped-solutions/38/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/38/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/38/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/map.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= title 6 | .map 7 | .autocomplete 8 | input.autocomplete__input(type="text" placeholder="Search for Anything" name="geolocate") 9 | #map 10 | p Loading Map... 11 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/38/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/38/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/mixins/_reviewForm.pug: -------------------------------------------------------------------------------- 1 | mixin reviewForm(store) 2 | form.reviewer(action=`/reviews/${store._id}` method="POST") 3 | textarea(name="text" placeholder="Did you try this place? Have something to say? Leave a review...") 4 | .reviewer__meta 5 | .reviewer__stars 6 | each num in [5,4,3,2,1] 7 | input(type="radio" required id=`star${num}` name="rating" value=num) 8 | label(for=`star${num}`) #{num} Stars 9 | input.button(type="submit" value="Submit Review →") 10 | 11 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/38/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/39/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/39/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/39/controllers/reviewController.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Review = mongoose.model('Review'); 3 | 4 | exports.addReview = async (req, res) => { 5 | req.body.author = req.user._id; 6 | req.body.store = req.params.id; 7 | const newReview = new Review(req.body); 8 | await newReview.save(); 9 | req.flash('success', 'Review Saved!'); 10 | res.redirect('back'); 11 | }; 12 | -------------------------------------------------------------------------------- /stepped-solutions/39/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/39/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/39/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/map.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= title 6 | .map 7 | .autocomplete 8 | input.autocomplete__input(type="text" placeholder="Search for Anything" name="geolocate") 9 | #map 10 | p Loading Map... 11 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/39/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/39/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/mixins/_review.pug: -------------------------------------------------------------------------------- 1 | mixin review(review) 2 | .review__header 3 | .review__author 4 | img.avatar(src=review.author.gravatar) 5 | p= review.author.name 6 | .review__stars(title=`Rated ${review.rating} our of 5 stars`) 7 | = `★`.repeat(review.rating) 8 | = `☆`.repeat(5 - review.rating) 9 | time.review__time(datetime=review.created)= h.moment(review.created).fromNow() 10 | .review__body 11 | p= review.text 12 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/mixins/_reviewForm.pug: -------------------------------------------------------------------------------- 1 | mixin reviewForm(store) 2 | form.reviewer(action=`/reviews/${store._id}` method="POST") 3 | textarea(name="text" placeholder="Did you try this place? Have something to say? Leave a review...") 4 | .reviewer__meta 5 | .reviewer__stars 6 | each num in [5,4,3,2,1] 7 | input(type="radio" required id=`star${num}` name="rating" value=num) 8 | label(for=`star${num}`) #{num} Stars 9 | input.button(type="submit" value="Submit Review →") 10 | 11 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/39/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/40/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/40/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/40/controllers/reviewController.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Review = mongoose.model('Review'); 3 | 4 | exports.addReview = async (req, res) => { 5 | req.body.author = req.user._id; 6 | req.body.store = req.params.id; 7 | const newReview = new Review(req.body); 8 | await newReview.save(); 9 | req.flash('success', 'Review Saved!'); 10 | res.redirect('back'); 11 | }; 12 | -------------------------------------------------------------------------------- /stepped-solutions/40/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/40/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/40/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/map.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= title 6 | .map 7 | .autocomplete 8 | input.autocomplete__input(type="text" placeholder="Search for Anything" name="geolocate") 9 | #map 10 | p Loading Map... 11 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/40/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/40/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/mixins/_review.pug: -------------------------------------------------------------------------------- 1 | mixin review(review) 2 | .review__header 3 | .review__author 4 | img.avatar(src=review.author.gravatar) 5 | p= review.author.name 6 | .review__stars(title=`Rated ${review.rating} our of 5 stars`) 7 | = `★`.repeat(review.rating) 8 | = `☆`.repeat(5 - review.rating) 9 | time.review__time(datetime=review.created)= h.moment(review.created).fromNow() 10 | .review__body 11 | p= review.text 12 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/mixins/_reviewForm.pug: -------------------------------------------------------------------------------- 1 | mixin reviewForm(store) 2 | form.reviewer(action=`/reviews/${store._id}` method="POST") 3 | textarea(name="text" placeholder="Did you try this place? Have something to say? Leave a review...") 4 | .reviewer__meta 5 | .reviewer__stars 6 | each num in [5,4,3,2,1] 7 | input(type="radio" required id=`star${num}` name="rating" value=num) 8 | label(for=`star${num}`) #{num} Stars 9 | input.button(type="submit" value="Submit Review →") 10 | 11 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2= title 8 | .stores 9 | each store in stores 10 | +storeCard(store) 11 | -------------------------------------------------------------------------------- /stepped-solutions/40/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/.npmrc: -------------------------------------------------------------------------------- 1 | fund=false 2 | audit=false 3 | legacy-peer-deps=true 4 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/controllers/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/controllers/reviewController.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const Review = mongoose.model('Review'); 3 | 4 | exports.addReview = async (req, res) => { 5 | req.body.author = req.user._id; 6 | req.body.store = req.params.id; 7 | const newReview = new Review(req.body); 8 | await newReview.save(); 9 | req.flash('success', 'Review Saved!'); 10 | res.redirect('back'); 11 | }; 12 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/handlers/passport.js: -------------------------------------------------------------------------------- 1 | const passport = require('passport'); 2 | const mongoose = require('mongoose'); 3 | const User = mongoose.model('User'); 4 | 5 | passport.use(User.createStrategy()); 6 | 7 | passport.serializeUser(User.serializeUser()); 8 | passport.deserializeUser(User.deserializeUser()); 9 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/models/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/fonts/panama-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/fonts/panama-bold-webfont.woff -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/fonts/panama-bold-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/fonts/panama-bold-webfont.woff2 -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/icons/doughnut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/icons/doughnut.png -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/1.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/10.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/11.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/11.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/12.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/13.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/13.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/2.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/3.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/4.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/5.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/6.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/7.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/8.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/images/photos/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/images/photos/9.jpg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/javascripts/delicious-app.js: -------------------------------------------------------------------------------- 1 | import '../sass/style.scss'; 2 | 3 | import { $, $$ } from './modules/bling'; 4 | import autocomplete from './modules/autocomplete'; 5 | import typeAhead from './modules/typeAhead'; 6 | import makeMap from './modules/map'; 7 | import ajaxHeart from './modules/heart'; 8 | 9 | autocomplete( $('#address'), $('#lat'), $('#lng') ); 10 | 11 | typeAhead( $('.search') ); 12 | 13 | makeMap( $('#map') ); 14 | 15 | const heartForms = $$('form.heart'); 16 | heartForms.on('submit', ajaxHeart); 17 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/javascripts/modules/bling.js: -------------------------------------------------------------------------------- 1 | // based on https://gist.github.com/paulirish/12fb951a8b893a454b32 2 | 3 | const $ = document.querySelector.bind(document); 4 | const $$ = document.querySelectorAll.bind(document); 5 | 6 | Node.prototype.on = window.on = function (name, fn) { 7 | this.addEventListener(name, fn); 8 | }; 9 | 10 | NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line 11 | 12 | NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { 13 | this.forEach((elem) => { 14 | elem.on(name, fn); 15 | }); 16 | }; 17 | 18 | export { $, $$ }; 19 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/partials/_credits.scss: -------------------------------------------------------------------------------- 1 | // Heart by Alfa Design from the Noun Project 2 | // Pencil by Amit Ranjan from the Noun Project 3 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/partials/_helpers.scss: -------------------------------------------------------------------------------- 1 | .hide { 2 | text-indent: -999999px; 3 | font-size: 0; 4 | } 5 | 6 | .button { 7 | border: 0; 8 | background: $yellow; 9 | color: $black; 10 | font-family: 'Panama'; 11 | font-weight: 600; 12 | } 13 | 14 | .avatar { 15 | min-width: 50px; 16 | height: 50px; 17 | border-radius: 50%; 18 | align-self: center; 19 | } 20 | 21 | .card { 22 | background: white; 23 | padding: 5rem; 24 | box-shadow: 0 1px 10px rgba(0,0,0,0.15); 25 | } 26 | 27 | pre.error { 28 | padding: 5rem; 29 | background: white; 30 | line-height: 3; 31 | white-space: pre-line; 32 | } 33 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/partials/_layout.scss: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 10px; 3 | } 4 | 5 | body { 6 | background: $purple; 7 | background:#efefef; 8 | &:before { 9 | content: ''; 10 | display: block; 11 | background: $grad; 12 | height: 10px; 13 | width: 100%; 14 | } 15 | } 16 | 17 | .inner { 18 | max-width:900px; 19 | margin: 0 auto; 20 | @media all and (max-width: 900px) { 21 | padding: 2rem; 22 | } 23 | &--flashes { 24 | padding:0; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/partials/_map.scss: -------------------------------------------------------------------------------- 1 | .map { 2 | padding: 20px; 3 | background: white; 4 | box-shadow: $shad; 5 | } 6 | #map { 7 | height: 500px; 8 | } 9 | 10 | .popup { 11 | width: 300px; 12 | img { 13 | width: 100%; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/partials/_table.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | width: 100%; 3 | td { 4 | padding: 5px; 5 | } 6 | tr:nth-child(even) { 7 | background: white; 8 | } 9 | tr:nth-child(odd):not(:first-child) { 10 | background: #f7f7f7; 11 | } 12 | thead tr { 13 | background: $black; 14 | color: white; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/partials/_variables.scss: -------------------------------------------------------------------------------- 1 | $black: #303030; 2 | $width: 800px; 3 | $purple: #262161; 4 | $yellow: #FFC40E; 5 | $pink: #EE7297; 6 | $green: #93FF00; 7 | $red: #E50714; 8 | $grey: lighten(grey, 40%); 9 | $shad: 0 0 10px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.05); 10 | $grad: linear-gradient(90deg, #48ded4 0%, #a026bf 20%, #e82c75 60%, $yellow 85%, #48ded4 95%); 11 | $verticalGrad: linear-gradient(0, #48ded4 0%, #a026bf 20%, #e82c75 60%, $yellow 85%, #48ded4 95%); 12 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/sass/style.scss: -------------------------------------------------------------------------------- 1 | @import 'partials/variables'; 2 | @import 'partials/layout'; 3 | @import 'partials/normalize'; 4 | @import 'partials/typography'; 5 | @import 'partials/forms'; 6 | @import 'partials/search'; 7 | @import 'partials/flashes'; 8 | @import 'partials/nav'; 9 | @import 'partials/table'; 10 | @import 'partials/store'; 11 | @import 'partials/tag'; 12 | @import 'partials/single'; 13 | @import 'partials/heart'; 14 | @import 'partials/reviews'; 15 | @import 'partials/reviewer'; 16 | @import 'partials/pagination'; 17 | @import 'partials/map'; 18 | @import 'partials/helpers'; 19 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/0d3624fc-78ee-4297-8d15-e191b9775520.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/0d3624fc-78ee-4297-8d15-e191b9775520.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/1068a0db-ccda-4b92-a8c8-30e127a4e5d1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/1068a0db-ccda-4b92-a8c8-30e127a4e5d1.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/1b7870df-e238-4104-be4c-a267bd5f6257.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/1b7870df-e238-4104-be4c-a267bd5f6257.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/2eb3b200-74f5-4f14-8c2c-7b6f55d3f1f1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/2eb3b200-74f5-4f14-8c2c-7b6f55d3f1f1.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/3057b89b-92dc-4626-bd4c-3af7a699ce18.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/3057b89b-92dc-4626-bd4c-3af7a699ce18.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/3e143d06-a3df-4e15-86f6-4efc0a3f5fbc.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/4a5cb791-0140-4fa2-864c-af786640157d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/4a5cb791-0140-4fa2-864c-af786640157d.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/6c34119d-b9fd-4051-911e-948a16068229.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/6c34119d-b9fd-4051-911e-948a16068229.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/6da53d2e-c0e0-4aef-9ec9-9513b79ece15.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/7628c82c-66df-493c-ba5f-9237c6bc3516.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/7ddb5903-f1e8-486f-b4ba-9a0ff5632429.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/7ea7c02c-9054-442a-9126-788bf3471499.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/7ea7c02c-9054-442a-9126-788bf3471499.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/9251a9e5-8e7d-45ab-9157-8950107dc94d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/9251a9e5-8e7d-45ab-9157-8950107dc94d.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/96a33834-d7aa-4758-b980-fca901ea5956.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/96a33834-d7aa-4758-b980-fca901ea5956.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/9f2fc898-56b9-47fd-8a78-1d43c1377dc8.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/a10ca916-af2a-4a98-96a1-3e320df006f9.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/a6b38a1d-38c3-47af-ae4c-0ab26d8edec3.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/b5792f01-41c8-41b7-906d-1bdb411e4a55.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/b79b2792-cb22-490e-ab3f-a06ce10f7a9f.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/b79b2792-cb22-490e-ab3f-a06ce10f7a9f.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/bb7f7d60-9b0c-46b0-a0e4-1422d5752567.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/c589ef95-b942-4e8a-a63e-cab74c465b9d.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/c9d72871-3bd6-40c0-86c4-d7343fcbce39.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/c9d72871-3bd6-40c0-86c4-d7343fcbce39.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/d61e7b49-41ba-4924-8877-9c117a905ac9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/d61e7b49-41ba-4924-8877-9c117a905ac9.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/e30fbc3d-c6c4-45e9-8281-4d1e92768e8f.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/e30fbc3d-c6c4-45e9-8281-4d1e92768e8f.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/e3c532c9-cb77-4d92-9267-9abedeae2820.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/e710830e-11bf-4593-8a9f-3b6f20abbdb6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/e710830e-11bf-4593-8a9f-3b6f20abbdb6.jpeg -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/public/uploads/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/public/uploads/store.png -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/account.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2 Edit Your Account 6 | form(action="/account" method="POST") 7 | label(for="name") Name 8 | input(type="text" name="name" value=user.name) 9 | label(for="email") Email Address 10 | input(type="email" name="email" value=user.email) 11 | input.button(type="submit" value="Update My Account") 12 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/editStore.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeForm 4 | 5 | block content 6 | .inner 7 | h2= title 8 | +storeForm(store) 9 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/email/password-reset.pug: -------------------------------------------------------------------------------- 1 | extends email-layout 2 | 3 | block content 4 | h2 Password Reset 5 | p Hello. You have requested a password reset. Please click the following button to continue on with resetting your password. Please note this link is only valid for the next hour. 6 | +button(resetURL, 'Reset my Password →') 7 | p If you can't click the above button please visit #{resetURL} 8 | br 9 | p If you didn't request this email, please ignore it. 10 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= status 6 | p= message 7 | pre.error!= stackHighlighted 8 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/hello.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h2 Sale ends in #{h.moment().endOf('day').fromNow()} 5 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | p hi 5 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_loginForm 4 | include mixins/_forgot 5 | 6 | block content 7 | .inner 8 | +loginForm() 9 | +forgotForm() 10 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/map.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | h2= title 6 | .map 7 | .autocomplete 8 | input.autocomplete__input(type="text" placeholder="Search for Anything" name="geolocate") 9 | #map 10 | p Loading Map... 11 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/mixins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesbos/Learn-Node/79e1ecf10a400856ab893e8170a5d86b4f394821/stepped-solutions/45 - Finished App/views/mixins/.gitkeep -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/mixins/_forgot.pug: -------------------------------------------------------------------------------- 1 | mixin forgotForm() 2 | form.form(action="/account/forgot" method="POST") 3 | h2 I forgot my password! 4 | label(for="email") Email 5 | input(type="email" name="email") 6 | input.button(type="submit" value="Send a Reset") 7 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/mixins/_loginForm.pug: -------------------------------------------------------------------------------- 1 | mixin loginForm() 2 | form.form(action="/login" method="POST") 3 | h2 Login 4 | label(for="email") Email Address 5 | input(type="email" name="email") 6 | label(for="password") Password 7 | input(type="password" name="password") 8 | input.button(type="submit" value="Log In →") 9 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/mixins/_pagination.pug: -------------------------------------------------------------------------------- 1 | mixin pagination(page, pages, count) 2 | .pagination 3 | .pagination__prev 4 | if page > 1 5 | a(href=`/stores/page/${page - 1}`) Prev 6 | .pagination__text 7 | p Page #{page} of #{pages} — #{count} total results 8 | .pagination__next 9 | if page < pages 10 | a(href=`/stores/page/${parseFloat(page) + 1}`) Next 11 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/mixins/_review.pug: -------------------------------------------------------------------------------- 1 | mixin review(review) 2 | .review__header 3 | .review__author 4 | img.avatar(src=review.author.gravatar) 5 | p= review.author.name 6 | .review__stars(title=`Rated ${review.rating} our of 5 stars`) 7 | = `★`.repeat(review.rating) 8 | = `☆`.repeat(5 - review.rating) 9 | time.review__time(datetime=review.created)= h.moment(review.created).fromNow() 10 | .review__body 11 | p= review.text 12 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/mixins/_reviewForm.pug: -------------------------------------------------------------------------------- 1 | mixin reviewForm(store) 2 | form.reviewer(action=`/reviews/${store._id}` method="POST") 3 | textarea(name="text" placeholder="Did you try this place? Have something to say? Leave a review...") 4 | .reviewer__meta 5 | .reviewer__stars 6 | each num in [5,4,3,2,1] 7 | input(type="radio" required id=`star${num}` name="rating" value=num) 8 | label(for=`star${num}`) #{num} Stars 9 | input.button(type="submit" value="Submit Review →") 10 | 11 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/register.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(action="/register" method="POST") 6 | h2 Register 7 | label(for="name") Name 8 | input(type="text" name="name") 9 | label(for="email") Email 10 | input(type="email" name="email") 11 | label(for="password") Password 12 | input(type="password" name="password") 13 | label(for="password-confirm") Confirm Password 14 | input(type="password" name="password-confirm") 15 | input.button(type="submit" value="Register →") 16 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | .inner 5 | form.form(method="POST") 6 | h2 Reset Your Password 7 | label(for="password") Password 8 | input(type="password" name="password") 9 | label(for="password-confirm") Confirm Password 10 | input(type="password" name="password-confirm") 11 | input(type="submit" value="Reset Password →") 12 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/stores.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | include mixins/_pagination 5 | 6 | block content 7 | .inner 8 | h2= title 9 | .stores 10 | each store in stores 11 | +storeCard(store) 12 | +pagination(page, pages, count) 13 | -------------------------------------------------------------------------------- /stepped-solutions/45 - Finished App/views/tag.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | include mixins/_storeCard 4 | 5 | block content 6 | .inner 7 | h2 #{tag || 'Tags'} 8 | ul.tags 9 | each t in tags 10 | li.tag 11 | a.tag__link(href=`/tags/${t._id}` class=(t._id === tag ? 'tag__link--active' : '')) 12 | span.tag__text= t._id 13 | span.tag__count= t.count 14 | .stores 15 | each store in stores 16 | +storeCard(store) 17 | --------------------------------------------------------------------------------