mirror of
https://github.com/kevin-DL/complete-node-bootcamp.git
synced 2026-01-18 22:05:10 +00:00
Initial commit 🚀
This commit is contained in:
10
4-natours/after-section-12/views/_footer.pug
Normal file
10
4-natours/after-section-12/views/_footer.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
footer.footer
|
||||
.footer__logo
|
||||
img(src='/img/logo-green.png' alt='Natour logo')
|
||||
ul.footer__nav
|
||||
li: a(href='#') About us
|
||||
li: a(href='#') Download apps
|
||||
li: a(href='#') Become a guide
|
||||
li: a(href='#') Careers
|
||||
li: a(href='#') Contact
|
||||
p.footer__copyright © by Jonas Schmedtmann. Feel free to use this project for your own purposes, EXCEPT producing your own course or tutorials!
|
||||
14
4-natours/after-section-12/views/_header.pug
Normal file
14
4-natours/after-section-12/views/_header.pug
Normal file
@@ -0,0 +1,14 @@
|
||||
header.header
|
||||
nav.nav.nav--tours
|
||||
a.nav__el(href='/') All tours
|
||||
.header__logo
|
||||
img(src='/img/logo-white.png' alt='Natours logo')
|
||||
nav.nav.nav--user
|
||||
if user
|
||||
a.nav__el.nav__el--logout Log out
|
||||
a.nav__el(href='/me')
|
||||
img.nav__user-img(src=`/img/users/${user.photo}` alt=`Photo of ${user.name}`)
|
||||
span= user.name.split(' ')[0]
|
||||
else
|
||||
a.nav__el(href='/login') Log in
|
||||
a.nav__el.nav__el--cta(href='#') Sign up
|
||||
10
4-natours/after-section-12/views/_reviewCard.pug
Normal file
10
4-natours/after-section-12/views/_reviewCard.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
mixin reviewCard(review)
|
||||
.reviews__card
|
||||
.reviews__avatar
|
||||
img.reviews__avatar-img(src=`/img/users/${review.user.photo}`, alt=`${review.user.name}`)
|
||||
h6.reviews__user= review.user.name
|
||||
p.reviews__text= review.review
|
||||
.reviews__rating
|
||||
each star in [1, 2, 3, 4, 5]
|
||||
svg.reviews__star(class=`reviews__star--${review.rating >= star ? 'active' : 'inactive'}`)
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
65
4-natours/after-section-12/views/account.pug
Normal file
65
4-natours/after-section-12/views/account.pug
Normal file
@@ -0,0 +1,65 @@
|
||||
extends base
|
||||
|
||||
mixin navItem(link, text, icon, active)
|
||||
li(class=`${active ? 'side-nav--active' : ''}`)
|
||||
a(href=`${link}`)
|
||||
svg
|
||||
use(xlink:href=`img/icons.svg#icon-${icon}`)
|
||||
| #{text}
|
||||
|
||||
block content
|
||||
main.main
|
||||
.user-view
|
||||
nav.user-view__menu
|
||||
ul.side-nav
|
||||
+navItem('#', 'Settings', 'settings', true)
|
||||
+navItem('#', 'My bookings', 'briefcase')
|
||||
+navItem('#', 'My reviews', 'star')
|
||||
+navItem('#', 'Billing', 'credit-card')
|
||||
|
||||
- if (user.role === 'admin')
|
||||
.admin-nav
|
||||
h5.admin-nav__heading Admin
|
||||
ul.side-nav
|
||||
+navItem('#', 'Manage tours', 'map')
|
||||
+navItem('#', 'Manage users', 'users')
|
||||
+navItem('#', 'Manage reviews', 'star')
|
||||
+navItem('#', 'Manage bookings', 'briefcase')
|
||||
|
||||
.user-view__content
|
||||
.user-view__form-container
|
||||
h2.heading-secondary.ma-bt-md Your account settings
|
||||
|
||||
//- WITHOUT API
|
||||
//- form.form.form-user-data(action='/submit-user-data' method='POST')
|
||||
|
||||
//- WITH API
|
||||
form.form.form-user-data
|
||||
.form__group
|
||||
label.form__label(for='name') Name
|
||||
input#name.form__input(type='text', value=`${user.name}`, required, name='name')
|
||||
.form__group.ma-bt-md
|
||||
label.form__label(for='email') Email address
|
||||
input#email.form__input(type='email', value=`${user.email}`, required, name='email')
|
||||
.form__group.form__photo-upload
|
||||
img.form__user-photo(src=`/img/users/${user.photo}`, alt='User photo')
|
||||
a.btn-text(href='') Choose new photo
|
||||
.form__group.right
|
||||
button.btn.btn--small.btn--green Save settings
|
||||
|
||||
.line
|
||||
|
||||
.user-view__form-container
|
||||
h2.heading-secondary.ma-bt-md Password change
|
||||
form.form.form-user-password
|
||||
.form__group
|
||||
label.form__label(for='password-current') Current password
|
||||
input#password-current.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group
|
||||
label.form__label(for='password') New password
|
||||
input#password.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group.ma-bt-lg
|
||||
label.form__label(for='password-confirm') Confirm password
|
||||
input#password-confirm.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group.right
|
||||
button.btn.btn--small.btn--green.btn--save-password Save password
|
||||
26
4-natours/after-section-12/views/base.pug
Normal file
26
4-natours/after-section-12/views/base.pug
Normal file
@@ -0,0 +1,26 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
block head
|
||||
meta(charset='UTF-8')
|
||||
meta(name='viewport' content='width=device-width, initial-scale=1.0')
|
||||
link(rel='stylesheet' href='/css/style.css')
|
||||
link(rel='shortcut icon' type='image/png' href='/img/favicon.png')
|
||||
link(rel='stylesheet' href='https://fonts.googleapis.com/css?family=Lato:300,300i,700')
|
||||
title Natours | #{title}
|
||||
|
||||
body
|
||||
// HEADER
|
||||
include _header
|
||||
|
||||
// CONTENT
|
||||
block content
|
||||
h1 This is a placeholder heading
|
||||
|
||||
// FOOTER
|
||||
include _footer
|
||||
|
||||
//- script(src='https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js')
|
||||
//- script(src='/js/mapbox.js')
|
||||
//- script(src='/js/login.js')
|
||||
script(src='/js/bundle.js')
|
||||
9
4-natours/after-section-12/views/error.pug
Normal file
9
4-natours/after-section-12/views/error.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
extends base
|
||||
|
||||
block content
|
||||
main.main
|
||||
.error
|
||||
.error__title
|
||||
h2.heading-secondary.heading-secondary--error Uh oh! Something went wrong!
|
||||
h2.error__emoji 😢 🤯
|
||||
.error__msg= msg
|
||||
15
4-natours/after-section-12/views/login.pug
Normal file
15
4-natours/after-section-12/views/login.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
extends base
|
||||
|
||||
block content
|
||||
main.main
|
||||
.login-form
|
||||
h2.heading-secondary.ma-bt-lg Log into your account
|
||||
form.form.form--login
|
||||
.form__group
|
||||
label.form__label(for='email') Email address
|
||||
input#email.form__input(type='email', placeholder='you@example.com', required)
|
||||
.form__group.ma-bt-md
|
||||
label.form__label(for='password') Password
|
||||
input#password.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group
|
||||
button.btn.btn--green Login
|
||||
45
4-natours/after-section-12/views/overview.pug
Normal file
45
4-natours/after-section-12/views/overview.pug
Normal file
@@ -0,0 +1,45 @@
|
||||
extends base
|
||||
|
||||
block content
|
||||
main.main
|
||||
.card-container
|
||||
|
||||
each tour in tours
|
||||
.card
|
||||
.card__header
|
||||
.card__picture
|
||||
.card__picture-overlay
|
||||
img.card__picture-img(src=`/img/tours/${tour.imageCover}`, alt=`${tour.name}`)
|
||||
h3.heading-tertirary
|
||||
span= tour.name
|
||||
|
||||
.card__details
|
||||
h4.card__sub-heading= `${tour.difficulty} ${tour.duration}-day tour`
|
||||
p.card__text= tour.summary
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='/img/icons.svg#icon-map-pin')
|
||||
span= tour.startLocation.description
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='/img/icons.svg#icon-calendar')
|
||||
span= tour.startDates[0].toLocaleString('en-us', {month: 'long', year: 'numeric'})
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='/img/icons.svg#icon-flag')
|
||||
span= `${tour.locations.length} stops`
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='/img/icons.svg#icon-user')
|
||||
span= `${tour.maxGroupSize} people`
|
||||
|
||||
.card__footer
|
||||
p
|
||||
span.card__footer-value= `$${tour.price}`
|
||||
|
|
||||
span.card__footer-text per person
|
||||
p.card__ratings
|
||||
span.card__footer-value= tour.ratingsAverage
|
||||
|
|
||||
span.card__footer-text= `rating (${tour.ratingsQuantity})`
|
||||
a.btn.btn--green.btn--small(href=`/tour/${tour.slug}`) Details
|
||||
87
4-natours/after-section-12/views/tour.pug
Normal file
87
4-natours/after-section-12/views/tour.pug
Normal file
@@ -0,0 +1,87 @@
|
||||
extends base
|
||||
include _reviewCard
|
||||
|
||||
block append head
|
||||
script(src='https://api.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js')
|
||||
link(href='https://api.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css' rel='stylesheet')
|
||||
|
||||
mixin overviewBox(label, text, icon)
|
||||
.overview-box__detail
|
||||
svg.overview-box__icon
|
||||
use(xlink:href=`/img/icons.svg#icon-${icon}`)
|
||||
span.overview-box__label= label
|
||||
span.overview-box__text= text
|
||||
|
||||
block content
|
||||
section.section-header
|
||||
.header__hero
|
||||
.header__hero-overlay
|
||||
img.header__hero-img(src=`/img/tours/${tour.imageCover}`, alt=`${tour.name}`)
|
||||
|
||||
.heading-box
|
||||
h1.heading-primary
|
||||
span= `${tour.name} tour`
|
||||
.heading-box__group
|
||||
.heading-box__detail
|
||||
svg.heading-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-clock')
|
||||
span.heading-box__text= `${tour.duration} days`
|
||||
.heading-box__detail
|
||||
svg.heading-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-map-pin')
|
||||
span.heading-box__text= tour.startLocation.description
|
||||
|
||||
section.section-description
|
||||
.overview-box
|
||||
div
|
||||
.overview-box__group
|
||||
h2.heading-secondary.ma-bt-lg Quick facts
|
||||
|
||||
- const date = tour.startDates[0].toLocaleString('en-us', {month: 'long', year: 'numeric'})
|
||||
+overviewBox('Next date', date, 'calendar')
|
||||
+overviewBox('Difficulty', tour.difficulty, 'trending-up')
|
||||
+overviewBox('Participants', `${tour.maxGroupSize} people`, 'user')
|
||||
+overviewBox('Rating', `${tour.ratingsAverage} / 5`, 'star')
|
||||
|
||||
.overview-box__group
|
||||
h2.heading-secondary.ma-bt-lg Your tour guides
|
||||
|
||||
each guide in tour.guides
|
||||
.overview-box__detail
|
||||
img.overview-box__img(src=`/img/users/${guide.photo}`, alt=`${guide.name}`)
|
||||
|
||||
- if (guide.role === 'lead-guide')
|
||||
span.overview-box__label Lead guide
|
||||
- if (guide.role === 'guide')
|
||||
span.overview-box__label Tour guide
|
||||
span.overview-box__text= guide.name
|
||||
|
||||
.description-box
|
||||
h2.heading-secondary.ma-bt-lg= `About ${tour.name} tour`
|
||||
- const parapraphs = tour.description.split('\n');
|
||||
each p in parapraphs
|
||||
p.description__text= p
|
||||
|
||||
section.section-pictures
|
||||
each img, i in tour.images
|
||||
.picture-box
|
||||
img.picture-box__img(src=`/img/tours/${img}`, alt=`The Park Camper Tour ${i + 1}`, class=`picture-box__img--${i + 1}`)
|
||||
|
||||
section.section-map
|
||||
#map(data-locations=`${JSON.stringify(tour.locations)}`)
|
||||
|
||||
section.section-reviews
|
||||
.reviews
|
||||
each review in tour.reviews
|
||||
+reviewCard(review)
|
||||
|
||||
section.section-cta
|
||||
.cta
|
||||
.cta__img.cta__img--logo
|
||||
img(src='/img/logo-white.png', alt='Natours logo')
|
||||
img.cta__img.cta__img--1(src=`/img/tours/${tour.images[1]}`, alt='Tour picture')
|
||||
img.cta__img.cta__img--2(src=`/img/tours/${tour.images[2]}`, alt='Tour picture')
|
||||
.cta__content
|
||||
h2.heading-secondary What are you waiting for?
|
||||
p.cta__text= `${tour.duration} days. 1 adventure. Infinite memories. Make it yours today!`
|
||||
button.btn.btn--green.span-all-rows Book tour now!
|
||||
Reference in New Issue
Block a user