mirror of
https://github.com/kevin-DL/complete-node-bootcamp.git
synced 2026-01-21 15:15:04 +00:00
Initial commit 🚀
This commit is contained in:
67
4-natours/after-section-13/views/account.pug
Normal file
67
4-natours/after-section-13/views/account.pug
Normal file
@@ -0,0 +1,67 @@
|
||||
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-tours', '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' enctype='multipart/form-data')
|
||||
|
||||
//- 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')
|
||||
input.form__upload(type='file', accept='image/*', id='photo', name='photo')
|
||||
label(for='photo') 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
|
||||
Reference in New Issue
Block a user