-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtour.pug
92 lines (77 loc) · 3.83 KB
/
tour.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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')
script(type="module" src='https://js.stripe.com/v3/')
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!`
if user
button.btn.btn--green.span-all-rows#book-tour(data-tour-id=`${tour._id}`) Book tour now!
else
a.btn.btn--green.span-all-rows(href='/login') Log in to book tour