CINXE.COM
Home - Restaurant Hub NZ
<!DOCTYPE html> <html lang="en"> <head> <script>window.onerror = function(msg, file, line, col, error) { if (navigator.userAgent.match(/.*(googlebot|adsbot|applebot|google\-read\-aloud).*/i)) { console.log('stupid bot'); return; } fetch('/rh2/misc/error-reporter-post/', { method: 'POST', body: JSON.stringify({msg: msg, error: error.stack || error, loc: document.location.href, ua: navigator.userAgent || null}) }) };</script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XFMQ6K0WY0"> </script> <script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XFMQ6K0WY0'); gtag('config', 'GTM-TLF6M2XV');</script> <meta charset="utf-8"> <meta name="google-site-verification" content="MpWYLxcKhIyClfvFxwtyMltwjPwdyHyeORnYUcaJsB0"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Restaurant Hub provides a fast and convenient way to find and book instantly confirmed tables at New Zealand’s most popular and buzziest restaurants."> <meta name="keywords" content="Restaurant Hub NZ, restaurants, book online, New Zealand, Auckland, Wellington, Christchurch, Hamilton, Tauranga, Napier and Hastings, Dunedin, Palmerston North, New Plymouth, Rotorua, Nelson"> <link rel="icon" type="image/png" href="/static/images/favicons/favicon-32x32.png"> <title>Home - Restaurant Hub NZ</title> <link rel="preconnect" href="https://analytics.google.com"> <link rel="preconnect" href="https://maps.googleapis.com"> <link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml"> <link rel="canonical" href="https://www.restauranthub.co.nz/rh2/"> <script src="https://maps.googleapis.com/maps/api/js?v=quarterly&loading=async&libraries=marker&key=AIzaSyAsNVv5UUAaS8KBn2qXKMuoklF0H9d_a7s" async> </script> <script src="/rh2/static/js/markerclusterer.min.js" async> </script> <script src="/rh2/static/js/panzoom.min.js" async> </script> <script src="https://js.stripe.com/v3/" async> </script> <script src="/rh2/static/js/jquery.min.js"> </script> <script src="/rh2/static/js/common.js?r=1"> </script> <style>/* COMMON */ * { box-sizing: border-box; } ::selection { color: white; background: rgba(127, 127, 255); } html, body, div, h1, h2, h3, h4, h5, h6, form { margin: 0px; padding: 0px; } input:focus, select:focus, textarea:focus { outline: none; } a, a:visited { color: hsla(15, 0%, 10%, 1); } .bold { font-weight: bold; } .hidden { display: none; } .invisible { visibility: hidden; } .center { text-align: center; } .flex { display: flex; } .left { text-align: left; } .right { text-align: right; } .rh2-row { width: 100%; } .rh2-row-fw { width: 100%; } .rh2-row-pw { width: 100%; max-width: 1280px; margin: auto; } .rh2-row-fh { height: 100%; } .rh2-row::after { content: ' '; display: block; height: 0px; clear: both; } .rh2-row-fw::after { content: ' '; display: block; height: 0px; clear: both; } .rh2-row-pw::after { content: ' '; display: block; height: 0px; clear: both; } /* 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O */ .rh2-col { float: left; min-height: 1px; } .rh2-w-0 { width: 0.0000%; } .rh2-w-1 { width: 4.1666%; } .rh2-w-2 { width: 8.3333%; } .rh2-w-3 { width: 12.5000%; } .rh2-w-4 { width: 16.6666%; } .rh2-w-5 { width: 20.8333%; } .rh2-w-6 { width: 25.0000%; } .rh2-w-7 { width: 29.1666%; } .rh2-w-8 { width: 33.3333%; } .rh2-w-9 { width: 37.5000%; } .rh2-w-A { width: 41.6666%; } .rh2-w-B { width: 45.8333%; } .rh2-w-C { width: 50.0000%; } .rh2-w-D { width: 54.1666%; } .rh2-w-E { width: 58.3333%; } .rh2-w-F { width: 62.5000%; } .rh2-w-G { width: 66.6666%; } .rh2-w-H { width: 70.8333%; } .rh2-w-I { width: 75.0000%; } .rh2-w-J { width: 79.1666%; } .rh2-w-K { width: 83.3333%; } .rh2-w-L { width: 87.5000%; } .rh2-w-M { width: 91.6666%; } .rh2-w-N { width: 95.8333%; } .rh2-w-O { width: 100.0000%; } .rh2-h-0 { height: 0.0000%; } .rh2-h-1 { height: 4.1666%; } .rh2-h-2 { height: 8.3333%; } .rh2-h-3 { height: 12.5000%; } .rh2-h-4 { height: 16.6666%; } .rh2-h-5 { height: 20.8333%; } .rh2-h-6 { height: 25.0000%; } .rh2-h-7 { height: 29.1666%; } .rh2-h-8 { height: 33.3333%; } .rh2-h-9 { height: 37.5000%; } .rh2-h-A { height: 41.6666%; } .rh2-h-B { height: 45.8333%; } .rh2-h-C { height: 50.0000%; } .rh2-h-D { height: 54.1666%; } .rh2-h-E { height: 58.3333%; } .rh2-h-F { height: 62.5000%; } .rh2-h-G { height: 66.6666%; } .rh2-h-H { height: 70.8333%; } .rh2-h-I { height: 75.0000%; } .rh2-h-J { height: 79.1666%; } .rh2-h-K { height: 83.3333%; } .rh2-h-L { height: 87.5000%; } .rh2-h-M { height: 91.6666%; } .rh2-h-N { height: 95.8333%; } .rh2-h-O { height: 100.0000%; } @media (max-width: 481px) { .rh2-col-s { float: left; min-height: 1px; } .rh2-w-0-s { width: 0.0000%; } .rh2-w-1-s { width: 4.1666%; } .rh2-w-2-s { width: 8.3333%; } .rh2-w-3-s { width: 12.5000%; } .rh2-w-4-s { width: 16.6666%; } .rh2-w-5-s { width: 20.8333%; } .rh2-w-6-s { width: 25.0000%; } .rh2-w-7-s { width: 29.1666%; } .rh2-w-8-s { width: 33.3333%; } .rh2-w-9-s { width: 37.5000%; } .rh2-w-A-s { width: 41.6666%; } .rh2-w-B-s { width: 45.8333%; } .rh2-w-C-s { width: 50.0000%; } .rh2-w-D-s { width: 54.1666%; } .rh2-w-E-s { width: 58.3333%; } .rh2-w-F-s { width: 62.5000%; } .rh2-w-G-s { width: 66.6666%; } .rh2-w-H-s { width: 70.8333%; } .rh2-w-I-s { width: 75.0000%; } .rh2-w-J-s { width: 79.1666%; } .rh2-w-K-s { width: 83.3333%; } .rh2-w-L-s { width: 87.5000%; } .rh2-w-M-s { width: 91.6666%; } .rh2-w-N-s { width: 95.8333%; } .rh2-w-O-s { width: 100.0000%; } } @media (max-width: 769px) { .rh2-w-0-m { width: 0.0000%; } .rh2-w-1-m { width: 4.1666%; } .rh2-w-2-m { width: 8.3333%; } .rh2-w-3-m { width: 12.5000%; } .rh2-w-4-m { width: 16.6666%; } .rh2-w-5-m { width: 20.8333%; } .rh2-w-6-m { width: 25.0000%; } .rh2-w-7-m { width: 29.1666%; } .rh2-w-8-m { width: 33.3333%; } .rh2-w-9-m { width: 37.5000%; } .rh2-w-A-m { width: 41.6666%; } .rh2-w-B-m { width: 45.8333%; } .rh2-w-C-m { width: 50.0000%; } .rh2-w-D-m { width: 54.1666%; } .rh2-w-E-m { width: 58.3333%; } .rh2-w-F-m { width: 62.5000%; } .rh2-w-G-m { width: 66.6666%; } .rh2-w-H-m { width: 70.8333%; } .rh2-w-I-m { width: 75.0000%; } .rh2-w-J-m { width: 79.1666%; } .rh2-w-K-m { width: 83.3333%; } .rh2-w-L-m { width: 87.5000%; } .rh2-w-M-m { width: 91.6666%; } .rh2-w-N-m { width: 95.8333%; } .rh2-w-O-m { width: 100.0000%; } } @media (max-width: 1024px) { .rh2-w-0-l { width: 0.0000%; } .rh2-w-1-l { width: 4.1666%; } .rh2-w-2-l { width: 8.3333%; } .rh2-w-3-l { width: 12.5000%; } .rh2-w-4-l { width: 16.6666%; } .rh2-w-5-l { width: 20.8333%; } .rh2-w-6-l { width: 25.0000%; } .rh2-w-7-l { width: 29.1666%; } .rh2-w-8-l { width: 33.3333%; } .rh2-w-9-l { width: 37.5000%; } .rh2-w-A-l { width: 41.6666%; } .rh2-w-B-l { width: 45.8333%; } .rh2-w-C-l { width: 50.0000%; } .rh2-w-D-l { width: 54.1666%; } .rh2-w-E-l { width: 58.3333%; } .rh2-w-F-l { width: 62.5000%; } .rh2-w-G-l { width: 66.6666%; } .rh2-w-H-l { width: 70.8333%; } .rh2-w-I-l { width: 75.0000%; } .rh2-w-J-l { width: 79.1666%; } .rh2-w-K-l { width: 83.3333%; } .rh2-w-L-l { width: 87.5000%; } .rh2-w-M-l { width: 91.6666%; } .rh2-w-N-l { width: 95.8333%; } .rh2-w-O-l { width: 100.0000%; } } @media (min-width: 1024px) { .rh2-w-0-h { width: 0.0000%; } .rh2-w-1-h { width: 4.1666%; } .rh2-w-2-h { width: 8.3333%; } .rh2-w-3-h { width: 12.5000%; } .rh2-w-4-h { width: 16.6666%; } .rh2-w-5-h { width: 20.8333%; } .rh2-w-6-h { width: 25.0000%; } .rh2-w-7-h { width: 29.1666%; } .rh2-w-8-h { width: 33.3333%; } .rh2-w-9-h { width: 37.5000%; } .rh2-w-A-h { width: 41.6666%; } .rh2-w-B-h { width: 45.8333%; } .rh2-w-C-h { width: 50.0000%; } .rh2-w-D-h { width: 54.1666%; } .rh2-w-E-h { width: 58.3333%; } .rh2-w-F-h { width: 62.5000%; } .rh2-w-G-h { width: 66.6666%; } .rh2-w-H-h { width: 70.8333%; } .rh2-w-I-h { width: 75.0000%; } .rh2-w-J-h { width: 79.1666%; } .rh2-w-K-h { width: 83.3333%; } .rh2-w-L-h { width: 87.5000%; } .rh2-w-M-h { width: 91.6666%; } .rh2-w-N-h { width: 95.8333%; } .rh2-w-O-h { width: 100.0000%; } } /* Utilities */ .rh2-ta-left { text-align: left; } .rh2-ta-center { text-align: center; } .rh2-ta-right { text-align: right; } .rh2-display-none { display: none !important; } .rh2-display-unset { display: unset; } .rh2-utilities-fade-away-transition { animation-duration: 0.8s; animation-name: rh2-utilities-fade-away-transition-kf; transition-timing-function: ease-in-out; } @keyframes rh2-utilities-fade-away-transition-kf { 0% { opacity: 1; } 100% { opacity: 0; } } .rh2-utilities-fade-away-endstate { display: none; } .rh2-utilities-fade-in-transition { animation-duration: 0.8s; animation-name: rh2-utilities-fade-in-transition-kf; transition-timing-function: ease-in-out; } @keyframes rh2-utilities-fade-in-transition-kf { 0% { opacity: 0; } 100% { opacity: 1; } } .rh2-utilities-fade-in-endstate { display: unset; } .rh2-form-input-invalid { border: 1px solid hsla(0, 100%, 50%, 1) !important; } .rh2-clickable { cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-color-rh { color: hsla(14, 88%, 55%, 1); } .rh2-color-earlybird { color: hsla(347, 79%, 55%, 1); } .rh2-color-reward { color: hsla(205, 100%, 44%, 1); } .unused { background-color: hsla(15, 0%, 95%, 1); } html { height: 100%; } body { background-color: hsla(0, 0%, 100%, 1); font-family: 'Inter-Regular'; position: relative; width: 100%; height: 100%; } @media (min-width: 770px) { .rh2-hide-on-desktop { display: none; } } @media (max-width: 769px) { .rh2-hide-on-mobile { display: none; } } /* Fragment */ .rh2-fragment-manager { position: relative; width: 100%; height: 100%; } .rh2-fragment-manager-deployment-awareness-ribbon { position: fixed; top: 15px; right: -30px; transform: rotate(45deg); -webkit-transform: rotate(45deg); width: 100px; text-align: center; line-height: 16px; font-size: 16px; letter-spacing: 1px; color: hsla(0, 0%, 100%, 1); background-color: hsla(200, 100%, 50%, 1); border: 1px solid hsla(0, 0%, 100%, 1); z-index: 999; } .rh2-fragment { width: 100%; } .rh2-fragment-gone { display: none; } .rh2-bottom-bar { display: none; } @media (max-width: 769px) { .rh2-fragment { padding-bottom: 60px; } .rh2-fragment-manager-deployment-awareness-ribbon { top: 10px; right: -35px; } .rh2-bottom-bar { position: relative; display: block; position: fixed; bottom: 0px; width: 100%; height: 60px; background-color: hsla(0, 0%, 95%, 1); z-index: 10; } .rh2-bottom-bar-item { position: relative; float: left; width: 25%; height: 100%; text-align: center; opacity: 0.7; } .rh2-bottom-bar-item-active { color: hsla(14, 88%, 55%, 1); opacity: 0.9; } .rh2-bottom-bar-item-icon { margin-left: auto; margin-right: auto; margin-top: 11px; width: 24px; height: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; opacity: 0.7; } .rh2-bottom-bar-item-home .rh2-bottom-bar-item-icon { background-image: url('/rh2/static/image/icon/bottom_nav/home.svg'); } .rh2-bottom-bar-item-explore .rh2-bottom-bar-item-icon { background-image: url('/rh2/static/image/icon/bottom_nav/explore.svg'); } .rh2-bottom-bar-item-reservations .rh2-bottom-bar-item-icon { background-image: url('/rh2/static/image/icon/bottom_nav/reservations.svg'); } .rh2-bottom-bar-item-profile .rh2-bottom-bar-item-icon { background-image: url('/rh2/static/image/icon/bottom_nav/profile.svg'); } .rh2-bottom-bar-item-text { margin-top: 4px; font-family: 'Inter-SemiBold'; font-size: 11px; } } .rh2-page-wrapper { width: 100%; min-height: 90%; padding-top: 56px; padding-bottom: 48px; } .rh2-page-dialogue-overlay.rh2-page-dialogue-overlay-active { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(15, 0%, 20%, 0.5); z-index: 100; } .rh2-page-dialogue { position: absolute; top: 50%; left: 50%; min-width: 240px; max-width: 320px; transform: translate(-50%, -50%); background-color: hsla(15, 0%, 100%, 1); border: 1px solid hsla(15, 95%, 50%, 1); border-radius: 8px; } .rh2-page-dialogue-title { padding: 8px; border-bottom: 1px solid hsla(15, 95%, 50%, 1); } .rh2-page-dialogue-body { min-height: 160px; padding: 8px; text-align: center; } .rh2-page-dialogue-footer { width: 100%; } .rh2-page-dialogue-button { display: block; float: right; min-width: 48px; margin-top: 8px; margin-right: 8px; margin-bottom: 8px; padding: 4px; font-size: 14px; text-align: center; background-color: hsla(15, 95%, 50%, 1); color: hsla(15, 0%, 100%, 1); border: 1px solid hsla(15, 95%, 50%, 1); border-radius: 4px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-page-dialogue-button-float-left { float: left !important; margin-left: 8px; margin-right: 0px; } .rh2-page-dialogue-button-light { background-color: hsla(15, 0%, 100%, 1) !important; color: hsla(15, 95%, 50%, 1) !important; } @media (max-width: 769px) { .rh2-page-wrapper { padding-top: 48px; } } /* Home */ .rh2-fragment-home { font-family: 'Inter-Regular'; background-color: hsla(0, 0%, 100%, 1); } .rh2-home-row-desktop-header-bg-row { min-height: 340px; background-image: url('/rh2/static/image/rh/home/dinner.webp'); background-size: cover; background-repeat: no-repeat; background-position: center; padding: 32px; margin-bottom: 16px; } .rh2-home-row-desktop-header-wrapper { background-color: hsla(0, 0%, 100%, 1); border-radius: 16px; width: 760px; padding: 20px; margin-left: 64px; } .rh2-home-row-mobile-header-bg-row { background-image: url('/rh2/static/image/rh/home/dinner.webp'); background-size: cover; background-repeat: no-repeat; background-position: center; padding: 10px; } .rh2-home-discover-locations-desktop { margin-top: 24px; } .rh2-home-discover-locations-mobile { margin-top: 24px; padding: 8px; } .rh2-home-discover-locations-title { font-family: 'Inter-Regular'; font-size: 18px; margin-bottom: 8px; } .rh2-home-discover-locations-grid { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; } .rh2-home-discover-locations-island { font-family: 'Inter-SemiBold'; font-size: 16px; margin-top: 8px; padding: 8px; } .rh2-home-discover-locations-grid-item { margin: 1%; height: 40px; font-size: 14px; font-weight: 700; border: 1px solid hsla(0, 0%, 90%, 1); border-radius: 10px; text-align: center; display: flex; justify-content: center; align-items: center; cursor: pointer; color: hsla(0, 0%, 0%, 1); box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.15); padding: 0 10px; } .rh2-home-discover-locations-desktop .rh2-home-discover-locations-grid-item { width: 13%; margin: 0.5%; } .rh2-home-discover-locations-grid-item-see-all { border: none; text-decoration: underline; color: hsla(14, 88%, 55%, 1); background-image: url('/rh2/static/icon/site/chevron-right.svg'); background-repeat: no-repeat; background-size: 30px; background-position: center center; text-indent: -9999px; width: 40px !important; } .rh2-home-row-0 { position: relative; } .rh2-home-row-0-col-right { float: right; padding: 12px; } .rh2-home-row-0-col-left { float: left; padding: 12px; } .rh2-home-row-0-section-takeaway { min-height: 64px; padding-top: 10px; padding-bottom: 10px; text-align: center; background-color: hsla(141, 89%, 35%, 1); } .rh2-home-row-0-section-takeaway-text { color: hsla(15, 0%, 100%, 1); line-height: 44px; } .rh2-home-row-0-section-takeaway-button { display: inline-block; margin-left: 12px; text-decoration: none; width: 96px; height: 36px; border-radius: 4px; text-align: center; font-family: 'Inter-Bold'; font-size: 12px; line-height: 36px; color: hsla(141, 89%, 35%, 1); background-color: hsla(15, 0%, 100%, 1); cursor: pointer; box-shadow: 0px 3px 9px hsla(15, 0%, 0%, 0.16); } .rh2-home-row-0-section-takeaway-button:visited { color: hsla(141, 89%, 35%, 1); } .rh2-home-row-1-col-left { padding: 12px; } .rh2-home-row-1-col-right { padding: 12px; } .rh2-home-finder { padding: 40px; padding-top: 33px; height: 530px; background: hsla(15, 0%, 100%, 1); border: 1px solid hsla(15, 0%, 90%, 1); box-shadow: 0px 4px 4px hsla(15, 0%, 90%, 1); } .rh2-home-finder-logo { margin-top: 38px; margin-left: auto; margin-right: auto; margin-bottom: 18px; width: 220px; height: 51px; background-image: url('/rh2/static/image/logo-2x.gif'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-home-finder-row-title { margin-bottom: 32px; font-family: 'Inter-Bold'; line-height: 28px; text-align: center; font-size: 24px; color: hsla(214, 11%, 25%, 1); } .rh2-home-finder-col { padding: 4px; margin-bottom: 4px; } .rh2-home-finder-label { font-family: 'Lato-Bold'; font-size: 11px; line-height: 18px; color: #919191; } .rh2-home-finder-control { height: 50px; background-color: hsla(15, 0%, 100%, 1); border: 1px solid hsla(15, 0%, 80%, 1); margin-bottom: 16px; } div.rh2-home-finder-control, select.rh2-home-finder-control { color: hsla(14, 88%, 55%, 1); font-family: 'Lato-Regular'; font-size: 14px; } .rh2-home-finder-col-date { position: relative; } .rh2-home-finder-col-date .rh2-home-finder-control { line-height: 50px; text-align: center; } .rh2-home-finder-calendar-dialogue { margin-top: -16px; position: absolute; width: 300px; height: 350px; background-color: hsla(15, 0%, 100%, 1); border: 1px solid hsla(15, 0%, 85%, 1); z-index: 5; } .rh2-home-finder-calendar-container { width: 300px; height: 290px; } .rh2-home-finder-calendar-close { font-family: 'Inter-SemiBold'; font-size: 16px; padding-right: 8px; padding-bottom: 8px; line-height: 20px; text-align: right; color: hsla(14, 88%, 55%, 1); } .rh2-home-finder-date-input::-webkit-inner-spin-button { display: none; } .rh2-home-finder-col-search-input { position: relative; } .rh2-home-finder-col-search-input .rh2-home-finder-control { padding-left: 36px; } .rh2-home-finder-row-action { padding: 4px; padding-top: 16px; } .rh2-home-finder-col-search-button .rh2-home-finder-control { width: 100%; font-family: 'Inter-Bold'; font-size: 12px; line-height: 50px; background-color: hsla(14, 88%, 55%, 1); border-radius: 4px; border: none; color: hsla(15, 0%, 100%, 1); text-align: center; } .rh2-home-finder-search-icon { position: absolute; left: 20px; top: 20px; width: 16px; height: 16px; background-image: url('/rh2/static/image/feather/search.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; opacity: 0.6; } .rh2-home-crusoe-container { position: relative; height: 360px; background-color: hsla(15, 90%, 50%, 0); border: 1px solid hsla(15, 0%, 90%, 1); box-shadow: 0px 4px 4px hsla(15, 0%, 90%, 1); } .rh2-home-crusoe-item { position: absolute; display: block; top: 0px; left: 0px; width: 100%; height: 100%; } .rh2-home-crusoe-item-hidden { display: none; } .rh2-home-crusoe-item-hidden-transition { animation-duration: 0.5s; animation-name: rh2-home-crusoe-item-hidden-transition-kf; } @keyframes rh2-home-crusoe-item-hidden-transition-kf { 0% { opacity: 1; } 100% { opacity: 0; } } .rh2-home-crusoe-item-image { position: absolute; display: block; top: 0px; left: 0px; width: 100%; height: 90%; background-size: cover; background-repeat: no-repeat; background-position: center; transition-timing-function: ease-in-out; } .rh2-home-crusoe-item-text { position: absolute; display: block; bottom: 0px; height: 160px; left: 10%; width: 90%; background-color: hsla(15, 0%, 100%, 1); } .rh2-home-crusoe-item-text-tag { position: absolute; display: block; top: -16px; left: 24px; height: 32px; font-size: 12px; font-family: 'Inter-SemiBold'; line-height: 32px; padding-left: 8px; padding-right: 8px; background-color: hsla(14, 88%, 55%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-home-crusoe-item-text-title { margin-top: 24px; padding-left: 24px; font-family: 'Inter-Bold'; font-size: 28px; line-height: 28px; color: hsla(15, 95%, 50%, 1); margin-bottom: 8px; } .rh2-home-crusoe-item-text-description { font-family: 'Lato-Regular'; font-size: 16px; line-height: 22px; height: 64px; padding-left: 32px; padding-right: 32px; margin-bottom: 8px; text-overflow: ellipsis; overflow: hidden; } .rh2-home-crusoe-item-text-link { padding-left: 24px; font-family: 'Inter-SemiBold'; font-size: 12px; color: hsla(15, 95%, 50%, 1); } .rh2-home-crusoe-item-logo { position: absolute; right: 10%; top: 25px; width: 150px; height: 150px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-home-crusoe-item-handles-container { position: absolute; top: 55%; right: 0%; } .rh2-home-crusoe-item-handle { float: left; margin-right: 6px; width: 12px; height: 12px; border-radius: 6px; } .rh2-home-crusoe-item-handle-active { background-color: hsla(15, 0%, 95%, 0.8); } .rh2-home-crusoe-item-handle-inactive { background-color: hsla(15, 0%, 95%, 0.4); } .rh2-home-section-special { position: relative; margin-top: 40px; padding: 12px; } .rh2-home-section-special-heading { color: hsla(214, 11%, 25%, 1); line-height: 36px; margin-bottom: 16px; display: flex; } .rh2-home-section-special-heading-text { flex: 1; font-family: 'Inter-Bold'; font-size: 20px; } .rh2-home-section-special-heading-link { flex: initial; font-family: 'Inter-Bold'; font-size: 18px; text-decoration: none; color: #F5214E; } .rh2-home-section-special-heading-text::before { content: ""; display: inline-block; width: 24px; height: 24px; padding-left: 10px; background: url(/rh2/static/icon/site/discount.svg) no-repeat; background-size: contain; } .rh2-home-section-special-heading-link:visited { color: #F5214E; } .rh2-home-section-special-body { display: flex; flex-direction: row; flex-wrap: wrap; gap: 20px; } .rh2-home-section-special-body-item { flex: 1 1 0px; flex-basis: 49%; } @media (max-width: 769px) { .rh2-home-section-special-body-item { min-width: 90%; max-width: 100%; } } .rh2-home-section-special-body-item .rh2-business-list-special-card-desktop { max-height: 220px; } .rh2-home-section-special-body-item .rh2-business-list-special-card-details-button { display: none; } .rh2-home-section-coupon { position: relative; margin-top: 40px; padding: 12px; } .rh2-home-section-coupon-heading { color: hsla(214, 11%, 25%, 1); line-height: 36px; display: flex; margin-bottom: 16px; } .rh2-home-section-coupon-heading-text { flex: 1; font-family: 'Inter-Bold'; font-size: 24px; } .rh2-home-section-coupon-heading-link { flex: initial; font-family: 'Inter-Bold'; font-size: 18px; text-decoration: none; color: #33c1a2; } .rh2-home-section-coupon-heading-link:visited { color: #33c1a2; } .rh2-home-section-coupon-body { display: flex; flex-direction: row; flex-wrap: wrap; } .rh2-home-section-coupon-body-item { flex: 1; min-width: 40%; max-width: 50%; padding: 8px; } @media (max-width: 769px) { .rh2-home-section-coupon-body-item { min-width: 90%; max-width: 100%; } } .rh2-home-section-restaurants { position: relative; padding: 12px; } .rh2-home-section-restaurants-heading { color: hsla(214, 11%, 25%, 1); display: flex; line-height: 36px; margin-bottom: 16px; } .rh2-home-section-restaurants-heading-text { flex: 1; font-family: 'Inter-Bold'; font-size: 20px; } .rh2-home-section-restaurants-heading-text::before { content: ""; display: inline-block; width: 26px; height: 26px; padding-left: 10px; background: url(/rh2/static/icon/site/vote-icon.svg) no-repeat; background-size: contain; } .rh2-home-section-restaurants-heading-link { flex: initial; font-family: 'Inter-Bold'; font-size: 18px; text-decoration: none; color: #F5214E; } .rh2-home-section-restaurants-heading-link:visited { color: #F5214E; } .rh2-home-section-restaurants-body { display: flex; flex-direction: row; flex-wrap: wrap; } .rh2-home-section-restaurants-body-item { flex: 1; min-width: 40%; max-width: 50%; padding: 8px 16px 8px 0; } @media (max-width: 769px) { .rh2-home-section-restaurants-body-item { min-width: 90%; max-width: 100%; padding: 8px 0px; } } .rh2-home-section-restaurants { position: relative; margin-top: 40px; padding-left: 8px; padding-right: 8px; } .rh2-home-section-restaurants-heading { font-family: 'Inter-Bold'; font-size: 24px; line-height: 36px; color: hsla(214, 11%, 25%, 1); } .rh2-home-section-restaurants-subheading { font-size: 16px; line-height: 26px; margin-bottom: 20px; color: hsla(214, 11%, 25%, 1); } /*.rh2-home-section-restaurants-body { position: relative; height: 240px; overflow: hidden; box-shadow: 0px 4px 4px hsla(15, 0%, 90%, 1); }*/ .rh2-home-section-restaurants-wrapper { position: relative; height: 260px; width: 100%; overflow-x: scroll; overflow-y: hidden; scroll-behavior: smooth; } .rh2-home-section-restaurants-container { height: 240px; } .rh2-home-section-restaurants-nav { width: 32px; height: 32px; font-size: 16px; line-height: 32px; text-align: center; border: 1px solid hsla(15, 0%, 80%, 1); border-radius: 16px; background-color: hsla(15, 0%, 100%, 1); cursor: pointer; transition: 0.5s; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; z-index: 1; } .rh2-home-section-restaurants-prev { position: absolute; right: -8px; top: 160px; } .rh2-home-section-restaurants-next { position: absolute; right: -8px; top: 120px; } .rh2-home-section-restaurants-item { float: left; position: relative; display: block; } .rh2-home-section-articles { position: relative; padding-left: 8px; padding-right: 8px; color: hsla(214, 11%, 25%, 1); } .rh2-home-section-articles-heading { font-family: 'Inter-Bold'; font-size: 20px; line-height: 36px; margin-bottom: 16px; } .rh2-home-section-articles-heading::before { content: ""; display: inline-block; width: 24px; height: 24px; padding-left: 10px; background: url(/rh2/static/icon/site/news.svg) no-repeat; background-size: contain; } .rh2-home-section-articles-subheading { font-size: 16px; line-height: 26px; margin-bottom: 28px; } .rh2-home-section-articles-body { position: relative; height: 240px; overflow: hidden; } .rh2-home-section-articles-wrapper { position: relative; height: 260px; width: 100%; overflow-x: scroll; overflow-y: hidden; scroll-behavior: smooth; } .rh2-home-section-articles-container { height: 240px; } .rh2-home-section-articles-nav { width: 32px; height: 32px; font-size: 16px; line-height: 32px; text-align: center; cursor: pointer; transition: 0.5s; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; z-index: 1; } .rh2-home-section-articles-prev { position: absolute; left: 16px; top: 160px; text-indent: -9000px; background-image: url(/rh2/static/icon/site/back.svg); background-size: 32px 32px; } .rh2-home-section-articles-next { position: absolute; right: 28px; top: 160px; text-indent: -9000px; background-image: url(/rh2/static/icon/site/next.svg); background-size: 32px 32px; } @media (max-width: 769px) { .rh2-home-section-articles-next { /* right: 8px; */ } } .rh2-home-section-articles-item { height: 100%; width: 406px; margin-right: 16px; float: left; position: relative; display: block; cursor: pointer; } .rh2-home-section-articles-item-image { height: 100%; width: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-home-section-articles-item-image img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; } .rh2-home-section-articles-item-footer { position: absolute; bottom: 0px; right: 0px; padding-top: 8px; padding-bottom: 10px; padding-left: 8px; padding-right: 8px; width: 100%; background-color: hsla(0, 0%, 100%, 0.80); } .rh2-home-section-articles-item-title-row { height: 24px; max-height: 24px; line-height: 24px; max-width: 100%; overflow: hidden; font-family: 'Inter-SemiBold'; font-size: 20px; padding-left: 8px; margin-bottom: 4px; text-overflow: ellipsis; white-space: nowrap; } .rh2-home-section-articles-item-author-row { height: 16px; padding-left: 8px; } .rh2-home-section-articles-item-author { display: inline-block; font-family: 'Inter-Regular'; font-size: 14px; text-align: right; margin-bottom: 8px; padding-right: 8px; } .rh2-home-section-articles-item-published-at { display: inline-block; font-family: 'Inter-Regular'; font-size: 14px; text-align: right; margin-bottom: 8px; padding-right: 8px; } @media (max-width: 769px) { .rh2-home-section-articles-body { height: 220px; } .rh2-home-section-articles-wrapper { height: 240px; } .rh2-home-section-articles-container { height: 220px; } .rh2-home-row-0-section-takeaway-text { line-height: unset; } .rh2-home-row-0-section-takeaway-button { display: block; margin: 8px auto; } .rh2-home-discover-locations { height: unset; } } .rh2-home-product-tile { margin-bottom: 8px; padding: 8px; background: hsla(15, 0%, 100%, 1); border: 1px solid hsla(15, 0%, 90%, 1); padding-top: 32px; box-shadow: 0px 4px 4px hsla(15, 0%, 90%, 1); } .rh2-home-product-tile-takeaway { color: hsla(141, 89%, 35%, 1); } .rh2-home-product-tile-rewards { color: hsla(205, 100%, 44%, 1); } .rh2-home-product-tile-stardeal { color: hsla(214, 10%, 25%, 1); } .rh2-home-product-tile-shop { color: hsla(15, 90%, 55%, 1); } .rh2-home-product-tile-row-title { font-family: 'Inter-SemiBold'; font-size: 24px; line-height: 24px; text-align: center; margin-bottom: 12px; } .rh2-home-product-tile-row-description { text-align: center; font-size: 16px; line-height: 25px; margin-bottom: 30px; } .rh2-home-product-tile-image-shop { width: 100%; height: 180px; background-image: url('/rh2/static/image/rh/rh_shop.jpg'); background-size: contain; background-repeat: no-repeat; background-position: center; margin-bottom: 16px; } .rh2-home-product-tile-row-action { margin-bottom: 8px; text-align: center; } .rh2-home-product-tile-action-button { display: inline-block; font-family: 'Inter-Bold'; font-size: 12px; line-height: 18px; border: 1px solid; border-radius: 2px; padding: 15px; text-decoration: none; } .rh2-home-product-tile-shop .rh2-home-product-tile-action-button { color: hsla(15, 90%, 55%, 1); } .rh2-home-section { position: relative; margin: 1em auto 2em; padding-left: 8px; padding-right: 8px; } .rh2-home-section-title { font-family: 'Inter-Bold'; font-size: 24px; line-height: 36px; color: hsla(214, 11%, 25%, 1); } .rh2-home-section-body { margin: auto; } .rh2-home-section-body-content-tiles { position: relative; height: 400px; overflow: hidden; } .rh2-home-section-content-tiles-container-wrapper { position: relative; height: 420px; width: 100%; overflow-x: scroll; overflow-y: hidden; scroll-behavior: smooth; } .rh2-home-section-content-tiles-container { height: 400px; } .rh2-home-section-content-tiles-nav { width: 32px; height: 32px; font-size: 16px; line-height: 32px; text-align: center; border: 1px solid hsla(15, 0%, 80%, 1); border-radius: 16px; background-color: hsla(15, 0%, 100%, 1); cursor: pointer; transition: 0.5s; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-home-section-content-tiles-prev { position: absolute; left: -8px; top: 200px; } .rh2-home-section-content-tiles-next { position: absolute; right: -8px; top: 200px; } .rh2-home-content-tile-item { position: relative; display: block; width: 304px; height: 400px; margin-right: 16px; } .rh2-home-content-tile-item-image { position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; background-size: cover; background-repeat: no-repeat; background-position: center; border-radius: 8px; } .rh2-home-content-tile-item-name { position: absolute; display: block; width: 100%; height: 64px; bottom: 0px; text-align: center; padding-top: 16px; font-size: 14px; line-height: 18px; font-family: 'Inter-SemiBold'; color: hsla(15, 0%, 95%, 1); background: linear-gradient(0deg, hsla(15, 0%, 10%, 0.8), hsla(15, 0%, 10%, 0)); border-radius: 8px; } .rh2-home-content-tile-item-tag { position: absolute; top: 8px; left: 8px; display: block; padding-left: 4px; padding-right: 4px; border-radius: 4px; font-size: 14px; background-color: hsla(15, 95%, 50%, 1); color: hsla(15, 0%, 95%, 1); } .rh2-home-section-body-restaurateurs { margin-top: 48px; height: 240px; /* background-color: hsla(175, 100%, 40%, 1); */ background-color: hsla(14, 88%, 55%, 1); padding-left: 8px; padding-right: 8px; padding-top: 48px; color: hsla(15, 0%, 100%, 1); } .rh2-home-section-restaurateurs-heading { font-size: 24px; font-family: 'Inter-SemiBold'; text-align: center; margin-bottom: 16px; } .rh2-home-section-restaurateurs-description { padding-left: 20%; padding-right: 20%; text-align: center; } .rh2-home-section-restaurateurs-action-row { text-align: center; padding-top: 16px; } .rh2-home-section-restaurateurs-action-button, .rh2-home-section-restaurateurs-action-button:visited { color: hsla(15, 95%, 50%, 1); display: inline-block; font-family: 'Inter-Bold'; font-size: 12px; line-height: 18px; border-radius: 2px; padding: 15px; background-color: hsla(0, 0%, 100%, 1); cursor: pointer; } .rh2-home-footer-row-0 { margin-top: 64px; padding-left: 5%; padding-right: 5%; border-top: 1px solid hsla(0, 0%, 92%, 1); } .rh2-home-footer-heading { margin-top: 24px; margin-bottom: 24px; font-family: 'Inter-SemiBold'; font-size: 14px; line-height: 24px; color: hsla(14, 88%, 55%, 1); } .rh2-home-footer-row-0 a { display: inline-block; font-size: 14px; line-height: 28px; text-decoration: none; color: black; } .rh2-home-footer-row-1 { margin-top: 48px; padding-top: 48px; padding-bottom: 48px; padding-left: 20%; padding-right: 20%; background-color: hsla(214, 10%, 25%, 1); font-size: 16px; line-height: 26px; color: hsla(0, 0%, 100%, 1); text-align: center; } .rh2-home-footer-row-2 { padding-top: 24px; padding-bottom: 24px; text-align: center; font-size: 14px; line-height: 24px; color: hsla(214, 10%, 25%, 1); } .rh2-home-footer-row-2 a { display: inline-block; margin-left: 8px; margin-right: 8px; text-decoration: none; } .rh2-home-consumer-app-android, .rh2-home-consumer-app-ios { width: 192px; height: 58px; margin: 10px 0 0; } .rh2-home-consumer-app-android-img { background-image: url('/rh2/static/image/apps/badge-playstore.png?r=1'); } .rh2-home-consumer-app-ios-img { background-image: url('/rh2/static/image/apps/badge-appstore.png?r=1'); } .rh2-home-consumer-app-android-img, .rh2-home-consumer-app-ios-img { width: 100%; height: 100%; background-size: 100% auto; background-repeat: no-repeat; background-position: center; } .rh2-home-merchant-app-android, .rh2-home-merchant-app-ios { width: 192px; height: 58px; margin: 10px 0 0; } .rh2-home-merchant-app-android-img { background-image: url('/rh2/static/image/apps/badge-playstore.png?r=1'); } .rh2-home-merchant-app-ios-img { background-image: url('/rh2/static/image/apps/badge-appstore.png?r=1'); } .rh2-home-merchant-app-android-img, .rh2-home-merchant-app-ios-img { width: 100%; height: 100%; background-size: 100% auto; background-repeat: no-repeat; background-position: center; } @media (max-width: 769px) { .rh2-home-row-0 { margin-top: 0px; } .rh2-home-row-0-col-right { padding: 16px; } .rh2-home-finder { height: 600px; padding: 24px; } .rh2-home-finder-logo { margin-top: 24px; } .rh2-home-finder-row-title { font-size: 18px; color: hsla(14, 88%, 55%, 1); } .rh2-home-crusoe-container { height: 320px; } .rh2-home-crusoe-item-image { height: 220px; } .rh2-home-crusoe-item-text { left: 5%; } .rh2-home-crusoe-item-text-tag { display: none; } .rh2-home-crusoe-item-text-title { line-height: 20px; margin-top: 16px; padding-left: 0px; font-size: 18px; text-align: center; } .rh2-home-crusoe-item-text-description { padding-left: 8px; padding-right: 8px; height: 90px; margin-bottom: 8px; } .rh2-home-crusoe-item-text-link { padding-left: 0px; text-align: center; } .rh2-home-crusoe-item-handles-container { top: 40%; } .rh2-home-section-restaurants-body { min-height: 480px; } .rh2-home-section-restaurants-wrapper { height: 100%; } .rh2-home-section-restaurants-prev { top: 340px; left: 0px; } .rh2-home-section-restaurants-next { top: 340px; right: 0px; } .rh2-home-section-content-tiles-prev { left: 0px; } .rh2-home-section-content-tiles-next { right: 0px; } .rh2-home-section-body-restaurateurs { padding-top: 16px; height: 310px; } .rh2-home-section-restaurateurs-headline { margin-bottom: 8px; } .rh2-home-section-restaurateurs-action-row { padding-top: 8px; } .rh2-home-section-restaurateurs-text { padding-left: 5%; padding-right: 5%; } } /* Calendar */ /* .rh2-calendar-month { width: 280px; margin-left: 10px; margin-right: 10px; } .rh2-calendar-month .rh2-calendar-row0 { font-family: 'Inter-SemiBold'; font-size: 18px; line-height: 30px; margin-bottom: 20px; } .rh2-calendar-month thead tr th { font-family: 'Inter-Regular'; font-size: 12px; line-height: 30px; } .rh2-calendar-month tbody tr { height: 38px; } .rh2-calendar-month tbody tr td { width: 38px; height: 38px; font-family: 'OpenSans-Bold'; font-size: 14px; line-height: 8px; text-align: center; } .rh2-calendar-month tbody tr td.rh2-calendar-unselectable { background-color: hsla(0, 0%, 97%, 1); color: hsla(0, 0%, 85%, 1); } .rh2-calendar-month tbody tr td.rh2-calendar-selectable { background-color: hsla(7, 100%, 98%, 1); color: hsla(14, 88%, 55%, 1); } .rh2-calendar-month tbody tr td.rh2-calendar-selected { background-color: hsla(14, 88%, 55%, 1); color: hsla(0, 0%, 100%, 1); } */ .rh2-calendar-container { width: 100%; } .rh2-calendar-month { width: 100%; margin-left: auto; margin-right: auto; } .rh2-calendar-row-control { width: 100%; text-align: center; display: flex; flex-direction: row; margin-bottom: 16px; } .rh2-calendar-row-control-col-prev { flex: initial; width: 24px; display: inline-block; height: 24px; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_chevron_left_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-calendar-row-control-col-value { flex: 1; text-align: center; display: inline-block; width: 128px; font-weight: bold; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-calendar-row-control-col-next { flex: initial; width: 24px; display: inline-block; height: 24px; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_chevron_right_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-calendar-month thead tr th { width: 38px; font-size: 14px; line-height: 30px; } .rh2-calendar-month tbody tr { height: 38px; } .rh2-calendar-month tbody tr td { width: 38px; height: 38px; border-radius: 8px; font-size: 14px; line-height: 19px; text-align: center; } .rh2-calendar-month tbody tr td.rh2-calendar-unselectable { position: relative; color: #B1B1B1; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-calendar-month tbody tr td.rh2-calendar-selectable { position: relative; color: #0D0F10; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-calendar-month tbody tr td.rh2-calendar-selected { background-color: hsla(14, 88%, 55%, 1); color: hsla(0, 0%, 100%, 1); } /*Scott small stars on booking form*/ .rh2-calendar-date-star { width: 12px; height: 12px; position: absolute; bottom: 1px; left: 50%; margin-left: -13px; background-image: url('/rh2/static/icon/bookingform/star-s-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-calendar-date-star-hd { width: 12px; height: 12px; position: absolute; bottom: 1px; left: 50%; margin-left: 2px; background-image: url('/rh2/static/icon/bookingform/star-hd-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-calendar-unselectable .rh2-calendar-date-star, .rh2-calendar-unselectable .rh2-calendar-date-star-hd { display: none; } .rh2-calendar-date-highlight { background-color: hsla(348, 100%, 95%, 1); } .rh2-calendar-selected .rh2-calendar-date-star { background-image: url('/rh2/static/icon/bookingform/star-s-fill-selected.svg?r'); } .rh2-calendar-selected .rh2-calendar-date-star-hd { background-image: url('/rh2/static/icon/bookingform/star-hd-fill-selected.svg?r'); } /* BusinessList */ .rh2-business-list-desktop-page-row { font-family: 'Inter-Regular'; margin-top: 96px; min-height: 640px; display: flex; flex-direction: row; padding: 0 16px; } .rh2-business-list-desktop-page-left { flex: 7; padding-right: 16px; } .rh2-business-list-desktop-page-right { flex: 5; padding-left: 8px; position: sticky; top: 0; } .rh2-business-list-category-row { width: 100%; display: flex; border-bottom: solid 3px hsla(15, 95%, 50%, 1); margin-bottom: 15px; } .rh2-business-list-category-row-desktop { background-color: hsla(0, 0%, 100%, 1); top: 96px; } .rh2-business-list-category-row-mobile { justify-content: space-evenly; background-color: hsla(0, 0%, 100%, 1); top: 48px; } .rh2-business-list-category-row-mobile-map { display: none; } .rh2-business-list-category-row-item { height: 48px; padding: 0 12px 0 12px; font-size: 16px; border-top-left-radius: 8px; border-top-right-radius: 8px; background-color: hsla(0, 0%, 100%, 1); cursor: pointer; user-select: none; text-wrap: nowrap; display: flex; align-items: center; justify-content: center; } .rh2-business-list-category-row-item-desktop { padding: 0 20px 0 20px; min-width: 100px; } .rh2-business-list-category-row-item-mobile { flex: 1; } .rh2-business-list-category-row-listview .rh2-business-list-category-row-item {} .rh2-business-list-category-row-item-active { background-color: hsla(15, 95%, 50%, 1) !important; color: hsla(0, 0%, 100%, 1); border-bottom-color: hsla(15, 95%, 50%, 1); } .rh2-business-promotion-structure-desktop-row { margin: 12px auto 20px; } .rh2-business-promotion-structure-mobile-row { margin: 8px; } /* FILTER */ .rh2-business-filter-viewport { width: 100%; height: 48px; position: sticky; top: 88px; background: hsla(0, 0%, 100%, 1); z-index: 5; display: flex; flex-direction: row; padding-left: 0px; padding-top: 8px; padding-bottom: 8px; } .rh2-business-filter-layout-business-list-mobile { width: 100%; height: 48px; } .rh2-business-filter-mobile-row-variant-map-view {} .rh2-business-filter-mobile-row-0 { width: 100%; max-width: 100%; height: 40px; display: flex; flex-direction: row; padding-left: 8px; padding-bottom: 8px; z-index: 12; } .rh2-business-filter-mobile-row-1 { width: 100%; height: 44px; display: flex; flex-direction: row; padding-left: 8px; padding-bottom: 0px; } .rh2-business-filter-mobile-row-variant-map-view.rh2-business-filter-mobile-row-0 { position: fixed; top: 48px; } .rh2-business-filter-mobile-row-variant-map-view.rh2-business-filter-mobile-row-1 { position: fixed; top: 71px; z-index: 19; background: white; } .rh2-business-filter-mobile-category-col { width: 72px; min-width: 72px; height: 36px; flex: initial; position: relative; background-color: #FFFFFF; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; margin-right: 10px; cursor: pointer; } .rh2-business-filter-mobile-category { width: 100%; height: 32px; border: 0; font-size: 16px; padding: 8px; padding-left: 2px; padding-right: 2px; overflow: hidden; text-overflow: ellipsis; } .rh2-business-filter-mobile-category-highlight { color: hsla(14, 88%, 55%, 1); } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-mobile-category { padding-left: 6px; } .rh2-business-filter-mobile-category-dropdown { position: absolute; left: 0px; top: 40px; width: 144px; height: 320px; box-shadow: 0px 3px 13px #00000010; background-color: hsla(0, 0%, 100%, 1); border: 1px solid hsla(0, 0%, 90%, 1); overflow: auto; padding: 8px; z-index: 10; } .rh2-business-filter-mobile-category-dropdown-hidden { display: none !important; } .rh2-business-filter-mobile-category-dropdown-option { width: 90%; font-size: 14px; font-family: 'Inter-SemiBold'; padding: 14px; cursor: pointer; } .rh2-business-filter-mobile-category-dropdown-option-selected { border-radius: 24px; background-color: #eeeeee; } .rh2-business-filter-coupon { height: 36px; flex: initial; position: relative; background-color: #FFFFFF; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; padding: 8px; padding-left: 24px; margin-right: 8px; cursor: pointer; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-coupon { padding-left: 20px; padding-right: 2px; margin-right: 4px; /* width: 36px; min-width: 36px; border-right: none; margin-right: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; */ } .rh2-business-filter-coupon-active { background-color: #3cc0a2 !important; color: #ffffff !important; } .rh2-business-filter-coupon-icon { position: absolute; left: 4px; top: 10px; width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-live.svg?r'); } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-coupon-icon { left: 2px; } .rh2-business-filter-coupon-active .rh2-business-filter-coupon-icon { background-image: url('/rh2/static/icon/site/star-white.svg?r'); } .rh2-business-filter-special { height: 36px; flex: initial; position: relative; background-color: #FFFFFF; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; padding: 8px; padding-left: 24px; margin-right: 8px; cursor: pointer; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-special { padding-left: 20px; padding-right: 2px; margin-right: 4px; /* width: 36px; min-width: 36px; border-right: none; margin-right: 0px; border-radius: 0px; */ } .rh2-business-filter-special-active { background-color: #f22752 !important; color: #ffffff !important; } .rh2-business-filter-special-icon { position: absolute; left: 4px; top: 10px; width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special.svg?r'); } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-special-icon { left: 2px; } .rh2-business-filter-special-active .rh2-business-filter-special-icon { background-image: url('/rh2/static/icon/site/star-white.svg?r'); } .rh2-business-filter-booking { height: 36px; flex: initial; position: relative; background-color: #FFFFFF; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; padding: 8px; padding-left: 24px; margin-right: 8px; cursor: pointer; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-booking { padding-left: 20px; padding-right: 2px; /* width: 36px; min-width: 36px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; */ } .rh2-business-filter-booking-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #ffffff !important; } .rh2-business-filter-booking-icon { position: absolute; left: 4px; top: 10px; width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-booking.svg?r'); } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-booking-icon { left: 2px; } .rh2-business-filter-booking-active .rh2-business-filter-booking-icon { background-image: url('/rh2/static/icon/site/star-white.svg?r'); } .rh2-business-filter-pdt-bar { position: relative; display: flex; margin-bottom: 8px; align-content: flex-start; height: 36px; padding-top: 6px; padding-bottom: 6px; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; background-color: hsla(0, 0%, 100%, 1); margin-left: 4px; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-bar { margin-left: 0px; } .rh2-business-filter-mobile-row-variant-map-view .rh2-business-filter-pdt-bar { margin-left: 0px; } .rh2-business-filter-pdt-pax-col { flex: initial; width: 96px; border-radius: 8px; position: relative; cursor: pointer; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-pax-col { width: 56px; } .rh2-business-filter-pdt-pax-icon { position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/group-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } /* .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-pax-icon-hidden { display: none; } */ .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-pax-icon { left: 8px; } .rh2-business-filter-pdt-pax { width: 100%; border: 0; font-size: 16px; line-height: 24px; padding-left: 40px; color: hsla(0, 88%, 55%, 1); } .rh2-business-filter-pdt-pax-placeholder { font-size: 16px; line-height: 24px; padding-left: 36px; color: hsla(0, 0%, 75%, 1); } .rh2-business-filter-pdt-pax-placeholder-hidden { display: none !important; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-pax { padding-left: 32px; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-pax-placeholder { display: none; padding-left: 32px; } .rh2-business-filter-pdt-pax-dropdown { position: absolute; left: 0px; top: 40px; width: 120px; height: 360px; box-shadow: 0px 3px 13px #00000010; background-color: hsla(0, 0%, 100%, 1); border: 1px solid hsla(0, 0%, 90%, 1); overflow: auto; padding: 16px; padding-top: 0px; z-index: 10; } .rh2-business-filter-pdt-pax-dropdown-hidden { display: none !important; } .rh2-business-filter-pdt-pax-dropdown-option { width: 90%; font-size: 14px; font-family: 'Inter-SemiBold'; padding: 14px; cursor: pointer; } .rh2-business-filter-pdt-pax-dropdown-option-selected { border-radius: 24px; background-color: #eeeeee; } .rh2-business-filter-pdt-date-col { flex: initial; min-width: 142px; height: 24px; position: relative; cursor: pointer; border-left: 1px solid hsla(0, 0%, 80%, 1); border-right: 1px solid hsla(0, 0%, 80%, 1); } .rh2-business-filter-pdt-date-icon { position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/calendar-event-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } /* .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-date-icon-hidden { display: none; } */ .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-date-icon { left: 8px; } .rh2-business-filter-pdt-date { min-width: 142px; border: 0; font-size: 16px; line-height: 24px; padding-left: 40px; padding-right: 10px; color: hsla(0, 88%, 55%, 1); } .rh2-business-filter-pdt-date-placeholder { font-size: 16px; line-height: 24px; padding-left: 44px; color: hsla(0, 0%, 75%, 1); } .rh2-business-filter-pdt-date-placeholder-hidden { display: none !important; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-date { padding-left: 32px; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-date-placeholder { padding-left: 32px; } .rh2-business-filter-pdt-date-dropdown { position: absolute; left: 0px; top: 40px; width: 324px; height: 360px; box-shadow: 0px 3px 13px #00000010; background-color: hsla(0, 0%, 100%, 1); border: 1px solid hsla(0, 0%, 90%, 1); overflow: auto; padding: 16px; z-index: 10; } /* .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-date-dropdown { left: -96px; } */ .rh2-business-filter-pdt-date-dropdown-hidden { display: none !important; } .rh2-business-filter-pdt-time-col { flex: initial; width: 96px; border-radius: 8px; position: relative; cursor: pointer; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-time-col { width: 84px; } .rh2-business-filter-pdt-time-icon { position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/time-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } /* .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-time-icon-hidden { display: none; } */ .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-time-icon { left: 8px; } .rh2-business-filter-pdt-time { width: 100%; border: 0; font-size: 16px; line-height: 24px; padding-left: 40px; color: hsla(0, 88%, 55%, 1); } .rh2-business-filter-pdt-time-placeholder { font-size: 16px; line-height: 24px; padding-left: 44px; color: hsla(0, 0%, 75%, 1); } .rh2-business-filter-pdt-time-placeholder-hidden { display: none !important; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-time { padding-left: 32px; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-time-placeholder { padding-left: 32px; } .rh2-business-filter-pdt-time-dropdown { position: absolute; right: 0px; top: 40px; width: 120px; height: 360px; box-shadow: 0px 3px 13px #00000010; background-color: hsla(0, 0%, 100%, 1); border: 1px solid hsla(0, 0%, 90%, 1); overflow: auto; padding: 16px; padding-top: 0px; z-index: 10; } .rh2-business-filter-pdt-time-dropdown-hidden { display: none !important; } .rh2-business-filter-pdt-time-dropdown-option { width: 90%; font-size: 14px; font-family: 'Inter-SemiBold'; padding: 14px; cursor: pointer; } .rh2-business-filter-pdt-time-dropdown-option-selected { border-radius: 24px; background-color: #eeeeee; } .rh2-business-filter-pdt-clear-col { flex: initial; width: 36px; border-left: 1px solid hsla(0, 0%, 80%, 1); position: relative; cursor: pointer; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-clear-col { width: 32px; } .rh2-business-filter-pdt-clear-col-hidden { display: none; } .rh2-business-filter-pdt-clear-icon { position: absolute; top: 0px; left: 6px; width: 24px; height: 24px; background-image: url('/rh2/static/icon/site/close.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-clear-icon { left: 2px; } .rh2-business-padding-pdt-padding-col { flex: 1; } .rh2-business-filter-pdt-filter-col { flex: initial; width: 40px; } .rh2-business-filter-layout-business-list-mobile .rh2-business-filter-pdt-filter-col { margin-left: 6px; } .rh2-business-filter-pdt-filter-icon { position: relative; top: 2px; left: 2px; width: 32px; height: 32px; background-image: url('/rh2/static/icon/site/tune-light.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; background-color: hsla(0, 0%, 100%, 1); cursor: pointer; } .rh2-business-filter-pdt-filter-active-counter { position: absolute; top: -6px; right: -4px; width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center; background-color: hsla(14, 88%, 55%, 1); color: #FFFFFF; } .rh2-business-filter-pdt-filter-active-counter-hidden { display: none; } /* .rh2-business-filter-pdt-item { flex: initial; margin-right: 8px; width: 120px; min-height: 40px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); margin-bottom: 12px; cursor:pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; display: table; } .rh2-business-filter-pdt-item-text { display: table-cell; vertical-align: middle; } .rh2-business-filter-pdt-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } */ .rh2-business-filter-desktop-row {} .rh2-business-filter-desktop-row-col { position: relative; margin-right: 8px; } .rh2-business-filter-desktop-row-item { height: 36px; line-height: 28px; padding: 4px; padding-left: 8px; padding-right: 8px; border: 1px solid #dddddd; border-radius: 8px; font-size: 14px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-filter-desktop-row-item-active { color: hsla(0, 0%, 100%, 1); background-color: hsla(15, 95%, 50%, 1); } .rh2-business-filter-desktop-row-clear { height: 36px; line-height: 28px; padding: 4px; padding-left: 8px; padding-right: 8px; margin-right: 8px; font-size: 14px; color: hsla(15, 95%, 50%, 0.75); text-decoration: underline; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-filter-desktop-panel-overlay { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; z-index: 90; background-color: hsla(0, 0%, 0%, 0.5); } .rh2-business-filter-desktop-panel-fixed { position: fixed; top: 15%; left: 15%; z-index: 100; width: 70%; height: 70%; background-color: hsla(0, 0%, 100%, 1); } .rh2-business-filter-desktop-panel { width: 100%; height: 100%; padding-top: 0px; padding-bottom: 64px; overflow: auto; } .rh2-business-filter-desktop-panel-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; background-image: url('/rh2/static/icon/site/close.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; } /* BusinessFilter mobile */ .rh2-business-filter-mobile-panel-fixed { position: fixed; top: 0; left: 0; z-index: 100; width: 100%; height: 100%; background-color: hsla(0, 0%, 100%, 1); } .rh2-business-filter-mobile-panel { width: 100%; height: 100%; padding-top: 0px; padding-bottom: 64px; overflow: auto; } .rh2-business-filter-mobile-panel-close { position: fixed; top: 8px; right: 8px; width: 32px; height: 32px; background-image: url('/rh2/static/icon/site/close.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-filter-mobile-heading { font-size: 32px; padding: 16px; padding-bottom: 16px; } .rh2-business-filter-mobile-panel-section { width: 100%; padding: 16px; padding-top: 0px; padding-bottom: 0px; } .rh2-business-filter-mobile-panel-section-heading { font-family: 'Inter-SemiBold'; margin-bottom: 16px; } .rh2-business-filter-mobile-panel-section-item { background-size: cover; background-repeat: no-repeat; } .rh2-business-filter-mobile-panel-section-item-active { background-color: hsla(14, 88%, 55%, 1); color: #FFFFFF !important; } .rh2-business-filter-mobile-panel-section-item-inactive { background-color: hsla(0, 0%, 80%, 1); } .rh2-business-filter-mobile-panel-section-action-row { position: absolute; bottom: 0px; left: 0px; width: 100%; display: flex; flex-wrap: wrap; flex-direction: row-reverse; padding: 16px; background-color: hsla(0, 0%, 100%, 1); } .rh2-business-filter-desktop-panel .rh2-business-filter-mobile-panel-section-action-row { padding-right: 32px; } .rh2-business-filter-mobile-panel-section-action-row-apply { flex: initial; width: 80px; height: 36px; margin-left: 20px; padding: 6px; text-align: center; background-color: hsla(14, 88%, 55%, 1); color: #ffffff; border-radius: 10px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-filter-mobile-panel-section-action-row-reset { flex: initial; width: 80px; height: 36px; padding: 6px; text-align: center; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 10px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-filter-mobile-panel-section-promotion {} .rh2-business-filter-mobile-panel-section-promotion-body { display: flex; flex-wrap: wrap; gap: 6px; } .rh2-business-filter-mobile-panel-section-promotion-item { height: 32px; padding: 6px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.15); } .rh2-business-filter-mobile-panel-section-promotion-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } .rh2-business-filter-mobile-panel-section-price {} .rh2-business-filter-mobile-panel-section-price-body { display: flex; margin-bottom: 8px; flex-wrap: wrap; align-content: flex-start; } .rh2-business-filter-mobile-panel-section-price-item { flex: initial; margin-right: 8px; width: 48px; height: 32px; padding: 6px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); margin-bottom: 12px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-filter-mobile-panel-section-price-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } .rh2-business-filter-mobile-panel-section-cuisine {} .rh2-business-filter-mobile-panel-section-cuisine-body { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; align-content: flex-start; } .rh2-business-filter-mobile-panel-section-cuisine-item { flex: initial; width: 100px; height: 50px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; display: table; background-color: hsla(0, 0%, 0%, 0.25); background-blend-mode: saturation; } .rh2-business-filter-mobile-panel-section-cuisine-item.rh2-business-filter-mobile-panel-section-item-active { background-color: hsla(14, 88%, 55%, 1) !important; background-blend-mode: color-burn !important; } .rh2-business-filter-mobile-panel-section-cuisine-item-text { display: table-cell; vertical-align: middle; color: #ffffff; font-family: 'Inter-Bold'; } .rh2-business-filter-mobile-panel-section-cuisine-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } .rh2-business-filter-mobile-panel-section-dietary {} .rh2-business-filter-mobile-panel-section-dietary-body { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; align-content: flex-start; } .rh2-business-filter-mobile-panel-section-dietary-item { flex: initial; width: 100px; height: 50px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; display: table; background-color: hsla(0, 0%, 0%, 0.25); background-blend-mode: saturation; } .rh2-business-filter-mobile-panel-section-dietary-item.rh2-business-filter-mobile-panel-section-item-active { background-color: hsla(14, 88%, 55%, 1) !important; background-blend-mode: color-burn !important; } .rh2-business-filter-mobile-panel-section-dietary-item-text { display: table-cell; vertical-align: middle; color: #ffffff; font-family: 'Inter-Bold'; } .rh2-business-filter-mobile-panel-section-dietary-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } .rh2-business-filter-mobile-panel-section-feature {} .rh2-business-filter-mobile-panel-section-feature-body { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; align-content: flex-start; } .rh2-business-filter-mobile-panel-section-feature-item { flex: initial; width: 100px; height: 50px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; display: table; background-color: hsla(0, 0%, 0%, 0.25); background-blend-mode: saturation; } .rh2-business-filter-mobile-panel-section-feature-item.rh2-business-filter-mobile-panel-section-item-active { background-color: hsla(14, 88%, 55%, 1) !important; background-blend-mode: color-burn !important; } .rh2-business-filter-mobile-panel-section-feature-item-text { display: table-cell; vertical-align: middle; color: #ffffff; font-family: 'Inter-Bold'; } .rh2-business-filter-mobile-panel-section-feature-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } .rh2-business-filter-mobile-panel-section-booking {} .rh2-business-filter-mobile-panel-section-booking-body { height: 420px; margin-bottom: 8px; } .rh2-business-filter-mobile-panel-section-booking-bar { position: relative; display: flex; margin-bottom: 8px; align-content: flex-start; height: 50px; padding-top: 13px; padding-bottom: 13px; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; } .rh2-business-filter-mobile-panel-section-booking-pax-col { flex: initial; width: 72px; border-radius: 8px; position: relative; cursor: pointer; } .rh2-business-filter-mobile-panel-section-booking-date-col { flex: initial; width: 144px; height: 24px; position: relative; cursor: pointer; border-left: 1px solid hsla(0, 0%, 80%, 1); border-right: 1px solid hsla(0, 0%, 80%, 1); } .rh2-business-filter-mobile-panel-section-booking-time-col { flex: 1; border-radius: 8px; position: relative; cursor: pointer; } .rh2-business-filter-mobile-panel-section-booking-pax-icon { position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/group-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-filter-mobile-panel-section-booking-date-icon { position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/calendar-event-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-filter-mobile-panel-section-booking-time-icon { position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/time-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-filter-mobile-panel-section-booking-pax { width: 100%; border: 0; font-size: 16px; line-height: 24px; padding-left: 44px; } .rh2-business-filter-mobile-panel-section-booking-date { width: 100%; border: 0; font-size: 16px; line-height: 24px; padding-left: 44px; } .rh2-business-filter-mobile-panel-section-booking-time { width: 100%; border: 0; font-size: 16px; line-height: 24px; padding-left: 44px; } .rh2-business-filter-mobile-panel-section-booking-pax-dropdown { position: absolute; left: 0px; top: 56px; width: 120px; height: 360px; box-shadow: 0px 3px 13px #00000010; background-color: hsla(0, 0%, 100%, 1); overflow: auto; padding: 16px; padding-top: 0px; } .rh2-business-filter-mobile-panel-section-booking-pax-dropdown-hidden { display: none !important; } .rh2-business-filter-mobile-panel-section-booking-pax-dropdown-option { width: 90%; font-size: 14px; font-family: 'Inter-SemiBold'; padding: 14px; cursor: pointer; } .rh2-business-filter-mobile-panel-section-booking-pax-dropdown-option-selected { border-radius: 24px; background-color: #eeeeee; } .rh2-business-filter-mobile-panel-section-booking-date-dropdown { position: absolute; left: 0px; top: 56px; width: 324px; height: 360px; box-shadow: 0px 3px 13px #00000010; overflow: auto; padding: 16px; } .rh2-business-filter-mobile-panel-section-booking-date-dropdown-hidden { display: none !important; } .rh2-business-filter-mobile-panel-section-booking-time-dropdown { position: absolute; right: 0px; top: 56px; width: 120px; height: 360px; box-shadow: 0px 3px 13px #00000010; background-color: hsla(0, 0%, 100%, 1); overflow: auto; padding: 16px; padding-top: 0px; } .rh2-business-filter-mobile-panel-section-booking-time-dropdown-hidden { display: none !important; } .rh2-business-filter-mobile-panel-section-booking-time-dropdown-option { width: 90%; font-size: 14px; font-family: 'Inter-SemiBold'; padding: 14px; cursor: pointer; } .rh2-business-filter-mobile-panel-section-booking-time-dropdown-option-selected { border-radius: 24px; background-color: #eeeeee; } .rh2-business-filter-mobile-panel-section-booking-item { flex: initial; margin-right: 8px; width: 120px; min-height: 40px; font-size: 14px; text-align: center; border-radius: 8px; border: 1px solid hsla(0, 0%, 80%, 1); margin-bottom: 12px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; display: table; } .rh2-business-filter-mobile-panel-section-booking-item-text { display: table-cell; vertical-align: middle; } .rh2-business-filter-mobile-panel-section-booking-item-active { background-color: hsla(14, 88%, 55%, 1) !important; color: #FFFFFF !important; } /* BusinessList */ .rh2-business-list-pib { padding: 8px; position: relative; display: flex; flex-direction: row; align-items: center; background-color: #F15A2A; color: white; } .rh2-business-list-pib.hidden { display: none; } .rh2-business-list-pib-desktop { margin-bottom: 20px; } .rh2-business-list-pib-border { border-radius: 8px; } .rh2-business-list-pib-close-button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; background-image: url('/rh2/static/icon/site/close-white.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; color: white; } .rh2-business-list-pib-icon { margin: 16px; height: 64px; width: 64px; min-width: 64px; /* for some reason, width won't stay the same size on smaller screen */ background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-list-pib-icon-coupon { background-image: url('/rh2/static/icon/site/star-coupon.svg?r'); } .rh2-business-list-pib-icon-special { background-image: url('/rh2/static/icon/bookingform/star-s-fill-outline.svg'); } .rh2-business-list-pib-icon-special-hd { background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-list-pib-icon-booking { background-image: url('/rh2/static/icon/site/star-booking.svg?r'); } @media (min-width: 769px) { .rh2-business-list-pib-textarea { margin-top: 16px; margin-bottom: 16px; } } .rh2-business-list-pib-textarea-line { font-size: 14px; line-height: 16px; margin-top: 5px; } .rh2-business-list-pib-desktop .rh2-business-list-pib-textarea-line { font-size: 14px; line-height: 18px; } .rh2-business-list-pib-textarea-line.highlight { font-family: 'Inter-SemiBold'; font-size: 14px; color: white; } .rh2-business-list-pib-desktop .rh2-business-list-pib-textarea-line.highlight { font-size: 16px; } .rh2-business-list-pib-mobile { margin: 12px; } .rh2-business-list-pib-mobile .rh2-business-list-pib-icon { display: none; } .rh2-business-list-search-result-text { text-align: center; margin-top: 2em; margin-bottom: 2em; } .rh2-business-list-desktop-list { display: flex; flex-direction: column; gap: 20px; } .rh2-business-list-desktop-see-more { width: 100%; text-align: center; height: 32px; line-height: 32px; font-size: 14px; font-weight: bold; background-color: hsla(15, 95%, 50%, 0.1); color: hsla(15, 95%, 50%, 0.75); border-radius: 8px; margin-top: 8px; margin-bottom: 8px; cursor: pointer; user-select: none; position: relative; z-index: 10; } .rh2-business-list-mobile-list { padding-left: 12px; padding-right: 12px; } /* #BusinessList page right */ .rh2-business-list-desktop-sticky-right { position: sticky; top: 96px; width: 100%; display: flex; flex-direction: column; } .rh2-business-list-desktop-map-container { position: relative; flex: 14; width: 100%; } .rh2-business-list-desktop-map-wrapper { width: 100%; height: 100%; } .rh2-business-list-desktop-map-top-row { width: 100%; z-index: 10; position: absolute; top: 0; left: 0; padding: 8px; display: flex; flex-direction: row; font-size: 10px; } .rh2-business-list-desktop-map-filler { flex: 1; } .rh2-business-list-desktop-map-bookable-only { flex: initial; position: relative; background-color: #FFFFFF; border-radius: 8px; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); padding: 8px; padding-left: 36px; cursor: pointer; } .rh2-business-list-desktop-map-bookable-only-icon { position: absolute; left: 4px; top: 8px; width: 32px; height: 16px; } .rh2-business-list-desktop-map-bookable-only-icon-on { background-color: #FFFFFF; background-image: url('/rh2/static/icon/site/toggle_on.svg'); background-size: 75%; background-repeat: no-repeat; background-position: center; } .rh2-business-list-desktop-map-bookable-only-icon-off { background-color: #FFFFFF; background-image: url('/rh2/static/icon/site/toggle_off.svg'); background-size: 75%; background-repeat: no-repeat; background-position: center; } .rh2-business-list-desktop-map-search-area { position: absolute; z-index: 10; font-size: 12px; font-weight: bold; background-color: #FFFFFF; border-radius: 8px; padding: 12px; padding-left: 32px; top: 8px; left: 8px; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-desktop-map-search-area-icon { position: absolute; left: 8px; top: 12px; width: 20px; height: 20px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/action/2x_web/ic_search_black_36dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-list-desktop-map-search-area-hidden { display: none !important; } .rh2-business-list-desktop-map-zoom { position: absolute; z-index: 10; right: 12px; bottom: 80px; width: 40px; height: 80px; border-radius: 8px; background-color: #FFFFFF; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); } .rh2-business-list-desktop-map-zoom-in { width: 40px; height: 40px; border-bottom: 1px solid hsla(0, 0%, 0%, 0.16); background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/content/2x_web/ic_add_black_36dp.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-desktop-map-zoom-out { width: 40px; height: 40px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/content/2x_web/ic_remove_black_36dp.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-desktop-map-nearme { position: absolute; z-index: 8; bottom: 28px; right: 40px; height: 32px; font-size: 14px; padding: 6px; padding-right: 16px; background-color: #FFFFFF; border-radius: 8px; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-desktop-map-locate { position: absolute; z-index: 10; bottom: 24px; right: 12px; width: 40px; height: 40px; border-radius: 20px; background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; box-shadow: 0px 0px 8px 4px hsla(15, 0%, 0%, 0.16); background-image: url('/rh2/static/image/icon/awesome/locate.png'); } .rh2-business-infowindow-desktop-book-button { width: 96px; height: 48px; float: right; background-image: url('/rh2/static/icon/site/book-button-coloured.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-business-list-desktop-page-right-ad { flex: 2; } /* #BusinessList mobile */ .rh2-business-list-mobile-page-row { font-family: 'Inter-Regular'; margin-top: 70px; min-height: 640px; width: 100%; } .rh2-business-list-mobile-category-viewport { width: 100%; height: 24px; overflow-y: hidden; } .rh2-business-list-mobile-category-scroller { width: 100%; height: 32px; overflow: auto; } .rh2-business-list-mobile-category-row { width: 480px; height: 20px; padding-left: 8px; } .rh2-business-list-mobile-category-row-separator { display: inline-block; height: 100%; width: 16px; } .rh2-business-list-mobile-category-row-item { display: inline-block; height: 100%; text-align: left; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-category-row-item-active { color: hsla(15, 95%, 50%, 1); border-bottom: 2px solid hsla(15, 95%, 50%, 1); } .rh2-business-list-mobile-map-container { position: fixed; top: 114px; left: 0px; width: 100%; height: 100%; } .rh2-business-list-mobile-map-wrapper { width: 100%; height: 100%; } .rh2-business-list-mobile-map-search-area { position: fixed; top: 120px; left: 50%; margin-left: -72px; width: 144px; font-size: 12px; font-weight: bold; background-color: #FFFFFF; border-radius: 8px; padding: 8px; padding-left: 32px; color: hsla(14, 88%, 55%, 1); box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-map-search-area-icon { position: absolute; left: 8px; top: 4px; width: 20px; height: 20px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/action/2x_web/ic_search_black_36dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-list-mobile-map-search-area-hidden { display: none !important; } .rh2-business-list-mobile-map-zoom { position: absolute; z-index: 10; right: 12px; bottom: 80px; width: 40px; height: 80px; border-radius: 8px; background-color: #FFFFFF; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); } .rh2-business-list-mobile-map-zoom-in { width: 40px; height: 40px; border-bottom: 1px solid hsla(0, 0%, 0%, 0.16); background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/content/2x_web/ic_add_black_36dp.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-map-zoom-out { width: 40px; height: 40px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/content/2x_web/ic_remove_black_36dp.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-map-nearme { position: absolute; z-index: 8; bottom: 28px; right: 40px; height: 32px; font-size: 14px; padding: 6px; padding-right: 16px; background-color: #FFFFFF; border-radius: 8px; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-map-locate { position: fixed; z-index: 10; bottom: 16px; right: 16px; width: 48px; height: 48px; border-radius: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; box-shadow: 0px 0px 8px 4px hsla(15, 0%, 0%, 0.16); background-image: url('/rh2/static/image/icon/awesome/locate.png'); } .rh2-business-list-mobile-mode-switch { position: fixed; z-index: 10; right: 50%; bottom: 16px; margin-right: -40px; width: 80px; height: 44px; border: 2px solid hsla(0, 0%, 100%, 1); border-radius: 8px; background-color: #FFFFFF; box-shadow: 0px 2px 16px hsla(15, 0%, 0%, 0.5); display: flex; flex-direction: row; } .rh2-business-list-mobile-mode-switch-list { width: 40px; height: 40px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/action/2x_web/ic_list_black_36dp.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; border-top-left-radius: 8px; border-bottom-left-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-mode-switch-map { width: 40px; height: 40px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/maps/2x_web/ic_map_black_36dp.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; border-top-right-radius: 8px; border-bottom-right-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-mobile-mode-switch-on { background-color: hsla(14, 88%, 55%, 1); background-blend-mode: color-burn; } /* #Restaurants */ .rh2-fragment-restaurants { background-color: hsla(0, 0%, 100%, 1); } .rh2-restaurant-item-full-screen-overlay { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 1); z-index: 20; } .rh2-restaurant-item-full-screen-overlay-active { display: initial; } .rh2-restaurant-item-full-screen-overlay-close { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; border: 1px solid hsla(0, 0%, 0%, 1); } .rh2-restaurant-item-full-screen-overlay-close:hover { opacity: 1; } .rh2-restaurant-item-full-screen-overlay-translucent { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 0.5); z-index: 20; } .rh2-restaurant-item-full-screen-overlay-translucent-active { display: initial; } .rh2-restaurant-item-full-screen-overlay-translucent-close { position: absolute; right: 50%; top: 50%; margin-right: -440px; margin-top: -290px; width: 32px; height: 32px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; } .rh2-coupon-form-container { position: absolute; width: 800px; height: 500px; left: 50%; margin-left: -400px; top: 50%; margin-top: -250px; } .rh2-coupon-form-container-mobile { position: absolute; width: 100%; height: 100%; z-index: 10; background: hsla(0, 0%, 100%, 1); } .rh2-restaurant-item-photo-row-fw { margin-top: 16px; } .rh2-restaurant-item-photo-row { display: flex; flex-direction: row; height: 408px; } .rh2-restaurant-item-photo-row-left-col { position: relative; flex: 1; height: 100%; padding: 4px; padding-left: 0px; } .rh2-restaurant-item-photo-row-right-col { flex: initial; width: 424px; height: 100%; } .rh2-restaurant-item-photo-left { width: 100%; height: 400px; background-size: cover; background-repeat: no-repeat; background-position: center; border-radius: 16px 0px 0px 16px; } .rh2-restaurant-item-photo-show-all { display: flex; align-items: center; justify-content: center; position: absolute; right: 24px; bottom: 24px; width: 172px; height: 44px; background: #FFFFFF; border: 1px solid #C6C6C6; border-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-photo-show-all-icon { width: 20px; height: 20px; background-image: url('/rh2/static/image/icon/gallery-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; margin-right: 8px; } .rh2-restaurant-item-photo-show-all-text { font-size: 14px; color: #0D0F10; } .rh2-restaurant-item-photo-gallery-container { width: 100%; height: 100%; display: flex; flex-direction: column; } .rh2-restaurant-item-photo-gallery-display-section { position: relative; flex: 1; min-height: 0; width: 100%; } .rh2-restaurant-item-photo-gallery-nav-left { position: absolute; top: 50%; margin-top: -16px; left: 32px; width: 64px; height: 64px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_arrow_back_black_36dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; opacity: 0.5; } .rh2-restaurant-item-photo-gallery-nav-left:hover { opacity: 1; } .rh2-restaurant-item-photo-gallery-nav-right { position: absolute; top: 50%; margin-top: -16px; right: 32px; width: 64px; height: 64px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_arrow_forward_black_36dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; opacity: 0.5; } .rh2-restaurant-item-photo-gallery-nav-right:hover { opacity: 1; } .rh2-restaurant-item-photo-gallery-display { display: block; width: 80%; max-width: 80%; margin-left: 10%; height: 100%; max-height: 100%; overflow: hidden; } .rh2-restaurant-item-photo-gallery-display-image { position: relative; width: 100%; height: 100%; background-size: contain; background-repeat: no-repeat; background-position: center; transition: all 50ms linear; } .rh2-restaurant-item-photo-gallery-controller-section { flex: initial; height: 160px; max-height: 160px; overflow-x: scroll; } .rh2-restaurant-item-photo-gallery-controller-wrapper { height: 100%; } .rh2-restaurant-item-photo-thumbnail { display: inline-block; width: 100px; height: 100px; margin: 20px; background-size: cover; background-repeat: no-repeat; background-position: center; cursor: pointer; } .rh2-restaurant-item-photo-right-container { float: left; width: 50%; height: 50%; padding: 4px; } .rh2-restaurant-item-photo-right { width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-restaurant-item-photo-right-tl { background-size: contain; } .rh2-restaurant-item-photo-right-tr { border-radius: 0px 16px 0px 0px; } .rh2-restaurant-item-photo-right-br { border-radius: 0px 0px 16px 0px; } .rh2-restaurant-item-body-row-fw { position: relative; margin-top: 16px; } .rh2-restaurant-item-body-row { position: relative; width: 100%; display: flex; flex-direction: row; } .rh2-restaurant-item-body-row-left-col { flex: 1; padding-right: 64px; min-width: 0; } .rh2-restaurant-item-body-row-right-col { flex: initial; width: 380px; max-width: 100%; } .rh2-restaurant-item-desktop-reservation-form-wrapper { position: relative; width: 100%; padding-left: 16px; padding-right: 16px; padding-bottom: 32px; background-color: hsla(0, 0%, 100%, 1); } .rh2-restaurant-item-reservation-form-container { width: 100%; border-radius: 16px; box-shadow: 0px 3px 12px #00000014; border: 1px solid #EAEAEA; } .rh2-restaurant-item-reservation-form-container .rh2-booking-dialogue-close { display: none; } .rh2-restaurant-item-facebook-page-row { /* height: 1024px; */ max-height: 800px; overflow: hidden; text-align: center; } .rh2-restaurant-item-instagram-row { max-height: 420px; overflow: hidden; text-align: center; margin-top: 20px; } .rh2-restaurant-item-topnav { display: flex; justify-content: space-between; align-items: center; margin: 1em auto 2em; } .rh2-restaurant-item-topnav a { text-decoration: none; font-size: 1.1em; padding: 8px 16px; border: solid 1px grey; border-radius: 8px; } .rh2-restaurant-item-topnav a.booking { background-color: hsla(15, 85%, 55%, 1); color: white; border-color: hsla(15, 85%, 55%, 1); } .rh2-restaurant-item-nav-row { width: 100%; height: 48px; } .rh2-restaurant-item-nav-row-fixable { width: 100%; height: 48px; padding-top: 12px; padding-bottom: 12px; display: flex; flex-direction: row; border-bottom: 2px solid #EBEBEB; background-color: hsla(0, 0%, 100%, 1); } .rh2-restaurant-item-nav-row-fixable-fixed-desktop { position: fixed; top: 96px; max-width: 836px; z-index: 10; } .rh2-restaurant-item-nav-row-fixable-fixed-mobile { position: fixed; top: 48px; z-index: 10; } .rh2-restaurant-item-nav-row-item { font-size: 14px; text-align: left; margin-right: 60px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-nav-row-item:last-child { margin-right: 0; } .rh2-restaurant-item-nav-row-item-hidden { display: none !important; } .rh2-restaurant-item-nav-row-item:hover { color: hsla(15, 90%, 55%, 1); } .rh2-restaurant-item-name-row { display: flex; flex-direction: row; padding-top: 8px; } .rh2-restaurant-item-name-row-name-col { font-size: 32px; font-weight: bold; margin-right: 16px; } .rh2-restaurant-item-name-row-price-col { line-height: 48px; display: flex; flex-direction: row; } .rh2-restaurant-item-name-row-price-on { color: hsla(14, 88%, 55%, 1); } .rh2-restaurant-item-name-row-price-off { color: #d0d0d0; } .rh2-restaurant-item-cuisine-row { color: #8D8D8D; font-size: 14px; white-space: pre; margin-bottom: 16px; max-width: 100%; overflow: hidden; } .rh2-restaurant-item-dietary-row { color: #8D8D8D; font-size: 14px; white-space: pre; margin-bottom: 16px; max-width: 100%; overflow: hidden; } .rh2-restaurant-item-feature-row { color: #8D8D8D; font-size: 14px; white-space: pre; margin-bottom: 16px; max-width: 100%; overflow: hidden; } .rh2-restaurant-item-tags-row { color: #8D8D8D; font-size: 14px; margin-bottom: 32px; } .rh2-restaurant-item-description { border-bottom: 2px solid #EBEBEB; padding-bottom: 16px; margin-bottom: 32px; } .rh2-restaurant-item-description-row { font-size: 16px; line-height: 22px; } .rh2-restaurant-item-address-row { margin-bottom: 16px; } .rh2-restaurant-item-phone-row { margin-bottom: 16px; } .rh2-restaurant-item-openinghours-table { width: 100%; border: 1px solid #EDEDED; border-collapse: collapse; } .rh2-restaurant-item-openinghours-td { width: 25%; height: 96px; overflow: hidden; border: 1px solid #EDEDED; text-align: center; } /* restaurants-list-item */ .rh2-restaurants-list-item { position: relative; width: 100%; height: 240px; background-color: hsla(15, 90%, 100%, 1); border: 1px solid hsla(0, 0%, 92%, 1); margin-bottom: 24px; } .rh2-restaurants-list-item-narrow { position: relative; width: 100%; background-color: hsla(15, 90%, 100%, 1); border: 1px solid hsla(0, 0%, 92%, 1); margin-bottom: 24px; } .rh2-restaurants-list-item-image { position: absolute; display: block; left: 0px; top: 0px; width: 260px; height: 240px; background-size: cover; background-repeat: no-repeat; background-position: center; cursor: pointer; z-index: 1; } .rh2-restaurants-list-item-image-narrow { display: block; background-size: cover; background-repeat: no-repeat; background-position: center; cursor: pointer; z-index: 1; float: none; position: static; width: 100%; height: 240px; } .rh2-restaurants-list-item-image-featured { position: absolute; left: 8px; top: 8px; padding-left: 4px; padding-right: 4px; border-radius: 4px; font-size: 12px; background-color: hsla(15, 0%, 100%, 0.75); border: 1px solid hsla(15, 0%, 80%, 0.75); color: hsla(15, 95%, 50%, 1); } .rh2-restaurants-list-item-details { position: relative; width: 100%; height: 100%; padding-left: 260px; } .rh2-restaurants-list-item-details-narrow { position: relative; width: 100%; } .rh2-restaurants-list-item-details-body { position: relative; width: 100%; height: 100%; overflow-y: hidden; padding-left: 2%; padding-right: 2%; padding-bottom: 4px; } .rh2-restaurants-list-item-details-body-narrow { padding-bottom: 4px; padding-left: 2%; padding-right: 2%; } .rh2-restaurants-list-item-details-row0 { min-height: 48px; margin-bottom: 4px; } .rh2-restaurants-list-item-name { display: inline-block; font-family: 'Inter-Bold'; font-size: 18px; line-height: 30px; padding-top: 10px; color: hsla(214, 11%, 25%, 1); text-decoration: none; } .rh2-restaurants-list-item-price { display: inline-block; margin-left: 12px; font-size: 14px; color: hsla(14, 88%, 55%, 1); } .rh2-restaurants-list-item-details-row0-right { float: right; width: 30%; } .rh2-restaurants-list-item-details-row1 {} .rh2-restaurants-list-item-details-row1-left { float: left; width: 100%; } .rh2-restaurants-list-item-address { font-size: 14px; line-height: 16px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); margin-bottom: 6px; } .rh2-restaurants-list-item-details-row1-right { float: right; width: 20%; } .rh2-restaurants-list-item-details-row2 { max-height: 54px; max-width: 100%; overflow: hidden; } .rh2-restaurants-list-item-cuisines { margin-top: 8px; font-size: 14px; line-height: 18px; max-height: 18px; text-overflow: ellipsis; color: hsla(0, 0%, 57%, 1); } .rh2-restaurants-list-item-cuisines span { margin-right: 8px; color: hsla(0, 0%, 40%, 1); } .rh2-restaurants-list-item-tripadvisor-info {} .rh2-restaurants-list-item-tripadvisor-image { float: left; width: 120px; height: 40px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-restaurants-list-item-tripadvisor-num-reviews { float: left; margin-left: 12px; font-size: 14px; margin-top: 4px; line-height: 34px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); } .rh2-restaurants-list-item-promotion-row { font-size: 14px; } .rh2-restaurants-list-item-promotion-row-structure-span { color: #F5214E; } .rh2-restaurants-list-item-promotion-row-title-span { color: hsla(0, 0%, 40%, 1); margin-left: 8px; } .rh2-restaurants-list-item-stardeals {} .rh2-restaurants-list-item-stardeal { position: relative; margin-bottom: 10px; border-radius: 4px; padding-left: 6px; padding-right: 6px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; line-height: 16px; background-color: hsla(11, 100%, 98%, 1); } .rh2-restaurants-list-item-stardeal-short-name { display: inline; font-family: 'Inter-SemiBold'; font-size: 12px; line-height: 12px; margin-right: 8px; background-color: hsla(15, 95%, 50%, 0.75); color: hsla(15, 0%, 100%, 1); } .rh2-restaurants-list-item-stardeal-long-name { display: inline; font-family: 'Lato-Bold'; color: hsla(14, 88%, 55%, 1); font-size: 14px; line-height: 18px; } .rh2-restaurants-list-item-details-footer { position: absolute; bottom: 0px; height: 60px; overflow: hidden; width: 100%; padding-left: 2%; padding-right: 2%; } .rh2-restaurants-list-item-details-footer-narrow { position: relative; height: 48px; overflow: hidden; width: 100%; padding-left: 2%; padding-right: 2%; } .rh2-restaurants-list-item-details-row9 { height: 100%; padding-top: 8px; padding-bottom: 16px; } .rh2-restaurants-list-item-details-row9-narrow { height: 100%; padding-top: 4px; padding-bottom: 4px; } .rh2-restaurants-list-item-details-row9-left { height: 100%; float: left; width: 250px; } .rh2-restaurants-list-item-offers-item { position: relative; float: left; width: 116px; /* was 31% */ margin-left: 1%; margin-right: 1%; height: 100%; background-color: hsla(0, 0%, 95%, 1); border-radius: 4px; font-family: 'Inter-SemiBold'; font-size: 12px; line-height: 36px; border-radius: 4px; padding-right: 40px; text-align: center; } .rh2-restaurants-list-item-offers-item.rh2-restaurants-list-item-offers-item-special { padding-right: 0px; } .rh2-restaurants-list-item-offers-item-right { position: absolute; right: 0px; top: 0px; width: 40px; height: 100%; font-family: 'Inter-Bold'; border-radius: 0px 4px 4px 0px; color: hsla(0, 0%, 95%, 1); line-height: 36px; padding-left: 4px; padding-right: 4px; text-align: center; } .rh2-restaurants-list-item-offers-item-reward { color: hsla(214, 11%, 25%, 1); } .rh2-restaurants-list-item-offers-item-reward-eligible { color: hsla(0, 0%, 100%, 1); background-color: hsla(205, 100%, 44%, 1); } .rh2-restaurants-list-item-offers-item-reward .rh2-restaurants-list-item-offers-item-right { background-color: hsla(205, 100%, 44%, 1); } .rh2-restaurants-list-item-offers-item-special .rh2-restaurants-list-item-offers-item-right { display: none; } .rh2-restaurants-list-item-details-row9-right { position: absolute; right: 0px; height: 100%; width: 220px; } .rh2-restaurants-list-item-reserve { position: absolute; bottom: 8px; right: 8px; min-width: 112px; float: right; height: 36px; padding-left: 8px; padding-right: 8px; } .rh2-restaurants-list-item-reserve-narrow { width: 100%; height: 100%; padding-left: 8px; padding-right: 8px; text-align: center; margin-top: 8px; margin-bottom: 8px; } .rh2-restaurants-list-item-reserve-button { display: inline-block; text-decoration: none; width: 96px; height: 36px; border-radius: 4px; text-align: center; font-family: 'Inter-Bold'; font-size: 12px; line-height: 36px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); cursor: pointer; box-shadow: 0px 3px 9px hsla(15, 0%, 0%, 0.16); margin: auto; } .rh2-restaurants-list-item-reserve-narrow .rh2-restaurants-list-item-reserve-button { display: inline-block; margin: 0 8px; } .rh2-restaurants-list-item-reserve-narrow .rh2-restaurants-list-item-takeaway-button {} .rh2-restaurants-list-item-reserve-button-pax-session-unmet { background-color: hsla(15, 0%, 100%, 1) !important; color: hsla(15, 90%, 50%, 1) !important; border: 1px solid hsla(15, 90%, 50%, 1); padding-top: 2px; line-height: 16px !important; } .rh2-restaurants-list-item-takeaway { min-width: 112px; float: right; height: 100%; padding-left: 8px; padding-right: 8px; } .rh2-restaurants-list-item-takeaway-button { display: inline-block; margin-right: 12px; vertical-align: top; text-decoration: none; width: 96px; height: 36px; border-radius: 4px; text-align: center; font-family: 'Inter-Bold'; font-size: 12px; line-height: 36px; background-color: hsla(141, 89%, 35%, 1); color: hsla(15, 0%, 100%, 1); cursor: pointer; box-shadow: 0px 3px 9px hsla(15, 0%, 0%, 0.16); } .rh2-restaurants-list-item-takeaway-button:visited { color: hsla(15, 0%, 100%, 1); } .rh2-restaurants-reservation-form-overlay { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(15, 0%, 30%, 0.5); z-index: 25; padding-top: 5%; padding-bottom: 5%; } .rh2-restaurants-reservation-form-overlay-hidden { display: none; } .rh2-restaurants-reservation-form-container { position: relative; width: 800px; height: 100%; max-height: 640px; max-width: 100%; margin: auto; text-align: center; } .rh2-restaurants-reservation-form-iframe { width: 100%; height: 100%; border-width: 0px; } .rh2-restaurants-reservation-form-close-button { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; background-image: url('/rh2/static/image/icon/close-button.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; } @media (max-width: 769px) { .rh2-restaurants-reservation-form-container { width: 100%; max-height: 720px; } .rh2-restaurants-header-row-fw { position: relative; } .rh2-restaurants-body-row-fw { position: relative; margin-top: 0px; } .rh2-restaurants-top-banner { height: 120px; } .rh2-restaurants-top-banner-item-logo { right: 15px; top: 15px; width: 90px; height: 90px; } .rh2-restaurants-top-banner-item-handles-container { display: none; } .rh2-restaurants-list-items-row { padding-top: 0px; } .rh2-restaurants-list-item { height: unset; margin-bottom: 24px; } .rh2-restaurants-list-item-image { float: none; position: static; width: 100%; height: 240px; } .rh2-restaurants-list-item-details { position: relative; width: 100%; height: unset; padding-left: 0px; padding-bottom: 48px; } .rh2-restaurants-list-item-details-body { height: unset; padding-bottom: 4px; } .rh2-restaurants-list-item-cuisines { margin-top: 0px; } .rh2-restaurants-list-item-tripadvisor-image { height: 24px; } .rh2-restaurants-list-item-tripadvisor-num-reviews { margin-top: 2px; line-height: 20px; } .rh2-restaurants-list-item-offers-item { width: 31%; } .rh2-restaurants-right-column { display: none; } .rh2-restaurants-list-item-details-footer { height: unset; max-height: 112px; } .rh2-restaurants-list-item-details-row9 { display: block; padding-top: 0px; text-align: center; height: unset; min-height: 56px; padding-bottom: 0px; } .rh2-restaurants-list-item-details-row9-left { display: block; height: unset; float: unset; width: 100%; padding-top: 0px; padding-bottom: 0px; padding-left: 8px; padding-right: 8px; margin-bottom: 4px; } .rh2-restaurants-list-item-details-row9-right { position: relative; right: unset; display: block; height: 56px; padding-bottom: 10px; width: unset; float: unset; } .rh2-restaurants-list-item-reserve { left: 50%; margin-left: -56px; right: unset; } .rh2-restaurants-list-item-takeaway { padding-top: 8px; } .rh2-restaurants-list-item-reserve-button-xxx { height: 36px; line-height: 36px; margin-left: auto; margin-right: auto; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); } .rh2-restaurants-map-mobile-locate-button { position: absolute; bottom: 24px; right: 12px; width: 48px; height: 48px; border-radius: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; cursor: pointer; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.16); background-image: url('/rh2/static/image/icon/awesome/locate.png'); z-index: 16; } .rh2-restaurants-map-mobile-wrapper { width: 100%; height: 100%; } } /* #RestaurantItem */ .rh2-fragment-restaurant-item { background-color: hsla(15, 0%, 100%, 1); } .rh2-restaurant-item-name { display: block; float: left; font-size: 22px; line-height: 32px; margin-top: 16px; margin-bottom: 16px; margin-left: 8px; } .rh2-restaurant-item-reserve-button-container {} .rh2-restaurant-item-reserve-button { width: 96px; height: 28px; border-radius: 4px; padding-top: 3px; text-align: center; font-size: 14px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); cursor: pointer; margin: auto; } .rh2-restaurant-item-section { position: relative; margin-bottom: 16px; } .rh2-restaurant-item-section .rh2-restaurant-item-section-anchor { position: absolute; top: -64px; } .rh2-restaurant-item-section-hidden { display: none !important; } .rh2-restaurant-item-section-header { font-family: 'Inter-SemiBold'; font-weight: normal; font-size: 22px; color: #0D0F10; line-height: 26px; margin-bottom: 20px; } .rh2-restaurant-item-section-subheader { font-size: 16px; color: #0D0F10; line-height: 26px; margin-bottom: 8px; font-style: italic; } .rh2-restaurant-item-section-body { position: relative; margin-bottom: 32px; } .rh2-restaurant-item-section-footer { margin-top: 8px; margin-bottom: 24px; } .rh2-restaurant-item-section-footer-links { display: none; font-size: 12px; } .rh2-restaurant-item-section[data-rh2-restaurant-item-section-name='info'] .rh2-restaurant-item-section-footer-links { display: none; } .rh2-restaurant-item-section-footer-link { margin-left: 4px; margin-right: 4px; } .rh2-restaurant-item-section-footer-link-separator { color: hsla(15, 0%, 75%, 1); } .rh2-restaurant-item-left-col {} .rh2-restaurant-item-left-col .rh2-restaurant-item-section { padding: 12px; background: hsla(15, 0%, 100%, 1); } .rh2-restaurant-item-logo-image-row {} .rh2-restaurant-item-logo-image { height: 320px; background-size: contain; background-repeat: no-repeat; background-position: center; margin-bottom: 12px; } .rh2-restaurant-item-section-info-map-container { height: 320px; margin-bottom: 14px; font-family: 'Inter-SemiBold'; background-color: hsla(15, 0%, 85%, 1); padding-top: 30%; text-align: center; font-size: 24px; color: hsla(15, 0%, 75%, 1); } .rh2-restaurant-item-address { font-size: 16px; color: #0D0F10; margin-bottom: 14px; } .rh2-restaurant-item-section-info-price { font-size: 14px; margin-bottom: 14px; } .rh2-restaurant-item-section-info-cuisines { font-size: 12px; margin-bottom: 12px; } .rh2-restaurant-item-section-info-tags { font-size: 12px; margin-bottom: 12px; } .rh2-restaurant-item-section-info-openinghours { font-size: 12px; margin-bottom: 12px; } .rh2-restaurant-item-section-info-openinghours>.rh2-row { margin-bottom: 6px; } .rh2-restaurant-item-section-info-openinghours-weekday { float: left; font-size: 12px; width: 96px; } .rh2-restaurant-item-section-info-openinghours-open { display: inline-block; font-size: 12px; min-width: 48px; } .rh2-restaurant-item-section-info-openinghours-close { display: inline-block; font-size: 12px; min-width: 48px; } .rh2-restaurant-item-right-col { padding-left: 32px; } .rh2-restaurant-item-images-display { height: 492px; margin-bottom: 12px; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-restaurant-item-images-thumbnails { text-align: center; } .rh2-restaurant-item-images-thumbnails-item { display: inline-block; width: 96px; height: 64px; margin-left: 2px; margin-right: 2px; margin-bottom: 4px; background-size: cover; background-repeat: no-repeat; background-position: center; cursor: pointer; } .rh2-restaurant-item-description-line { font-size: 14px; margin-bottom: 8px; } .rh2-restaurant-item-section-takeaway .rh2-restaurant-item-section-body { text-align: center; } .rh2-restaurant-item-section-reviews iframe { height: 1190px; } .rh2-restaurant-item-section-body-coupons {} .rh2-restaurant-item-live-coupon { position: relative; display: flex; flex-direction: row; float: left; width: 380px; max-width: 100%; height: 190px; margin-right: 16px; margin-bottom: 24px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; } .rh2-restaurant-item-live-coupon-left-col { position: relative; flex: initial; width: 160px; height: 100%; } .rh2-restaurant-item-live-coupon-right-col { position: relative; flex: 1; height: 100%; padding-left: 16px; padding-right: 16px; font-size: 16px; } .rh2-restaurant-item-live-coupon-image { display: block; position: relative; width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-restaurant-item-live-coupon-row-title { display: block; width: 100%; max-height: 62px; overflow: hidden; text-overflow: ellipsis; color: hsla(0, 0%, 15%, 1); text-align: left; font-size: 16px; line-height: 20px; margin-bottom: 4px; font-weight: bold; margin-top: 8px; word-break: normal; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; text-decoration: none; } .rh2-restaurant-item-live-coupon-row-title:visited { color: hsla(0, 0%, 15%, 1); } .rh2-restaurant-item-live-coupon-row-prices { width: 100%; text-align: right; } .rh2-restaurant-item-live-coupon-row-prices-big { display: block; float: right; font-size: 22px; font-weight: bold; line-height: 24px; margin-left: 4px; margin-right: 4px; } .rh2-restaurant-item-live-coupon-row-prices-small { display: block; float: right; font-size: 16px; line-height: 24px; margin-left: 4px; margin-right: 4px; } .rh2-restaurant-item-live-coupon-row-prices-strikethrough { display: block; float: right; font-size: 18px; line-height: 22px; margin-left: 2px; margin-right: 2px; color: hsla(0, 0%, 60%, 1); text-decoration: line-through; } .rh2-restaurant-item-live-coupon-row-prices-leading { display: block; float: right; font-size: 14px; line-height: 22px; margin-left: 4px; margin-right: 4px; } .rh2-restaurant-item-live-coupon-row-conditions { position: absolute; bottom: 82px; left: 16px; color: #BBBBBB; font-size: 14px; text-decoration: underline; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-live-coupon-row-remaining { position: absolute; bottom: 60px; left: 16px; color: #F5214E; font-size: 14px; } .rh2-restaurant-item-live-coupon-row-claim { position: absolute; bottom: 16px; left: 16px; right: 16px; height: 40px; border-radius: 8px; overflow: hidden; } .rh2-restaurant-item-live-coupon-countdown-button { position: absolute; top: 0px; left: 0px; width: 57.14%; height: 100%; background-color: #F5214E; color: #FFFFFF; text-align: center; padding-top: 8px; } .rh2-restaurant-item-live-coupon-claim-button { position: absolute; top: 0px; right: 0px; width: 42.85%; height: 100%; background-color: #33c1a2; color: #FFFFFF; text-align: center; padding-top: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-live-coupon-upcoming-button { width: 100%; height: 100%; text-align: center; padding-top: 8px; color: #33c1a2; background-color: hsla(0, 0%, 0%, 0.05); } .rh2-restaurant-item-live-coupon-depleted-button { width: 100%; height: 100%; text-align: center; padding-top: 8px; color: #33c1a2; background-color: hsla(0, 0%, 0%, 0.05); } .rh2-restaurant-item-live-coupon-expired-button { width: 100%; height: 100%; text-align: center; padding-top: 8px; color: #33c1a2; background-color: hsla(0, 0%, 0%, 0.05); } .rh2-restaurant-item-section-body-promotions {} .rh2-restaurant-item-section-stardeal-item { overflow: hidden; margin-top: 8px; margin-bottom: 16px; } .rh2-restaurant-item-section-stardeal-item-short-name { padding: 8px; background-color: hsla(14, 88%, 55%, 1); color: hsla(15, 0%, 100%, 1); font-family: 'Inter-SemiBold'; font-size: 16px; line-height: 32px; } .rh2-restaurant-item-section-stardeal-item-long-name { font-family: 'Lato-Bold'; font-size: 16px; line-height: 24px; color: hsla(14, 88%, 55%, 1); margin-bottom: 8px; } .rh2-restaurant-item-section-stardeal-item-description {} .rh2-restaurant-item-section-stardeal-item-description div { font-size: 14px; } .rh2-restaurant-item-section-reward-line { font-size: 14px; margin-bottom: 8px; } .rh2-restaurant-item-menu-m-container { border-bottom: 1px solid hsla(15, 0%, 60%, 0.5); color: hsla(15, 0%, 60%, 1); text-align: center; display: flex; flex-direction: row; max-width: 100%; overflow-x: auto; padding-bottom: 16px; } .rh2-restaurant-item-menu-m { display: table; width: 96px; min-width: 96px; height: 128px; border: 1px solid hsla(15, 0%, 60%, 0.5); border-radius: 16px; margin-left: 8px; margin-right: 16px; font-size: 14px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-menu-m-selected { color: hsla(15, 0%, 0%, 1); background: hsla(0, 0%, 95%, 1); } .rh2-restaurant-item-menu-m:hover { background: hsla(0, 0%, 95%, 1); } .rh2-restaurant-item-menu-m-text { display: table-cell; vertical-align: middle; } .rh2-restaurant-item-menu-m-image-row { padding-top: 8px; padding-bottom: 8px; overflow: auto; } .rh2-restaurant-item-menu-m-image-tile { display: inline-block; width: 96px; height: 96px; background-size: cover; background-position: center; background-repeat: no-repeat; margin: 8px; } .rh2-restaurant-item-menu-mg-container { border-bottom: 1px solid hsla(15, 0%, 60%, 0.5); color: hsla(15, 0%, 50%, 1); display: flex; flex-direction: row; max-width: 100%; overflow-x: auto; padding-top: 16px; padding-bottom: 16px; } .rh2-restaurant-item-menu-mg { min-width: 64px; margin-left: 8px; margin-right: 16px; font-size: 12px; margin-right: 24px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-menu-mg-selected { color: hsla(15, 0%, 0%, 1); background: hsla(0, 0%, 95%, 1); } .rh2-restaurant-item-menu-mg:hover { background: hsla(0, 0%, 95%, 1); } .rh2-restaurant-item-menu-mg-image-row { display: flex; flex-direction: row; padding-top: 8px; padding-bottom: 8px; } .rh2-restaurant-item-menu-mg-image-tile { width: 96px; height: 96px; background-size: cover; background-position: center; background-repeat: no-repeat; margin: 8px; } .rh2-restaurant-item-menu-mi-container {} .rh2-restaurant-item-menu-mi { padding-left: 8px; padding-right: 8px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid hsla(0, 0%, 95%, 1); font-size: 12px; line-height: 16px; background: hsla(15, 0%, 100%, 1); } .rh2-restaurant-item-menu-mi:hover { background: hsla(0, 0%, 95%, 1); } .rh2-restaurant-item-menu-mi-row-0 { display: flex; flex-direction: row; } .rh2-restaurant-item-menu-mi-name { flex: 1; font-family: 'Inter-SemiBold'; line-height: 20px; } .rh2-restaurant-item-menu-mi-price { width: 48px; text-align: right; } .rh2-restaurant-item-menu-mi-row-1 { display: flex; flex-direction: row; } .rh2-restaurant-item-menu-mi-description { flex: 1; line-height: 14px; } .rh2-restaurant-item-menu-mi-image-tile { width: 96px; height: 96px; background-size: cover; background-position: center; background-repeat: no-repeat; } .rh2-restaurant-item-menu-image-overlay { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(15, 0%, 30%, 1); z-index: 25; display: flex; flex-direction: column; } .rh2-restaurant-item-menu-image-overlay-hidden { display: none; } .rh2-restaurant-item-menu-image-image-container { flex: 1; position: relative; width: 100%; height: 100%; margin: auto; text-align: center; background-color: hsla(0, 0%, 20%, 0.75); overflow: auto; } .rh2-restaurant-item-menu-image-image { position: absolute; background-size: contain; background-position: center; background-repeat: no-repeat; } .rh2-restaurant-item-menu-image-image-1x { width: 640px; height: 960px; left: 50%; margin: 32px; margin-left: -320px; } .rh2-restaurant-item-menu-image-image-2x { width: 960px; height: 1440px; margin: 64px; } .rh2-restaurant-item-menu-image-image-3x { width: 1200px; height: 1800px; margin: 64px; } .rh2-restaurant-item-menu-image-image-4x { width: 1600px; height: 2400px; margin: 64px; } .rh2-restaurant-item-menu-image-control-row-wrapper { height: 64px; background-color: hsla(0, 0%, 20%, 1); display: flex; flex-direction: row; } .rh2-restaurant-item-menu-image-control-row-left-padding { flex: 1; } .rh2-restaurant-item-menu-image-control-row-right-padding { flex: 1; } .rh2-restaurant-item-menu-image-control-row { width: 480px; max-width: 100%; display: flex; flex-direction: row; } .rh2-restaurant-item-menu-image-control-row-left-col { flex: 3; display: flex; flex-direction: row; padding-top: 14px; padding-left: 16px; } .rh2-restaurant-item-menu-image-control-row-middle-col { flex: 5; text-align: center; display: flex; flex-direction: row; padding-top: 14px; } .rh2-restaurant-item-menu-image-control-row-right-col { flex: 5; display: flex; flex-direction: row; padding-top: 14px; padding-left: 8px; } .rh2-restaurant-item-menu-image-control-row-icon { width: 36px; height: 36px; line-height: 36px; background-repeat: no-repeat; background-size: 36px; background-position: center; background-color: hsla(0, 0%, 100%, 1); text-align: center; } .rh2-restaurant-item-section-body-reservation { position: relative; width: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 8px; font-size: 14px; background-color: hsla(15, 95%, 95%, 0.2); border: 1px solid hsla(15, 95%, 50%, 0.2); } .rh2-restaurant-item-section-reservation-cover-header { font-size: 18px; text-align: center; } .rh2-restaurant-item-section-reservation-cover-pax-row { margin-top: 24px; text-align: center; font-size: 16px; } .rh2-restaurant-item-section-reservation-cover-pax-select { width: 128px; height: 32px; font-size: 16px; background-color: hsla(15, 0%, 100%, 1); margin-top: 8px; } .rh2-restaurant-item-section-reservation-cover-date-row { margin-top: 24px; text-align: center; font-size: 16px; } .rh2-restaurant-item-section-reservation-cover-date-input { width: 128px; height: 32px; font-size: 16px; margin-top: 8px; } .rh2-restaurant-item-section-reservation-cover-date-input::-webkit-inner-spin-button { display: none; } .rh2-restaurant-item-section-reservation-cover-date-input::-webkit-clear-button { display: none; } .rh2-restaurant-item-section-reservation-cover-time-filter-row { margin-top: 24px; text-align: center; font-size: 16px; } .rh2-restaurant-item-section-reservation-cover-time-filter-list { display: inline-block; margin: auto; } .rh2-restaurant-item-section-reservation-cover-time-filter-input-row { text-align: left; } .rh2-restaurant-item-section-reservation-cover-time-filter-input-row input[type='radio'] { position: relative; top: 4px; width: 16px; height: 16px; margin-right: 8px; cursor: pointer; } .rh2-restaurant-item-section-reservation-cover-time-filter-input-row span { font-size: 14px; cursor: pointer; } .rh2-restaurant-item-section-reservation-cover-reserve-row { margin-top: 40px; height: 24px; padding-right: 8px; } .rh2-restaurant-item-section-reservation-cover-reserve-button { display: block; float: right; height: 40px; width: 120px; text-align: center; padding-top: 10px; background-color: hsla(15, 75%, 95%, 1); border-color: hsla(15, 95%, 50%, 1); border-radius: 4px; border-width: 1px; border-style: solid; color: hsla(15, 95%, 50%, 1); font-family: 'Helvetica', 'Inter', 'Arial', sans-serif; font-size: 14px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-section-reservation-dates-row { margin-bottom: 8px; } .rh2-restaurant-item-section-reservation-dates-row-date { /* font-family: 'Inter-SemiBold'; */ color: hsla(15, 95%, 50%, 1); } .rh2-restaurant-item-section-reservation-dates-row-pax { display: inline-block; color: hsla(15, 95%, 50%, 1); } .rh2-restaurant-item-section-reservation-dates-row-times-container { display: inline-block; margin-left: 32px; } .rh2-restaurant-item-section-reservation-dates-row-time { display: inline-block; margin-right: 4px; margin-bottom: 4px; font-size: 12px; padding-left: 2px; padding-right: 2px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 95%, 50%, 1); border: 1px solid hsla(15, 95%, 50%, 1); border-radius: 4px; } .rh2-restaurant-item-section-reservation-reserve-row { text-align: center; } .rh2-restaurant-item-section-reservation-iframe { width: 100%; height: 520px; border-width: 0px; } .rh2-restaurant-item-section-body-reservation-contact-restaurant { font-size: 14px; line-height: 22px; width: 80%; margin-left: auto; margin-right: auto; text-align: center; } .rh2-restaurant-item-section-body-reservation-phone { text-decoration: none; padding-left: 4px; padding-right: 4px; background: hsla(15, 0%, 60%, 1); color: hsla(15, 0%, 95%, 1); } .rh2-restaurant-item-reservation-form-container-desktop { width: 100%; height: 560px; } .rh2-restaurant-item-mobile-reservation-form-wrapper { width: 100%; padding-left: 0px; padding-right: 0px; margin-bottom: 32px; } .rh2-restaurant-item-sticky-book-button-container { display: none; } .rh2-restaurant-item-sticky-book-button-container-sticky { display: initial; position: fixed; padding-top: 16px; padding-bottom: 16px; background-color: white; width: 340px; left: 50%; margin-left: 280px; top: 96px; z-index: 10; box-shadow: 0px 3px 12px #00000014; } .rh2-restaurant-item-sticky-book-button { display: flex; justify-content: center; align-items: center; position: relative; left: 50%; width: 160px; height: 38px; margin-left: -80px; background-color: hsla(15, 85%, 55%, 1); border-radius: 8px; color: hsla(0, 0%, 100%, 1); font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-restaurant-item-sticky-book-button-sticky {} @media (max-width: 769px) { /* .rh2-restaurant-item-reserve-button-container { position: fixed; bottom: 0px; left: 0px; width: 100%; height: 36px; padding-top: 4px; background-color: hsla(15, 0%, 100%, 0.8); border-top: 1px solid hsla(15, 0%, 90%, 1); z-index: 10; } .rh2-restaurant-item-reserve-button { margin: auto; } */ .rh2-restaurant-item-full-screen-overlay-close { width: 32px; height: 32px; } .rh2-restaurant-item-photo-gallery-nav-left { display: none; } .rh2-restaurant-item-photo-gallery-nav-right { display: none; } .rh2-restaurant-item-photo-row-fw { margin-top: 0px; } .rh2-restaurant-item-photo-row { display: flex; flex-direction: column; height: 320px; } .rh2-restaurant-item-photo-row-left-col { flex: initial; width: 100%; height: 320px; padding: 4px; } .rh2-restaurant-item-photo-row-right-col { flex: initial; height: 416px; width: 100%; } .rh2-restaurant-item-photo-left { width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; border-radius: 0px 0px 0px 0px; } .rh2-restaurant-item-photo-right-container { float: left; width: 50%; height: 50%; padding: 4px; } .rh2-restaurant-item-photo-right { width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-restaurant-item-photo-right-tr { border-radius: 0px 0px 0px 0px; } .rh2-restaurant-item-photo-right-br { border-radius: 0px 0px 0px 0px; } .rh2-restaurant-item-photo-gallery-display-section { flex: 1; min-height: 0; width: 100%; } .rh2-restaurant-item-photo-gallery-display { width: 100%; max-width: 100%; margin-left: 0; height: 80%; max-height: 80%; margin-top: 20%; } .rh2-restaurant-item-photo-gallery-container { width: 100%; height: 100%; display: flex; flex-direction: column; } .rh2-restaurant-item-body-row-fw { position: relative; margin-top: 16px; } .rh2-restaurant-item-body-row { position: relative; width: 100%; display: flex; flex-direction: column; } .rh2-restaurant-item-body-row-left-col { flex: initial; padding-left: 8px; padding-right: 8px; } .rh2-restaurant-item-body-row-right-col { flex: initial; width: initial; padding-left: 8px; padding-right: 8px; } .rh2-restaurant-item-reservation-form-container { width: 100%; border-radius: 16px; box-shadow: 0px 3px 12px #00000014; border: 1px solid #EAEAEA; } .rh2-restaurant-item-nav-row {} .rh2-restaurant-item-nav-row-item { margin-right: 16px; } .rh2-restaurant-item-section-body-reservation { padding-left: 2px; padding-right: 2px; } .rh2-restaurant-item-section-reservation-dates-row-times-container { display: block; margin-left: 0px; } .rh2-restaurant-item-section-reservation-dates-row-time { margin-right: 1px; margin-left: 1px; } .rh2-restaurant-item-reserve-button-container { padding-top: 2px; } .rh2-restaurant-item-section .rh2-restaurant-item-section-anchor { top: -56px; } .rh2-restaurant-item-right-col { padding-left: 0px; } .rh2-restaurant-item-section-header { padding-left: 4px; padding-right: 4px; } .rh2-restaurant-item-logo-image { height: 180px; } .rh2-restaurant-item-images-display { height: 240px; } .rh2-restaurant-item-description-line { padding-left: 4px; padding-right: 4px; } .rh2-restaurant-item-menu-m-container { padding-left: 4px; padding-right: 4px; } .rh2-restaurant-item-menu-mg-container { padding-left: 4px; padding-right: 4px; } .rh2-restaurant-item-menu-mi-container { padding-left: 4px; padding-right: 4px; } .rh2-restaurant-item-menu-mi {} .rh2-restaurant-item-menu-mi-name { line-height: 12px; } .rh2-restaurant-item-menu-mi-price { line-height: 12px; } .rh2-restaurant-item-menu-mi-description { padding-top: 4px; } .rh2-restaurant-item-menu-image-overlay { padding-top: 0%; padding-bottom: 0%; } .rh2-restaurant-item-menu-image-image-1x { left: unset; top: unset; margin: 32px; } .rh2-restaurant-item-menu-image-image-2x { left: unset; top: unset; margin: 32px; } .rh2-restaurant-item-menu-image-image-3x { left: unset; top: unset; margin: 32px; } .rh2-restaurant-item-menu-image-image-4x { left: unset; top: unset; margin: 32px; } .rh2-restaurant-item-menu-image-control-row-left-padding { flex: 0; } .rh2-restaurant-item-menu-image-control-row-right-padding { flex: 0; } .rh2-restaurant-item-facebook-page-row { display: none; } .rh2-restaurant-item-section[data-rh2-restaurant-item-section-name="info"] .rh2-restaurant-item-section-footer-links { display: none; } .rh2-restaurant-item-section-footer-links { display: none; padding-left: 20%; } .rh2-restaurant-item-reservation-form-overlay {} .rh2-restaurant-item-reservation-form-container { width: 100%; } } /* #EventfindaEvents */ .rh2-eventfinda-events-section-heading { padding-left: 12px; padding-right: 12px; margin-top: 32px; font-family: 'Inter-Bold'; font-size: 24px; line-height: 30px; color: hsla(214, 10%, 25%, 1); margin-bottom: 12px; } .rh2-eventfinda-events-area-select { width: 160px; float: right; height: 30px; margin-right: 8px; font-size: 14px; font-family: 'Inter-Regular'; } .rh2-events-list-summary { font-size: 16px; color: hsla(15, 0%, 50%, 1); margin-top: 8px; margin-bottom: 8px; padding-left: 8px; } .rh2-events-list-container { width: 100%; } .rh2-events-list-item { float: left; position: relative; width: 23%; margin-left: 1%; margin-right: 1%; height: 320px; background-color: hsla(15, 90%, 100%, 1); margin-bottom: 24px; } .rh2-events-list-item-photo { position: relative; width: 100%; height: 200px; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-events-list-item-details { position: relative; width: 100%; height: 120px; } .rh2-events-list-item-details-body { position: relative; width: 100%; height: 100%; max-height: 100%; overflow-y: hidden; padding-left: 2%; padding-right: 2%; padding-bottom: 40px; } .rh2-events-list-item-details-row0 {} .rh2-events-list-item-name { font-family: 'Inter-SemiBold'; font-size: 14px; padding-top: 8px; } .rh2-events-list-item-details-row1 {} .rh2-events-list-item-active-row span { font-size: 12px; } .rh2-events-list-item-place-and-area { font-size: 12px; } .rh2-events-list-item-details-footer { position: absolute; left: 0px; bottom: 0px; width: 100%; height: 40px; } .rh2-events-list-item-details-row2 { height: 100%; } .rh2-events-list-item-action { float: right; height: 100%; padding-top: 6px; padding-bottom: 6px; padding-right: 8px; } .rh2-events-list-item-action-button { width: 80px; height: 28px; border-radius: 4px; padding-top: 3px; text-align: center; font-size: 14px; background-color: hsla(282, 100%, 40%, 1); color: hsla(15, 0%, 100%, 1); cursor: pointer; text-decoration: none; display: block; cursor: pointer; } .rh2-events-list-item-action-button:visited { color: hsla(15, 0%, 100%, 1); } @media (max-width: 769px) { .rh2-eventfinda-events-section-heading { padding-left: 8px; padding-right: 8px; } .rh2-events-list-item { height: 320px; margin-bottom: 16px; width: 100%; margin-left: 0px; margin-right: 0px; } .rh2-events-list-item-photo {} .rh2-events-list-item-details {} .rh2-events-list-item-details-body {} } /* Reservations */ .rh2-reservations-page { color: hsla(214, 10%, 25%, 1); } .rh2-account-reservations-page-header { font-family: 'Inter-SemiBold'; font-size: 16px; padding-top: 16px; padding-left: 24px; color: hsla(0, 0%, 100%, 1); } .rh2-account-reservations-no-reservations-icon-row { text-align: center; margin-top: 80px; } .rh2-account-reservations-no-reservations-icon { display: inline-block; width: 76px; height: 70px; background-image: url('/rh2/static/image/icon/bottom_nav/reservations.svg'); background-size: contain; background-position: center; background-repeat: no-repeat; } .rh2-account-reservations-no-reservations-heading { font-family: 'Inter-Bold'; margin-top: 24px; font-size: 22px; text-align: center; margin-bottom: 16px; } .rh2-account-reservations-no-reservations-subheading-row { text-align: center; } .rh2-account-reservations-no-reservations-subheading { display: inline-block; width: 220px; font-family: 'Inter-SemiBold'; font-size: 16px; text-align: center; margin-bottom: 32px; } .rh2-account-reservations-no-reservations-action-row { text-align: center; } .rh2-account-reservations-no-reservations-explore-button { display: inline-block; font-family: 'Lato-Bold'; font-size: 16px; line-height: 18px; padding-top: 18px; padding-bottom: 18px; padding-left: 24px; padding-right: 24px; background-color: hsla(0, 0%, 94%, 1); border-radius: 6px; text-align: center; } .rh2-account-home-section-body-reservations { margin-bottom: 24px; } .rh2-account-home-section-body-rewards { margin-bottom: 24px; } .rh2-account-reservations-list-item { color: hsla(214, 10%, 25%, 1); } .rh2-account-reservations-list-item-logo { width: 100%; height: 144px; background-size: cover; background-position: center; background-repeat: no-repeat; } .rh2-account-reservations-list-item-restaurant { font-size: 14px; font-weight: bold; } .rh2-account-reservations-list-item-reservation {} .rh2-account-reservations-list-item-reservation div { margin-top: 8px; } .rh2-account-reservations-list-item-reservation div span { font-family: 'Lato-Regular'; font-size: 14px; } .rh2-account-reservations-list-item-reservation-status-value { display: none; padding-left: 4px; padding-right: 4px; } .rh2-account-reservations-list-item-reservation-status-value-confirmed { background-color: hsla(120, 95%, 25%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-account-reservations-list-item-reservation-status-value-cancelled { background-color: hsla(0, 95%, 50%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-account-reservations-list-item-reservation-status-value-unknown { background-color: hsla(15, 0%, 35%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-account-reservations-list-item-action-row { position: absolute; bottom: 16px; width: 90%; } .rh2-account-reservations-list-item-action-row .rh2-col { padding-right: 12px; } .rh2-account-reservations-list-item-action-button { display: block; height: 44px; width: 100%; background-color: hsla(0, 0%, 94%, 1); border-radius: 6px; padding-top: 14px; font-family: 'Lato-Bold'; font-size: 14px; text-align: center; } .rh2-account-reservations-list-item-action-button-direction { text-decoration: none; } .rh2-account-rewards-list-item { color: hsla(214, 10%, 25%, 1); } .rh2-account-rewards-list-item-logo { width: 100%; height: 144px; background-size: cover; background-position: center; background-repeat: no-repeat; } .rh2-account-rewards-list-item-restaurant { font-family: 'Inter-Bold'; font-size: 18px; line-height: 22px; width: 100%; height: 48px; } .rh2-account-rewards-list-item-reward {} .rh2-account-rewards-list-item-reward div { margin-top: 8px; } .rh2-account-rewards-list-item-reward div span { font-family: 'Lato-Regular'; font-size: 14px; } .rh2-account-rewards-list-item-reward-row0-entitled span { color: hsla(14, 88%, 55%, 1) !important; font-family: 'Lato-Bold' !important; } .rh2-account-rewards-list-item-action-row { position: absolute; bottom: 16px; width: 90%; } .rh2-account-rewards-list-item-action-row .rh2-col { padding-right: 12px; } .rh2-account-rewards-list-item-action-button { display: block; height: 44px; width: 100%; background-color: hsla(0, 0%, 94%, 1); border-radius: 6px; padding-top: 14px; font-family: 'Lato-Bold'; font-size: 14px; text-align: center; } .rh2-account-rewards-list-item-reserve-button { display: block; text-decoration: none; width: 96px; height: 44px; border-radius: 4px; text-align: center; font-family: 'Inter-Bold'; font-size: 12px; line-height: 44px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); cursor: pointer; } .rh2-account-rewards-list-item-reserve-button-unmet { background-color: hsla(15, 0%, 100%, 1) !important; color: hsla(15, 90%, 50%, 1) !important; border: 1px solid hsla(15, 90%, 50%, 1); } .rh2-account-reservations-item-container { padding: 8px; color: hsla(214, 10%, 25%, 1); } .rh2-account-reservations-item-action-row { padding-top: 12px; padding-bottom: 12px; } .rh2-account-reservations-item-action-button { display: inline-block; width: 28%; margin-left: 2%; margin-right: 2%; text-align: center; background-color: hsla(0, 0%, 94%, 1); border-radius: 6px; font-family: 'Lato-Bold'; font-size: 14px; padding-top: 14px; padding-bottom: 14px; text-decoration: none; } .rh2-account-reservations-item-action-button-call { float: right; } .rh2-account-reservations-item-image { width: 100%; height: 168px; background-size: cover; background-position: center; background-repeat: no-repeat; margin-bottom: 16px; } .rh2-account-reservations-item-restaurant { font-family: 'Inter-Bold'; font-size: 18px; line-height: 22px; width: 100%; height: 48px; } .rh2-account-reservations-item-reservation {} .rh2-account-reservations-item-reservation div { margin-bottom: 8px; } .rh2-account-reservations-item-reservation div span { font-family: 'Lato-Regular'; font-size: 14px; } .rh2-account-reservations-item-map-container { width: 100%; height: 280px; margin-bottom: 24px; } .rh2-account-reservations-item-map-direction-button { display: block; width: 100%; font-family: 'Lato-Bold'; font-size: 14px; line-height: 44px; text-align: center; background-color: hsla(0, 0%, 94%, 1); margin-bottom: 16px; text-decoration: none; } .rh2-account-reservations-item-reservation-offer-heading { font-family: 'Inter-SemiBold'; font-size: 16px; line-height: 26px; width: 100%; margin-bottom: 8px; } .rh2-account-reservations-item-reservation-offer { font-family: 'Lato-Regular'; font-size: 14px; margin-bottom: 24px; } .rh2-account-reservations-item-reservation-offer div { margin-bottom: 8px; } .rh2-account-reservations-item-reservation-guest-heading { font-family: 'Inter-SemiBold'; font-size: 16px; line-height: 26px; width: 100%; margin-bottom: 8px; } .rh2-account-reservations-item-reservation-guest { font-family: 'Lato-Regular'; font-size: 14px; margin-bottom: 24px; } .rh2-account-reservations-item-reservation-guest div { margin-bottom: 8px; } /* #AccountCommon */ .rh2-account-page { position: relative; background-color: hsla(0, 0%, 100%, 1); min-height: 100%; } .rh2-account-page-header { font-family: 'Inter-SemiBold'; margin-top: 24px; font-size: 24px; text-align: center; margin-bottom: 16px; } .rh2-account-page-form { width: 100%; padding: 0 10px; } .rh2-account-page-form .rh2-row { display: flex; justify-content: center; align-items: center; height: 40px; margin-bottom: 12px; } .rh2-account-page-form-label { font-size: 16px; flex: 1; } .rh2-account-page-form input:not([type="submit"]), .rh2-account-page-form select { width: 250px; padding: 8px; font-size: 16px; border: 1px solid hsla(15, 0%, 80%, 1); border-radius: 6px; background: white; } .rh2-account-page-form input:disabled { background: #eee; } .rh2-account-page-form-section-header { width: 100%; height: 16px; font-size: 14px; margin-bottom: 12px; text-align: center; } .rh2-account-form-validation-row { width: 100%; text-align: center; color: hsla(0, 100%, 50%, 1); font-size: 14px; } .rh2-account-form-validation-row::after { clear: both; } /* #AccountLogin */ .rh2-account-coming-soon { position: absolute; width: 100%; text-align: center; padding-top: 180px; font-size: 24px; height: 480px; z-index: 1; background-color: hsla(15, 0%, 100%, 0.8); } .rh2-account-email-login-email-address-label { padding-top: 8px; } .rh2-account-email-login-email-address-input {} .rh2-account-email-login-password-label { padding-top: 8px; } .rh2-account-email-login-password-input {} .rh2-account-email-login-login-row { margin-top: 24px; justify-content: center; } .rh2-account-email-login-login { display: flex; align-items: center; height: 40px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); font-size: 16px; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none; } .rh2-account-email-login-recover-password-row {} .rh2-account-email-login-recover-password-label { font-size: 14px; } .rh2-account-email-login-recover-password { margin-left: 14px; font-size: 14px; text-decoration: underline; cursor: pointer; } .rh2-account-email-login-signup-row { margin-bottom: 12px; justify-content: center; } .rh2-account-email-login-signup-label { font-size: 14px; font-style: italic; } .rh2-account-email-login-signup, .rh2-account-email-login-signup:visited { display: flex; align-items: center; height: 24px; margin-left: 8px; padding: 0 8px; font-size: 14px; color: hsla(15, 95%, 50%, 1); border: 1px solid hsla(15, 95%, 50%, 1); border-radius: 4px; text-decoration: none; cursor: pointer; } .rh2-account-login-section-header { width: 100%; margin-top: 24px; margin-bottom: 8px; font-size: 14px; text-align: center; } .rh2-account-login-row { text-align: center; margin-top: 16px; margin-bottom: 24px; } .rh2-account-login-google { position: relative; display: block; width: 240px; height: 40px; margin-left: auto; margin-right: auto; padding-left: 40px; color: hsla(15, 0%, 100%, 1); background-color: hsla(217, 89%, 60.8%, 1); border-radius: 4px; cursor: pointer; } .rh2-account-login-google-logo { position: absolute; float: left; top: 0px; left: 0px; width: 40px; height: 40px; background-image: url('/rh2/static/image/google/btn_google_dark_normal_ios.svg'); background-size: 100%; background-repeat: no-repeat; } .rh2-account-login-google-text { float: left; font-size: 16px; padding: 8px; width: 100%; text-align: center; } .rh2-account-login-facebook { position: relative; display: block; width: 240px; height: 40px; margin-left: auto; margin-right: auto; padding-left: 40px; color: hsla(15, 0%, 100%, 1); background-color: hsla(220, 45.9%, 47.8%, 1); border-radius: 4px; cursor: pointer; } .rh2-account-login-facebook-logo { position: absolute; float: left; top: 0px; left: 0px; width: 40px; height: 40px; background-image: url('/rh2/static/image/facebook/f_logo_RGB-Blue_58.png'); background-size: 60% 60%; background-position: center; background-repeat: no-repeat; background-color: hsla(15, 0%, 100%, 1); border: 3px solid hsla(220, 45.9%, 47.8%, 1); border-top-left-radius: 4px; border-bottom-left-radius: 4px; } .rh2-account-login-facebook-text { float: left; font-size: 16px; padding: 8px; width: 100%; text-align: center; } .rh2-account-login-email { position: relative; display: block; width: 240px; height: 40px; margin-left: auto; margin-right: auto; padding-left: 40px; color: hsla(15, 95%, 50%, 1); background-color: hsla(15, 0%, 100%, 1); border-radius: 4px; border: 1px solid hsla(15, 95%, 50%, 1); cursor: pointer; } .rh2-account-login-email:visited { color: hsla(15, 95%, 50%, 1); } .rh2-account-login-email-logo { position: absolute; float: left; top: 1px; left: 1px; width: 36px; height: 36px; background-image: url('/rh2/static/image/icon/email-login.png'); background-size: 50% 50%; background-position: center; background-repeat: no-repeat; background-color: hsla(15, 0%, 100%, 1); } .rh2-account-login-email-text { float: left; font-size: 16px; padding: 8px; width: 100%; text-align: center; } @media (max-width: 769px) {} /* #AccountEmailLogin */ .rh2-account-email-login-toolbar-back-button { float: left; margin-top: 12px; margin-left: 16px; height: 24px; width: 24px; background-image: url('/rh2/static/image/icon/left-arrow.png'); background-size: contain; background-position: center; background-repeat: no-repeat; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } /* #AccountSignup */ .rh2-account-email-signup-toolbar-back-button { float: left; margin-top: 12px; margin-left: 16px; height: 24px; width: 24px; background-image: url('/rh2/static/image/icon/left-arrow.png'); background-size: contain; background-position: center; background-repeat: no-repeat; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-account-signup-email-address-label { padding-top: 8px; } .rh2-account-signup-email-address-input {} .rh2-account-signup-password-label { padding-top: 8px; } .rh2-account-signup-password-input {} .rh2-account-signup-repeat-password-label { padding-top: 0px; } .rh2-account-signup-repeat-password-input {} .rh2-account-signup-first-name-label { padding-top: 8px; } .rh2-account-signup-first-name-input {} .rh2-account-signup-last-name-label { padding-top: 8px; } .rh2-account-signup-last-name-input {} .rh2-account-signup-phone-number-label { padding-top: 0px; } .rh2-account-signup-phone-number-input {} .rh2-account-signup-submit-row { margin-top: 24px; justify-content: center; } .rh2-account-signup-submit { display: flex; align-items: center; height: 40px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); font-size: 16px; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none; } /* #AccountHome */ .rh2-account-home-page-header { font-family: 'Inter-SemiBold'; margin-top: 24px; font-size: 24px; margin-bottom: 16px; text-align: center; } .rh2-account-home-section-header { font-size: 18px; font-family: 'Inter-SemiBold'; text-align: center; margin-top: 20px; margin-bottom: 12px; } .rh2-account-home-section-reservation { margin-bottom: 24px; } .rh2-account-home-section-reservation-tile { position: relative; display: block; max-height: 200px; padding: 16px; padding-top: 0px; float: left; margin-top: 16px; } .rh2-account-home-section-reservation-show-more-tile { padding-top: 120px; text-align: center; } .rh2-account-home-section-reservation-show-more-button { cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-account-home-section-reservation-show-more-button:hover { color: hsla(15, 95%, 50%, 1); transition: 0.5s; } .rh2-account-home-section-reward-tile { position: relative; display: block; height: 224px; padding: 16px; padding-top: 0px; float: left; margin-top: 16px; } .rh2-account-home-section-reward-show-more-tile { padding-top: 120px; text-align: center; } .rh2-account-home-section-reward-show-more-button { cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-account-home-section-reward-show-more-button:hover { color: hsla(15, 95%, 50%, 1); transition: 0.5s; } .rh2-account-home-update-details { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 0%, 10%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; text-align: center; } .rh2-account-home-import-reservations { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 0%, 10%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; text-align: center; } .rh2-account-home-rh-admin { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 0%, 10%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; text-align: center; } .rh2-account-home-change-password { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 0%, 10%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; text-align: center; } .rh2-account-home-logout { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; margin-top: 8px; margin-bottom: 24px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 95%, 50%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; text-align: center; } .rh2-account-home-mc { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; margin-top: 8px; margin-bottom: 24px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 0%, 10%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; text-align: center; } @media (max-width: 769px) { .rh2-account-home-section-reservation-tile { float: none; border-bottom: 1px solid hsla(15, 0%, 94%, 1); } .rh2-account-home-section-reservation-show-more-tile { padding-top: 16px; height: 64px; } .rh2-account-home-section-reward-tile { float: none; border-bottom: 1px solid hsla(15, 0%, 94%, 1); } .rh2-account-home-section-reward-show-more-tile { padding-top: 16px; height: 64px; } } /* #AccountUpdateDetails */ .rh2-account-update-details-toolbar-back-button { float: left; margin-top: 12px; margin-left: 16px; height: 24px; width: 24px; background-image: url('/rh2/static/image/icon/left-arrow.png'); background-size: contain; background-position: center; background-repeat: no-repeat; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-account-update-details-submit-row { margin-top: 24px; justify-content: center; } .rh2-account-update-details-submit { display: flex; align-items: center; height: 40px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); font-size: 16px; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none; } /* #AccountChangePassword */ .rh2-account-change-password-toolbar-back-button { float: left; margin-top: 12px; margin-left: 16px; height: 24px; width: 24px; background-image: url('/rh2/static/image/icon/left-arrow.png'); background-size: contain; background-position: center; background-repeat: no-repeat; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-account-change-password-current-password-label { padding-top: 0px; } .rh2-account-change-password-current-password-input {} .rh2-account-change-password-password-label { padding-top: 0px; } .rh2-account-change-password-repeat-password-label { padding-top: 0px; } .rh2-account-change-password-submit-row { margin-top: 24px; jusitfy-content: center; } .rh2-account-change-password-submit { display: flex; align-items: center; height: 40px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); font-size: 16px; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none; } .rh2-account-recover-password-submit-row { margin-top: 24px; justify-content: center; } .rh2-account-recover-password-submit { display: flex; align-items: center; height: 40px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); font-size: 16px; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: none; } /* #AccountReservationItem */ .rh2-account-reservation-item-toolbar-back-button { float: left; margin-top: 12px; margin-left: 16px; height: 24px; width: 24px; background-image: url('/rh2/static/image/icon/left-arrow.png'); background-size: contain; background-position: center; background-repeat: no-repeat; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-account-reservation-item-section-header { font-family: 'Inter-SemiBold'; margin-top: 16px; text-align: center; } .rh2-account-reservation-item-logo { display: block; width: 100%; max-width: 360px; margin-left: auto; margin-right: auto; height: 240px; background-size: cover; background-position: center; background-repeat: no-repeat; } .rh2-account-reservation-item-restaurant-name { font-family: 'Inter-SemiBold'; font-size: 20px; padding-top: 8px; text-align: center; } .rh2-account-reservation-item-restaurant-name a { cursor: pointer; text-decoration: none; } .rh2-account-reservation-item-restaurant-name a:hover { color: hsla(15, 95%, 50%, 1); transition: 0.5s; } .rh2-account-reservation-item-reservation-summary { font-size: 16px; text-align: center; } .rh2-account-reservation-item-reservation-status { font-size: 16px; text-align: center; } .rh2-account-reservation-item-reservation-status-label { margin-right: 4px; } .rh2-account-reservation-item-reservation-status-value { padding-left: 4px; padding-right: 4px; } .rh2-account-reservation-item-reservation-status-value-confirmed { background-color: hsla(120, 95%, 25%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-account-reservation-item-reservation-status-value-cancelled { background-color: hsla(0, 95%, 50%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-account-reservation-item-reservation-status-value-unknown { background-color: hsla(15, 0%, 35%, 1); color: hsla(15, 0%, 100%, 1); } .rh2-account-reservation-item-section-restaurant-details-key-col { font-size: 14px; line-height: 24px; } .rh2-account-reservation-item-section-restaurant-details-value-col { padding-left: 8px; word-break: break-all; line-height: 24px; } .rh2-account-reservation-item-section-reservation-details-key-col { font-size: 14px; line-height: 24px; } .rh2-account-reservation-item-section-reservation-details-value-col { padding-left: 8px; word-break: break-all; line-height: 24px; } .rh2-account-reservation-item-cancel { display: block; text-decoration: none; width: 100%; height: 32px; padding-left: 8px; padding-top: 4px; background-color: hsla(15, 0%, 100%, 1); color: hsla(15, 95%, 50%, 1); border-bottom: 1px solid hsla(15, 0%, 20%, 0.2); cursor: pointer; text-align: center; } .rh2-account-reservation-item-cancel-iframe { width: 100%; height: 360px; border-width: 0px; } /* Footer */ .rh2-page-footer { background-color: hsla(215, 12.5%, 18.5%, 1); color: hsla(15, 0%, 95%, 1); padding-top: 16px; padding-bottom: 32px; } .rh2-page-footer-section-title { margin-bottom: 8px; font-size: 14px; color: hsla(15, 0%, 80%, 1); } .rh2-page-footer-section-title-logo { display: block; width: 100%; height: 24px; background-image: url('/rh2/static/image/logo-footer-2x.png?r=2'); background-size: contain; background-repeat: no-repeat; background-position: left; } .rh2-page-footer p { display: block; color: hsla(15, 0%, 85%, 1); font-size: 12px; padding-left: 8px; padding-right: 8px; } .rh2-page-footer a { display: block; color: hsla(15, 0%, 100%, 1); font-size: 12px; cursor: pointer; text-decoration: none; } .rh2-page-footer hr { margin-bottom: 8px; } @media (max-width: 769px) { .rh2-page-footer { padding-bottom: 48px; } .rh2-page-footer-section-title { margin-top: 8px; margin-bottom: 0px; text-align: center; } .rh2-page-footer a { display: inline-block; padding: 4px; } } /* restaurants-carousel */ .rh2-restaurants-carousel-html-body { position: relative; height: 524px; max-height: 524px; max-height: 524px; min-width: 292px; max-width: 375px; overflow: hidden; /* background-color: hsla(15, 0%, 20%, 1); */ background-color: hsla(15, 0%, 100%, 1); } .rh2-restaurants-carousel { position: relative; width: 100%; height: 100%; background-color: hsla(15, 0%, 90%, 1); border-radius: 8px; border: 1px solid hsla(15, 0%, 80%, 1); } .rh2-restaurants-carousel-header { position: absolute; height: 22px; width: 100%; top: 0px; left: 0px; background-color: hsla(15, 0%, 50%, 1); border-radius: 8px 8px 0px 0px; padding-left: 12px; color: hsla(15, 0%, 95%, 1); line-height: 22px; } .rh2-restaurants-carousel-body { position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; padding-top: 22px; padding-bottom: 22px; padding-left: 6px; padding-right: 6px; } .rh2-restaurants-carousel-body-frame { position: relative; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; } .rh2-restaurants-carousel-body-slides-container { height: 100%; } .rh2-restaurants-carousel-slide { float: left; height: 100%; width: 320px; padding-left: 4px; padding-right: 4px; } .rh2-restaurants-carousel-item { position: relative; width: 100%; height: 150px; background-color: hsla(15, 90%, 100%, 1); border: 1px solid hsla(0, 0%, 92%, 1); margin-top: 6px; margin-bottom: 4px; } .rh2-restaurants-carousel-item-image { position: absolute; display: block; left: 0px; top: 0px; width: 140px; height: 150px; background-size: cover; background-repeat: no-repeat; background-position: center; cursor: pointer; z-index: 1; } .rh2-restaurants-carousel-item-details { position: relative; width: 100%; height: 100%; padding-left: 140px; } .rh2-restaurants-carousel-item-details-body { position: relative; width: 100%; height: 116px; overflow-y: hidden; padding-left: 2%; padding-right: 2%; padding-bottom: 4px; } .rh2-restaurants-carousel-item-details-row0 { min-height: 36px; max-height: 36px; margin-bottom: 4px; overflow: hidden; } .rh2-restaurants-carousel-item-name { display: inline-block; font-family: 'Inter-Bold'; font-size: 16px; line-height: 18px; padding-top: 0px; color: hsla(214, 11%, 25%, 1); text-decoration: none; } .rh2-restaurants-carousel-item-details-row1 {} .rh2-restaurants-carousel-item-address { max-height: 28px; overflow: hidden; font-size: 14px; line-height: 14px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); margin-bottom: 4px; } .rh2-restaurants-carousel-item-details-row2 { max-height: 54px; max-width: 100%; overflow: hidden; } .rh2-restaurants-carousel-item-cuisines { margin-top: 0px; font-size: 12px; line-height: 14px; height: 14px; overflow: hidden; color: hsla(0, 0%, 57%, 1); } .rh2-restaurants-carousel-item-cuisines span { margin-right: 2px; color: hsla(0, 0%, 40%, 1); } .rh2-restaurants-carousel-item-details-row3 { height: 20px; overflow: hidden; } .rh2-restaurants-carousel-item-price { float: left; margin-left: 0px; margin-right: 8px; font-size: 12px; line-height: 20px; color: hsla(14, 88%, 55%, 1); } .rh2-restaurants-carousel-item-tripadvisor-info { float: left; } .rh2-restaurants-carousel-item-tripadvisor-image { float: left; width: 60px; height: 20px; background-size: 100%; background-repeat: no-repeat; background-position: center; margin-right: 6px; } .rh2-restaurants-carousel-item-tripadvisor-num-reviews { float: left; font-size: 12px; margin-top: 0px; line-height: 20px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); } .rh2-restaurants-carousel-item-details-footer { position: relative; height: 34px; overflow: hidden; padding-left: 2%; padding-right: 2%; padding-top: 2px; padding-bottom: 2px; } .rh2-restaurants-carousel-item-details-row9 { height: 100%; padding-top: 2px; padding-bottom: 2px; } .rh2-restaurants-carousel-item-details-row9-right { height: 100%; width: 100%; } .rh2-restaurants-carousel-item-reserve { min-width: 112px; float: right; height: 100%; padding-left: 8px; padding-right: 8px; } .rh2-restaurants-carousel-item-reserve-button { display: block; text-decoration: none; width: 96px; height: 26px; border-radius: 4px; text-align: center; font-family: 'Inter-Bold'; font-size: 12px; line-height: 26px; background-color: hsla(15, 90%, 50%, 1); color: hsla(15, 0%, 100%, 1); cursor: pointer; } .rh2-restaurants-carousel-item-reserve-button:visited { color: hsla(15, 0%, 100%, 1); } .rh2-restaurants-carousel-item-reserve-button-pax-session-unmet { background-color: hsla(15, 0%, 100%, 1) !important; color: hsla(15, 90%, 50%, 1) !important; border: 1px solid hsla(15, 90%, 50%, 1); width: 128px !important; /* padding-top: 2px; */ /*line-height: 16px !important;*/ } .rh2-restaurants-carousel-footer { position: absolute; bottom: 0px; left: 0px; height: 24px; width: 100%; padding-left: 20px; } .rh2-restaurants-carousel-footer-logo { float: left; width: 36%; height: 100%; background-image: url('/rh2/static/image/logo-2x.gif'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-restaurants-carousel-footer-paginators { float: left; width: 64%; height: 100%; padding-left: 16px; padding-top: 2px; padding-bottom: 2px; } .rh2-restaurants-carousel-footer-paginator { float: left; width: 24px; height: 100%; margin-right: 4px; line-height: 20px; text-align: center; background-color: hsla(15, 0%, 100%, 1); border-radius: 4px; cursor: pointer; } .rh2-restaurants-carousel-footer-paginator-active { background-color: hsla(15, 100%, 50%, 1) !important; color: hsla(15, 0%, 100%, 1) !important; } /* Article */ .rh2-article-header { margin-bottom: 64px; overflow: hidden; } .rh2-article-title { font-family: 'Inter-SemiBold'; font-size: 24px; margin-bottom: 48px; } .rh2-article-author { font-family: 'Inter-Regular'; font-size: 14px; width: 100%; margin-bottom: 8px; padding-right: 8px; } .rh2-article-published-at { font-family: 'Inter-Regular'; font-size: 14px; width: 100%; margin-bottom: 8px; padding-right: 8px; } .rh2-article-content-container { margin-bottom: 96px; overflow: hidden; } .rh2-article-p-text { clear: both; font-family: 'Inter-Regular'; font-size: 18px; line-height: 32px; margin-bottom: 24px; } .rh2-article-p-heading { clear: both; font-family: 'Inter-Bold'; font-size: 18px; margin-top: 24px; margin-bottom: 24px; } .rh2-article-p-link { clear: both; display: block; text-align: center; font-family: 'Inter-Regular'; font-size: 18px; margin-top: 24px; margin-bottom: 24px; } .rh2-article-p-restaurant { margin-bottom: 20px; } .rh2-article-p-image { clear: both; width: 100%; margin-bottom: 24px; } .rh2-article-p-image-body { width: 100%; height: 492px; background-size: cover; background-repeat: no-repeat; background-position: center; margin-bottom: 4px; } .rh2-article-p-image-caption { width: 100%; text-align: center; font-family: 'Inter-Regular'; font-size: 14px; color: hsla(15, 0%, 25%, 1); } @media (max-width: 769px) { .rh2-article-p-image-body { height: 240px; } } .rh2-article-list { background-color: hsla(0, 0%, 95%, 1); margin-top: 64px; margin-bottom: 64px; padding: 8px; } .rh2-article-list-heading { font-family: 'Inter-SemiBold'; font-size: 22px; margin-bottom: 36px; color: hsla(0, 0%, 20%, 1); } .rh2-article-list-item { position: relative; height: 240px; max-width: 400px; margin-left: auto; margin-right: auto; margin-bottom: 24px; cursor: pointer; background-color: hsla(0, 0%, 100%, 1); color: hsla(0, 0%, 20%, 1); cursor: pointer; } .rh2-article-list-item-image { width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-article-list-item-footer { position: absolute; bottom: 0px; right: 0px; padding-top: 8px; width: 100%; background-color: hsla(0, 0%, 100%, 0.80); } .rh2-article-list-item-title-row { height: 24px; max-height: 24px; overflow: hidden; line-height: 24px; margin-bottom: 4px; font-family: 'Inter-SemiBold'; font-size: 20px; padding-left: 8px; padding-right: 4px; text-overflow: ellipsis; white-space: nowrap; } .rh2-article-list-item-author-row { padding-left: 8px; } .rh2-article-list-item-author { display: inline-block; font-family: 'Inter-Regular'; font-size: 14px; margin-bottom: 8px; padding-right: 8px; } .rh2-article-list-item-published-at { display: inline-block; font-family: 'Inter-Regular'; font-size: 14px; margin-bottom: 8px; padding-right: 8px; } /* AppBar January 2021 */ .rh2-fragment-padding-for-appbar-desktop { padding-top: 96px; } @media (max-width: 481px) { .rh2-fragment-padding-for-appbar-mobile { padding-top: 104px; } } .rh2-appbar-search-location-dropdown-hidden { display: none; } .rh2-appbar-search-location-dropdown-item { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-height: 28px; line-height: 28px; padding: 4px; border-bottom: 1px solid #dddddd; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; position: relative; } .rh2-appbar-search-location-dropdown-item .restaurant-count { position: absolute; right: 3px; top: 3px; font-size: 11px; } .rh2-appbar-search-location-dropdown-item:hover { background-color: hsla(14, 88%, 55%, 1); color: hsla(0, 0%, 100%, 1); } .rh2-appbar-search-location-dropdown-item-locate { display: flex; flex-direction: row; align-items: center; } .rh2-appbar-search-location-dropdown-item-locate-icon { flex: initial; width: 28px; height: 28px; margin-right: 8px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/image/icon/awesome/locate.png'); } .rh2-appbar-search-location-dropdown-item-list-icon { flex: initial; width: 28px; height: 28px; margin-right: 8px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/image/icon/awesome/list.png'); } .rh2-appbar-search-location-dropdown-item-locate-text { flex: 1; line-height: 28px; } /* AppBar January 2021 - desktop */ .rh2-appbar-search-freetext-clear { position: absolute; right: 4px; top: 6px; width: 16px; height: 16px; background-image: url('/rh2/static/icon/material/content/2x_web/ic_clear_black_18dp.png'); background-size: cover; background-repeat: no-repeat; background-position: center; opacity: 0.6; cursor: pointer; } .rh2-appbar-search-freetext-clear-hidden { display: none; } .rh2-appbar-search-location-clear { position: absolute; right: 4px; top: 6px; width: 16px; height: 16px; background-image: url('/rh2/static/icon/material/content/2x_web/ic_clear_black_18dp.png'); background-size: cover; background-repeat: no-repeat; background-position: center; opacity: 0.6; } .rh2-appbar-search-location-clear-hidden { display: none; } .rh2-appbar-desktop-wrapper { position: fixed; top: 0px; left: 0px; width: 100%; height: 96px; background-color: hsla(0, 0%, 100%, 1); /* border-bottom: 1px solid hsla(0, 0%, 92%, 1); */ z-index: 20; } .rh2-appbar-desktop-wrapper-variant-header { margin-bottom: 20px; } .rh2-appbar-desktop { display: flex; align-items: center; flex-direction: row; width: 100%; height: 100%; max-width: 1280px; margin: 0 auto; } .rh2-appbar-desktop-logo { flex: initial; width: 240px; height: 50px; margin-right: 20px; background-image: url('/rh2/static/image/logo-2x.gif'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-appbar-desktop-search-col { flex: 1; display: flex; height: 50px; } .rh2-appbar-desktop-search-container { display: flex; flex: 1; position: relative; padding: 8px; border: 1px solid #dddddd; border-radius: 8px; flex-direction: row; margin-right: 10px; } .rh2-appbar-desktop-search-button { display: flex; flex: initial; align-items: center; justify-content: center; width: 72px; text-align: center; color: hsla(0, 0%, 100%, 1); border-radius: 8px; background-color: #ffa24c; cursor: pointer; } .rh2-appbar-desktop-search-freetext-part { display: flex; justify-content: center; align-items: center; flex: 4; position: relative; } .rh2-appbar-desktop-search-freetext-icon { width: 16px; height: 16px; background-image: url('/rh2/static/image/feather/search.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; opacity: 0.6; } .rh2-appbar-desktop-search-freetext-input { width: 100%; height: 100%; padding-left: 20px; font-family: 'Lato-Regular'; font-size: 16px; line-height: 18px; border: 0; color: hsla(0, 88%, 55%, 1); } .rh2-appbar-desktop-search-freetext-input::placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-desktop-search-freetext-input:-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-desktop-search-freetext-input::-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-desktop-search-separator-part { flex: initial; width: 1px; margin-left: 8px; margin-right: 8px; border-right: 1px solid #dddddd; } .rh2-appbar-desktop-search-location-part { display: flex; justify-content: center; align-items: center; flex: 3; position: relative; } .rh2-appbar-desktop-search-location-icon { width: 16px; height: 16px; background-image: url('/rh2/static/image/feather/navigation.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; opacity: 0.6; cursor: pointer; } .rh2-appbar-desktop-search-location-input { width: 100%; height: 100%; padding-left: 20px; font-family: 'Lato-Regular'; font-size: 16px; line-height: 18px; border: 0; color: hsla(0, 88%, 55%, 1); } .rh2-appbar-desktop-search-location-input::placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-desktop-search-location-input:-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-desktop-search-location-input::-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-desktop-search-location-dropdown { position: absolute; top: 48px; left: 0px; width: 384px; min-height: 256px; max-height: 400px; overflow-y: auto; background-color: #FFFFFF; border-radius: 8px; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.25); z-index: 20; } .rh2-appbar-desktop-nav-container { height: 100%; font-size: 14px; display: flex; flex-wrap: nowrap; align-items: center; flex-direction: row; justify-content: center; } .rh2-appbar-desktop-nav-item { text-decoration: none; padding: 5px 10px; margin-left: 10px; } .rh2-appbar-desktop-nav-item-active { color: hsla(14, 88%, 55%, 1); } /* AppBar January 2021 - mobile */ .rh2-appbar-mobile-wrapper { position: fixed; top: 0px; left: 0px; width: 100%; background-color: hsla(0, 0%, 100%, 1); z-index: 20; } .rh2-appbar-mobile-map-wrapper { background-color: white; } .rh2-appbar-mobile-wrapper-home { position: static !important; height: unset !important; background-color: unset !important; } .rh2-home-row-mobile-header-bg-row {} .rh2-home-tabs { display: flex; flex-direction: row; flex-wrap: wrap; gap: 15px; } /*SS changed*/ .rh2-home-tab-item { font-family: 'Inter-Bold'; position: relative; display: flex; align-items: center; justify-content: center; height: 44px; padding: 0 12px 0; border-radius: 10px; border: 1px solid hsla(0, 0%, 80%, 1); background-color: hsla(0, 0%, 100%, 1); line-height: 40px; font-size: 14px; text-decoration: none; font-weight: 400; white-space: nowrap; } @media (max-width: 500px) { .rh2-home-tab-item { flex: 1; flex-grow: 1; min-width: 40%; } } .rh2-home-tab-item.rh2-home-tab-bookable {} .rh2-home-tab-item.rh2-home-tab-special {} .rh2-home-tab-item.rh2-home-tab-special-hd { background: linear-gradient(79.89deg, #F62552 23.59%, #F15627 113.86%); font-style: italic; color: #FFFFFF; border: none; } .rh2-home-tab-item-text { display: inline-block; } .rh2-appbar-mobile-logo-row { position: relative; width: 100%; max-width: 100%; display: flex; flex-direction: row; padding: 10px; } .rh2-appbar-mobile-logo { flex: initial; width: 240px; height: 48px; margin-top: 0px; background-image: url('/rh2/static/image/logo-2x.gif'); background-size: 75%; background-repeat: no-repeat; background-position: left; } .rh2-appbar-mobile-logo-home { flex: initial; width: 240px; height: 48px; margin-top: 0px; background-image: url('/rh2/static/image/logo-footer-2x.png?r=2'); background-repeat: no-repeat; background-position: left; background-size: contain; } .rh2-appbar-mobile-logo-icon-only { flex: initial; width: 48px; height: 48px; margin-top: 0px; background-image: url('/rh2/static/image/logo-icon-only.png'); background-size: 75%; background-repeat: no-repeat; background-position: center; } .rh2-appbar-mobile-logo-row-search-col { flex: 1; height: 100%; } .rh2-appbar-mobile-nav-container { flex: initial; width: 48px; height: 100%; font-size: 14px; line-height: 48px; text-align: right; } .rh2-appbar-mobile-nav-item { display: inline-block; margin-left: 5%; text-decoration: none; } .rh2-appbar-mobile-nav-item-active { color: hsla(14, 88%, 55%, 1); } .rh2-appbar-mobile-nav-item-hamburger { position: relative; top: 8px; right: 0px; width: 32px; height: 32px; background-image: url('/rh2/static/icon/site/hamburger.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; background-color: hsla(0, 0%, 100%, 1); } .rh2-appbar-mobile-search-row-pad { margin-bottom: 15px; } .rh2-appbar-mobile-search-row { position: relative; display: flex; flex-direction: row; background-color: hsla(0, 0%, 100%, 1); } .rh2-appbar-mobile-map-wrapper .rh2-appbar-mobile-search-row { background-color: unset !important; } .rh2-appbar-mobile-search-col { flex: 1; } .rh2-appbar-mobile-search-container { position: relative; height: 48px; padding-top: 8px; padding-bottom: 8px; padding-left: 4px; padding-right: 4px; background-color: hsla(0, 0%, 100%, 1); border: 1px solid #dddddd; border-radius: 8px; display: flex; flex-direction: row; } .rh2-appbar-mobile-map-wrapper .rh2-appbar-mobile-search-container { background-color: hsla(0, 0%, 100%, 1); } .rh2-appbar-mobile-search-freetext-part { display: flex; align-items: center; flex: 6; position: relative; } .rh2-appbar-mobile-search-freetext-icon { width: 16px; height: 16px; background-image: url('/rh2/static/image/feather/search.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; margin-left: 4px; } .rh2-appbar-mobile-search-freetext-input { width: 100%; height: 100%; padding-left: 14px; font-family: 'Lato-Regular'; font-size: 16px; line-height: 18px; border: 0; color: hsla(0, 88%, 55%, 1); } .rh2-appbar-mobile-search-freetext-input::placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-mobile-search-freetext-input:-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-mobile-search-freetext-input::-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-mobile-search-separator-part { flex: initial; width: 1px; margin-left: 4px; margin-right: 4px; border-right: 1px solid #dddddd; } .rh2-appbar-mobile-search-location-part { display: flex; align-items: center; flex: 5; position: relative; } .rh2-appbar-mobile-search-location-icon { width: 16px; height: 16px; background-image: url('/rh2/static/image/feather/navigation.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; margin-left: 4px; } .rh2-appbar-mobile-search-location-input { width: 100%; height: 100%; padding-left: 14px; font-family: 'Lato-Regular'; font-size: 16px; line-height: 18px; border: 0; color: hsla(0, 88%, 55%, 1); padding-right: 24px; } .rh2-appbar-mobile-search-location-input::placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-mobile-search-location-input:-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-mobile-search-location-input::-ms-input-placeholder { color: hsla(0, 0%, 55%, 1); } .rh2-appbar-mobile-search-location-dropdown { position: absolute; top: 48px; left: 1.5%; width: 97%; min-height: 256px; max-height: 400px; overflow-y: auto; background-color: #FFFFFF; border-radius: 8px; box-shadow: 0px 6px 18px hsla(15, 0%, 0%, 0.25); z-index: 20; } .rh2-appbar-mobile-hamburger-menu { position: fixed; top: 0; left: 0; z-index: 100; width: 100%; height: 100%; background-color: hsla(0, 0%, 95%, 1); padding-top: 48px; } .rh2-appbar-mobile-hamburger-menu-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; background-image: url('/rh2/static/icon/site/close.svg'); background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-appbar-mobile-hamburger-menu-item { font-size: 24px; padding: 8px; } .rh2-appbar-mobile-hamburger-menu-item-active { color: hsla(14, 88%, 55%, 1); } .rh2-location-dialog { width: 100%; max-width: 400px; outline: none; border: none; border-radius: 8px; padding: 2em; } .rh2-location-dialog-title { font-size: 1.25em; font-weight: bold; margin-bottom: 30px; text-align: center; } .rh2-location-dialog-form { display: flex; flex-direction: column; margin-bottom: 10px; } .rh2-location-dialog-form .input { margin-bottom: 20px; border: solid 1px #333; border-radius: 5px; font-size: 18px; padding: 8px 10px; background: white; cursor: pointer; } .rh2-location-dialog .button { border: none; outline: none; border-radius: 8px; font-size: 18px; font-weight: bold; padding: 10px 15px; background: hsla(15, 95%, 50%, 1); color: white; cursor: pointer; } .rh2-location-dialog-confirm-row, .rh2-location-dialog-nz-row { text-align: center; } .rh2-location-dialog-nz-row { margin-top: 30px; } .rh2-location-dialog .rh2-location-count-row { margin-bottom: 20px; font-size: 14px; } /* BusinessCard */ /* BusinessCard desktop */ .rh2-business-card-desktop { width: 100%; height: 180px; display: flex; flex-direction: row; } .rh2-business-card-desktop-image { flex: 2; border-radius: 16px; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-card-desktop-attrs { flex: 3; padding-left: 16px; display: flex; flex-direction: column; } .rh2-business-card-desktop-name { font-family: 'Inter-SemiBold'; flex: initial; height: 32px; line-height: 32px; font-size: 18px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow: hidden; } .rh2-business-card-desktop-address { flex: initial; height: 24px; line-height: 24px; font-size: 14px; color: #8f8f8f; overflow: hidden; } .rh2-business-card-desktop-cuisine { flex: initial; height: 24px; line-height: 24px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; } .rh2-business-card-desktop-review { flex: initial; height: 24px; display: flex; flex-direction: row; } .rh2-business-card-desktop-review-ta-image { width: 120px; height: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-card-desktop-review-ta-number { margin-left: 12px; font-size: 14px; line-height: 24px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); } .rh2-business-card-desktop-price { flex: initial; display: flex; flex-direction: row; } .rh2-business-card-desktop-price-on { color: hsla(14, 88%, 55%, 1); } .rh2-business-card-desktop-price-off { color: #d0d0d0; } .rh2-business-card-desktop-action-row { margin-top: 8px; width: 100%; display: flex; gap: 8px; flex-direction: row; padding-top: 8px; justify-content: right; align-items: center; } .rh2-business-card-desktop-action-coupon-col { /* flex: 3; */ /* margin-right: 16px; */ } .rh2-business-card-desktop-action-coupon { position: relative; width: 100%; height: 46px; border-radius: 8px; border-width: 1px; border-style: solid; border-color: #33c1a2; font-size: 14px; font-weight: bold; padding-top: 14px; text-align: center; cursor: pointer; } .rh2-business-card-desktop-action-coupon-icon { position: absolute; top: 14px; left: 8px; width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-live.svg'); } .rh2-business-card-desktop-action-coupon-count { position: absolute; top: -8px; right: -4px; width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center; background-color: #33c1a2; color: #FFFFFF; } .rh2-business-card-desktop-action-coupon-grey { border-color: hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 80%, 1) !important; } .rh2-business-card-desktop-action-coupon-grey .rh2-business-card-desktop-action-coupon-icon { background-image: url('/rh2/static/icon/site/star-grey.svg'); } .rh2-business-card-desktop-action-coupon-count-hidden { display: none !important; } /*Scott Added Hotdeals*/ .rh2-business-card-desktop-action-hotdeal-col { /* flex: auto; */ } .rh2-business-card-desktop-action-hotdeal { display: flex; justify-content: center; align-items: center; height: 40px; border-radius: 10px; border: none; font-size: 14px; font-weight: bold; text-align: center; cursor: pointer; color: #fff; font-style: italic; white-space: nowrap; background: linear-gradient(79.89deg, #F62552 23.59%, #F15627 113.86%); padding: 0 8px 0; } .rh2-business-card-desktop-action-hotdeal-icon { width: 20px; height: 20px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); margin-right: 8px; } .rh2-business-card-desktop-action-hotdeal-count { width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center; background-color: #f62552; color: #ffffff; font-style: normal; margin-left: 8px; } .rh2-business-card-desktop-action-hotdeal-grey { border: 1px solid hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 80%, 1) !important; background: rgba(255, 255, 255, 0.7); } .rh2-business-card-desktop-action-hotdeal-grey .rh2-business-card-desktop-action-hotdeal-icon { background-image: url('/rh2/static/icon/site/star-special-hd-inactive.svg?r'); } .rh2-business-card-desktop-action-hotdeal-count-hidden { display: none !important; } /*End Scott added hotdeals*/ .rh2-business-card-desktop-action-special-col { /* flex: 3; */ /* margin-right: 16px; */ } .rh2-business-card-desktop-action-special { display: flex; justify-content: center; align-items: center; height: 40px; border: solid 1px #bcbcbc; border-radius: 10px; font-size: 14px; font-weight: bold; text-align: center; cursor: pointer; padding: 0 8px; } .rh2-business-card-desktop-action-special-icon { width: 20px; height: 20px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special.svg?r'); margin-right: 8px; } .rh2-business-card-desktop-action-special-count { width: 20px; height: 20px; border-radius: 20px; line-height: 20px; text-align: center; background-color: #F5214E; color: #FFFFFF; margin-left: 8px; } .rh2-business-card-desktop-action-special-grey { border-color: hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 80%, 1) !important; } .rh2-business-card-desktop-action-special-grey .rh2-business-card-desktop-action-special-icon { background-image: url('/rh2/static/icon/site/star-grey.svg'); } .rh2-business-card-desktop-action-special-count-hidden { display: none !important; } .rh2-business-card-desktop-action-book-col { /* flex: 2;*/ /* flex: auto;*/ } .rh2-business-card-desktop-action-book { display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 16px; font-weight: bold; cursor: pointer; background: #FFA24C; text-align: center; color: #ffffff; height: 40px; padding: 0 20px 0; } .rh2-business-card-desktop-action-book-hidden { display: none !important; } .rh2-business-card-desktop-separator { width: 100%; height: 1px; border-top: 1px solid #d0d0d0; margin-top: 24px; margin-bottom: 24px; } /* BusinessCard mobile */ .rh2-business-card-mobile { width: 100%; } .rh2-business-card-mobile-image { display: flex; /* position: relative; */ height: 200px; border-radius: 10px; background-size: cover; background-repeat: no-repeat; background-position: center; text-decoration: none; align-items: flex-end; flex-direction: column; justify-content: flex-end; } .rh2-business-card-mobile-attrs { height: 66px; } .rh2-business-card-mobile-attrs-name-row { width: 100%; max-height: 44px; display: flex; flex-direction: row; } .rh2-business-card-mobile-name { flex: 1; font-family: 'Inter-SemiBold'; min-height: 32px; line-height: 18px; font-size: 18px; padding-top: 8px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; } .rh2-business-card-mobile-review { flex: initial; width: 90px; height: 24px; display: flex; flex-direction: row; padding-top: 8px; } .rh2-business-card-mobile-review-ta-image { width: 90px; height: 18px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-card-mobile-attrs-cuisine-row { width: 100%; height: 24px; display: flex; flex-direction: row; } .rh2-business-card-mobile-cuisine { flex: 1; height: 24px; line-height: 24px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; } .rh2-business-card-mobile-price { flex: initial; width: 42px; display: flex; flex-direction: row; } .rh2-business-card-mobile-price-on { color: hsla(14, 88%, 55%, 1); } .rh2-business-card-mobile-price-off { color: #d0d0d0; } .rh2-business-card-image-block { position: relative; } .rh2-business-card-mobile-action-row { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; flex-wrap: wrap; padding: 0px; gap: 10px; align-items: flex-end; } /*SS changed*/ .rh2-business-card-mobile-action-icon { margin-right: 8px; } .rh2-business-card-mobile-action-book-icon { width: 22px; height: 22px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-orange.svg?r'); } .rh2-business-card-mobile-action-map-icon { width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/material/maps/2x_web/ic_map_black_36dp.png'); } .rh2-business-card-mobile-action-coupon-col { flex: 3; margin-right: 16px; } .rh2-business-card-mobile-action-coupon { position: relative; width: 100%; height: 38px; border-radius: 8px; border-width: 1px; border-style: solid; border-color: #33c1a2; background-color: hsla(0, 0%, 100%, 1); text-align: center; cursor: pointer; } .rh2-business-card-mobile-action-coupon-icon { display: inline-block; width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-live.svg?r'); } .rh2-business-card-mobile-action-coupon-text { display: inline-block; font-size: 14px; font-weight: bold; padding-top: 9px; text-align: right; padding-right: 6px; } .rh2-business-card-mobile-action-coupon-count { position: absolute; top: -8px; right: -4px; width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center; background-color: #33c1a2; color: #FFFFFF; } .rh2-business-card-mobile-action-coupon-grey { border-color: hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 80%, 1) !important; } .rh2-business-card-mobile-action-coupon-grey .rh2-business-card-mobile-action-coupon-icon { background-image: url('/rh2/static/icon/site/star-grey.svg?r'); } .rh2-business-card-mobile-action-coupon-count-hidden { display: none !important; } /*Start Hot deals busnes card*/ .rh2-business-card-mobile-action-hotdeal-col { /* display: flex; */ } .rh2-business-card-mobile-action-hotdeal { display: flex; width: 100%; height: 38px; border-radius: 10px; border: none; background: linear-gradient(79.89deg, #F62552 23.59%, #F15627 113.86%); text-align: center; cursor: pointer; flex-direction: row; flex-wrap: nowrap; align-items: center; padding: 0 8px; } .rh2-business-card-mobile-action-hotdeal-icon { /* display: inline-block;*/ width: 24px; height: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-card-mobile-action-hotdeal-text { display: flex; font-size: 14px; font-weight: bold; margin: 0 8px; color: #fff; } .rh2-business-card-mobile-action-hotdeal-count { position: absolute; top: -8px; right: -4px; width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center; background-color: #33c1a2; color: #FFFFFF; } .rh2-business-card-mobile-action-hotdeal-grey { border-color: hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 80%, 1) !important; } .rh2-business-card-mobile-action-hotdeal-grey .rh2-business-card-mobile-action-hotdeal-icon { background-image: url('/rh2/static/icon/site/star-special-hd-inactive.svg?r'); } .rh2-business-card-mobile-action-hotdeal-count-hidden { display: none !important; } /*End Hot deals Styles*/ .rh2-business-card-mobile-action-special-col { /* flex: 3; */ /* margin-right: 16px; */ } .rh2-business-card-mobile-action-special { display: flex; align-items: center; gap: 8px; height: 38px; border-radius: 10px; border: 1px solid #fff; background-color: hsla(0, 0%, 100%, 1); cursor: pointer; padding: 0 16px 0 10px; } .rh2-business-card-mobile-action-special-icon { /* display: inline-block; */ display: flex; width: 24px; height: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special.svg?r'); } .rh2-home-tab-special .rh2-business-card-mobile-action-special-icon { margin: 0 8px 0 0; } .rh2-business-card-mobile-action-special-hd-icon { display: inline-block; width: 22px; height: 22px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-card-mobile-action-special-text { font-size: 14px; font-weight: bold; } .rh2-business-card-mobile-action-special-count { width: 20px; height: 20px; border-radius: 10px; line-height: 20px; text-align: center; background-color: #F5214E; color: #FFFFFF; margin: 8px 8px 0 1px; } .rh2-business-card-mobile-action-special-grey { border-color: hsl(0deg 0% 80%) !important; color: hsl(0deg 0% 80%) !important; background-color: hsl(0deg 0% 100% / 24%); } .rh2-business-card-mobile-action-special-grey .rh2-business-card-mobile-action-special-icon { background-image: url('/rh2/static/icon/site/star-grey.svg?r'); opacity: 0.6; } .rh2-business-card-mobile-action-special-count-hidden { display: none !important; } .rh2-business-card-mobile-action-book-col { flex: 2; } .rh2-business-card-mobile-action-book { display: flex; align-items: center; height: 38px; font-size: 14px; font-weight: bold; cursor: pointer; background: #FFA24C; border-radius: 10px; color: #ffffff; padding: 0 20px; } .rh2-business-card-mobile-action-book-hidden { display: none !important; } .rh2-business-card-mobile-separator { width: 100%; height: 1px; border-top: 1px solid #d0d0d0; margin-bottom: 24px; } /* BusinessInfoWindow */ .rh2-business-infowindow-desktop { width: 100%; min-width: 280px; } .rh2-business-infowindow-desktop-attrs-row { width: 100%; padding: 4px; margin-bottom: 8px; display: flex; flex-direction: row; } .rh2-business-infowindow-desktop-coupon-row {} .rh2-business-infowindow-desktop-special-row {} .rh2-business-infowindow-desktop-book-row { display: flex; justify-content: center; padding: 16px 0 8px; } .rh2-business-infowindow-desktop-image { flex: 1; border-radius: 16px; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-infowindow-desktop-attrs { flex: 3; padding-left: 8px; display: flex; flex-direction: column; } .rh2-business-infowindow-desktop-name { flex: initial; height: 32px; line-height: 20px; font-weight: bold; font-size: 18px; cursor: pointer; } .rh2-business-infowindow-desktop-cuisine { flex: initial; height: 24px; line-height: 24px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; } .rh2-business-infowindow-desktop-review { flex: initial; height: 24px; display: flex; flex-direction: row; } .rh2-business-infowindow-desktop-review-ta-image { width: 120px; height: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-infowindow-desktop-review-ta-number { margin-left: 8px; font-size: 14px; line-height: 24px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); overflow: hidden; } .rh2-business-infowindow-desktop-review-price { flex: 1; display: flex; flex-direction: row; padding-top: 4px; margin-left: 8px; } .rh2-business-infowindow-desktop-price-on { color: hsla(14, 88%, 55%, 1); } .rh2-business-infowindow-desktop-price-off { color: #d0d0d0; } .rh2-business-infowindow-desktop-coupon-heading-row { width: 100%; height: 24px; padding-left: 16px; font-size: 14px; font-weight: bold; padding-top: 4px; color: hsla(166, 52%, 49%, 1); background-color: hsla(166, 52%, 49%, 0.25); } .rh2-business-infowindow-desktop-coupon-body-row { padding-left: 8px; padding-right: 8px; } .rh2-business-infowindow-desktop-coupon-item-row { width: 100%; height: 36px; padding-top: 4px; padding-bottom: 4px; padding-left: 8px; padding-right: 8px; display: table; border-bottom: 1px solid hsla(0, 0%, 90%, 1); } .rh2-business-infowindow-desktop-coupon-item-icon { display: table-cell; width: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-live.svg?r'); } .rh2-business-infowindow-desktop-coupon-item-title { display: table-cell; vertical-align: middle; padding-left: 8px; padding-right: 8px; } .rh2-business-infowindow-desktop-coupon-item-claim { display: table-cell; width: 48px; background-color: hsla(166, 52%, 49%, 1); color: hsla(0, 0%, 100%, 1); padding-top: 6px; cursor: pointer; border-radius: 4px; padding-left: 2px; } .rh2-business-infowindow-desktop-special-heading-row { width: 100%; height: 24px; padding-left: 16px; font-size: 14px; font-weight: bold; padding-top: 4px; color: hsla(347, 89%, 55%, 1); background-color: hsla(347, 89%, 55%, 0.25); } .rh2-business-infowindow-desktop-special-body-row { padding: 0px; } .rh2-business-infowindow-desktop-special-item-row { width: 100%; height: 36px; padding: 8px 0; display: flex; justify-content: center; align-items: center; border-bottom: 1px solid hsla(0, 0%, 90%, 1); } .rh2-business-infowindow-desktop-special-item-icon { width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special.svg?r'); } .rh2-business-infowindow-desktop-special-item-icon.hotdeal { background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-infowindow-desktop-special-item-title { padding-left: 8px; padding-right: 8px; } .rh2-business-infowindow-desktop-special-item-claim { background-color: hsla(347, 89%, 55%, 1); color: hsla(0, 0%, 100%, 1); cursor: pointer; border-radius: 4px; margin-left: auto; padding: 4px 8px; } .rh2-business-infowindow-desktop-book-button { width: 98px; height: 46px; background-image: url('/rh2/static/icon/site/book-button-coloured.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; font-size: 14px; font-weight: bold; padding-top: 16px; padding-left: 44px; color: #FFFFFF; cursor: pointer; } .rh2-business-infowindow-mobile { width: 100%; } .rh2-business-infowindow-mobile-attrs-row { width: 100%; padding: 4px; margin-bottom: 8px; display: flex; flex-direction: row; } .rh2-business-infowindow-mobile-coupon-row {} .rh2-business-infowindow-mobile-special-row {} .rh2-business-infowindow-mobile-book-row { padding: 8px 0; } .rh2-business-infowindow-mobile-image { display: none; flex: 1; border-radius: 16px; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-infowindow-mobile-attrs { flex: 3; padding-left: 8px; display: flex; flex-direction: column; } .rh2-business-infowindow-mobile-name { flex: initial; height: 32px; line-height: 20px; font-weight: bold; font-size: 18px; cursor: pointer; } .rh2-business-infowindow-mobile-cuisine { flex: initial; height: 24px; line-height: 24px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; } .rh2-business-infowindow-mobile-review { flex: initial; height: 24px; display: flex; flex-direction: row; } .rh2-business-infowindow-mobile-review-ta-image { width: 120px; height: 24px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-infowindow-mobile-review-ta-number { margin-left: 8px; font-size: 14px; line-height: 24px; font-family: 'Lato-Regular'; color: hsla(214, 11%, 25%, 1); overflow: hidden; } .rh2-business-infowindow-mobile-review-price { flex: 1; display: flex; flex-direction: row; padding-top: 4px; margin-left: 8px; } .rh2-business-infowindow-mobile-price-on { color: hsla(14, 88%, 55%, 1); } .rh2-business-infowindow-mobile-price-off { color: #d0d0d0; } .rh2-business-infowindow-mobile-coupon-heading-row { width: 100%; height: 24px; padding-left: 16px; font-size: 14px; font-weight: bold; padding-top: 4px; color: hsla(166, 52%, 49%, 1); background-color: hsla(166, 52%, 49%, 0.25); } .rh2-business-infowindow-mobile-coupon-body-row { padding-left: 8px; padding-right: 8px; } .rh2-business-infowindow-mobile-coupon-item-row { width: 100%; height: 36px; padding-top: 4px; padding-bottom: 4px; padding-left: 8px; padding-right: 8px; display: table; border-bottom: 1px solid hsla(0, 0%, 90%, 1); } .rh2-business-infowindow-mobile-coupon-item-icon { display: table-cell; width: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-live.svg?r'); } .rh2-business-infowindow-mobile-coupon-item-title { display: table-cell; vertical-align: middle; padding-left: 8px; padding-right: 8px; } .rh2-business-infowindow-mobile-coupon-item-claim { display: table-cell; width: 48px; background-color: hsla(166, 52%, 49%, 1); color: hsla(0, 0%, 100%, 1); padding-top: 6px; cursor: pointer; border-radius: 4px; padding-left: 2px; } .rh2-business-infowindow-mobile-special-heading-row { width: 100%; height: 24px; padding-left: 16px; font-size: 14px; font-weight: bold; padding-top: 4px; color: hsla(347, 89%, 55%, 1); background-color: hsla(347, 89%, 55%, 0.25); } .rh2-business-infowindow-mobile-special-body-row { padding: 0px; } .rh2-business-infowindow-mobile-special-item-row { display: flex; justify-content: center; align-items: center; height: 36px; padding: 8px 0; border-bottom: 1px solid hsla(0, 0%, 90%, 1); } .rh2-business-infowindow-mobile-special-item-icon { width: 16px; height: 16px; background-size: 100%; background-repeat: no-repeat; background-position: center; background-image: url('/rh2/static/icon/site/star-special.svg?r'); } .rh2-business-infowindow-mobile-special-item-icon.hotdeal { background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-infowindow-mobile-special-item-title { vertical-align: middle; padding-left: 8px; padding-right: 8px; } .rh2-business-infowindow-mobile-special-item-claim { background-color: hsla(347, 89%, 55%, 1); color: hsla(0, 0%, 100%, 1); text-align: center; padding: 4px 8px; cursor: pointer; border-radius: 5px; margin-left: auto; } .rh2-business-infowindow-mobile-book-button { width: 64px; height: 30px; background-image: url('/rh2/static/icon/site/book-button-coloured.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; font-size: 12px; font-weight: bold; padding-top: 8px; padding-left: 28px; color: #FFFFFF; cursor: pointer; margin: 0 auto; } /* full screen overlay */ .rh2-full-screen-overlay { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 1); z-index: 20; } .rh2-full-screen-overlay-active { display: initial; } .rh2-full-screen-overlay-close { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; border: 1px solid hsla(0, 0%, 0%, 1); } .rh2-full-screen-overlay-close:hover { opacity: 1; } .rh2-full-screen-overlay-translucent { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 0.5); z-index: 20; } .rh2-full-screen-overlay-translucent-active { display: initial; } .rh2-full-screen-overlay-translucent-close { position: absolute; right: 50%; top: 50%; margin-right: -440px; margin-top: -290px; width: 32px; height: 32px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; } /* Dirty hacks */ /* Google Maps Marker Cluster */ .cluster { pointer-events: none !important; } .rh2-maintenance-warning { position: fixed; bottom: 0; text-align: center; color: white; background: red; font-size: 18px; font-weight: bold; padding: 20px; width: 100%; } .rh2-maintenance-warning .close { position: absolute; top: 10px; right: 10px; display: inline-block; width: 20px; height: 20px; line-height: 20px; background: white; color: black; cursor: pointer; } /* font */ /* @font-face { font-family: 'Poppins-Regular'; font-style: normal; font-weight: normal; src: url('/rh2/static/font/Poppins/Poppins-Regular.ttf') format('truetype'); } @font-face { font-family: 'Poppins-SemiBold'; font-style: normal; font-weight: normal; src: url('/rh2/static/font/Poppins/Poppins-SemiBold.ttf') format('truetype'); } @font-face { font-family: 'Poppins-Bold'; font-style: normal; font-weight: normal; src: url('/rh2/static/font/Poppins/Poppins-Bold.ttf') format('truetype'); } */ /* @font-face { font-family: 'OpenSans-Regular'; font-style: normal; font-weight: normal; src: url('/rh2/static/font/OpenSans/OpenSans-Regular.ttf') format('truetype'); } @font-face { font-family: 'OpenSans-Bold'; font-style: normal; font-weight: normal; src: url('/rh2/static/font/OpenSans/OpenSans-Bold.ttf') format('truetype'); } */ @font-face { font-family: 'Lato-Regular'; font-style: normal; font-weight: normal; src: local('Lato-Regular'), local('Lato Regular'), url('/rh2/static/font/Lato/Lato-Regular.ttf') format('truetype'); font-display: swap; } @font-face { font-family: 'Lato-Bold'; font-style: normal; font-weight: normal; src: local('Lato-Bold'), local('Lato Bold'), url('/rh2/static/font/Lato/Lato-Bold.ttf') format('truetype'); font-display: swap; } @font-face { font-family: 'Inter-Regular'; font-style: normal; font-weight: normal; src: local('Inter-Regular'), local('Inter Regular'), url('/rh2/static/font/Inter/Inter-Regular.ttf') format('truetype'); font-display: swap; } @font-face { font-family: 'Inter-SemiBold'; font-style: normal; font-weight: normal; src: local('Inter-SemiBold'), local('Inter SemiBold'), url('/rh2/static/font/Inter/Inter-SemiBold.ttf') format('truetype'); font-display: swap; } @font-face { font-family: 'Inter-Bold'; font-style: normal; font-weight: normal; src: local('Inter-Bold'), local('Inter Bold'), url('/rh2/static/font/Inter/Inter-Bold.ttf') format('truetype'); font-display: swap; }</style> <style>.rh2-fragment-special-item-desktop { padding-bottom: 144px; font-family: "Inter-Regular"; } .rh2-special-item-heading { position: relative; width: 100%; height: 48px; margin-top: 20px; flex: initial; padding-left: 12px; padding-right: 12px; font-size: 20px; font-family: "Inter-Bold"; line-height: 24px; } .rh2-special-item-heading-mobile { display: none; } .rh2-special-item-section-image-mobile { flex: initial; height: 240px; margin-bottom: 16px; } .rh2-special-item-section-image-desktop { width: 100%; height: 440px; margin-bottom: 32px; } .rh2-special-item-section-image-image { position: relative; width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-special-item-section-nav { margin-top: 8px; margin-bottom: 24px; padding-left: 8px; padding-right: 8px; display: flex; flex-direction: row; font-family: "Inter-SemiBold"; } .rh2-special-item-section-nav-padding { flex: 1; border-bottom: 2px solid hsla(0, 0%, 90%, 1); } .rh2-special-item-section-nav-item-special { flex: initial; width: 150px; padding: 8px; border-bottom: 2px solid hsla(0, 0%, 90%, 1); } .rh2-special-item-section-nav-item-special-active { color: #F5214E; border-bottom: 2px solid #F5214E !important; } .rh2-special-item-section-nav-item-location { flex: initial; width: 150px; padding: 8px; border-bottom: 2px solid hsla(0, 0%, 90%, 1); } .rh2-special-item-section-nav-item-location-active { color: #F5214E; border-bottom: 2px solid #F5214E !important; } .rh2-special-item-body { width: 100%; display: flex; flex-direction: row; } .rh2-special-item-left-column-desktop { flex: 5; overflow: hidden; } .rh2-special-item-left-column-mobile { flex: 5; padding-left: 8px; padding-right: 8px; } .rh2-special-item-left-column-mobile-hidden { display: none; } .rh2-special-item-middle-column-desktop { flex: 1; border-right: 1px solid hsla(0, 0%, 80%, 1); margin-right: 32px; } .rh2-special-item-middle-column-mobile { display: none; } .rh2-special-item-right-column-desktop { flex: 3; overflow: hidden; } .rh2-special-item-right-column-mobile { flex: 3; padding-left: 8px; padding-right: 8px; } .rh2-special-item-right-column-mobile-hidden { display: none; } .rh2-special-item-title-row { font-size: 22px; font-family: "Inter-Bold"; line-height: 24px; display: flex; align-items: center; } .rh2-special-item-title-star { width: 24px; height: 24px; background-image: url('/rh2/static/icon/bookingform/star-s-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; margin-right: 10px; } .rh2-special-item-title-star.hotdeal { background-image: url('/rh2/static/icon/bookingform/star-hd-fill.svg?r'); } .rh2-special-item-description-row { margin-top: 16px; } .rh2-special-item-schedule-row { margin: 48px auto 20px; color: hsla(0, 0%, 35%, 1); } .rh2-special-item-schedule-item { display: block; margin-bottom: 1em; } .rh2-special-item-schedule-item-mobile { float: none; display: block; } .rh2-special-item-book-button-row { display: flex; justify-content: right; } .rh2-special-item-book-button-row.mobile { justify-content: center; } .rh2-special-item-book-button { display: flex; justify-content: center; align-items: center; float: right; width: 160px; height: 48px; border-radius: 8px; background-color: #F5214E; color: hsla(0, 0%, 100%, 1); text-decoration: none; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-special-item-book-button-mobile {} .rh2-special-item-book-button:visited { color: hsla(0, 0%, 100%, 1); } .rh2-special-item-condition-row { color: hsla(0, 0%, 35%, 1); clear: both; margin-top: 16px; padding-top: 16px; border-top: 2px solid hsla(0, 0%, 90%, 1); } .rh2-special-item-guide-row { margin-top: 48px; background-color: hsla(0, 0%, 90%, 1); padding: 24px; border-radius: 8px; } .rh2-special-item-guide-title { font-family: "Inter-SemiBold"; font-size: 16px; margin-bottom: 8px; } .rh2-special-item-guide-item { font-size: 14px; font-style: italic; margin-top: 4px; margin-bottom: 4px; } .rh2-special-item-business-basic-row { display: flex; flex-direction: row; } .rh2-special-item-business-logo-col { flex: initial; width: 96px; height: 96px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-special-item-business-attr-col { flex: 1; padding-left: 8px; } .rh2-special-item-business-title-row { display: block; font-family: "Inter-SemiBold"; font-size: 18px; height: 40px; text-decoration: none; } .rh2-special-item-business-title-row:visited { color: initial; } .rh2-special-item-business-cuisine-row { color: hsla(0, 0%, 60%, 1); } .rh2-special-item-business-review-row { height: 32px; padding-top: 8px; display: flex; } .rh2-special-item-business-review-row-review-image { flex: initial; width: 96px; height: 24px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-special-item-business-review-row-review-number { margin-left: 8px; font-size: 14px; color: hsla(0, 0%, 60%, 1); line-height: 24px; } .rh2-special-item-business-review-row-price-col { margin-left: 8px; font-size: 14px; line-height: 24px; } .rh2-special-item-business-review-row-price-col-on { display: inline-block; color: hsla(14, 88%, 55%, 1); } .rh2-special-item-business-review-row-price-col-off { display: inline-block; color: #d0d0d0; } .rh2-special-item-business-photos-row { margin-top: 16px; border: 1px solid hsla(0, 0%, 80%, 1); width: 340px; margin-bottom: 16px; display: flex; flex-direction: row; } .rh2-special-item-business-photos-row-item { flex: initial; width: 72px; height: 72px; margin-right: 4px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-special-item-business-photos-row-item-more { flex: initial; width: 32px; height: 72px; line-height: 72px; text-align: center; text-decoration: none; } .rh2-special-item-business-section-links-row { padding-top: 8px; padding-bottom: 8px; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; width: 340px; text-decoration: none; } .rh2-special-item-business-section-links-row-item { margin-left: 8px; margin-right: 8px; text-decoration: none; } .rh2-special-item-business-location-title-row { margin-top: 32px; font-family: "Inter-SemiBold"; font-size: 18px; } .rh2-special-item-business-address-row { margin-top: 16px; font-size: 14px; } .rh2-special-item-business-map-row { margin-top: 16px; width: 100%; height: 192px; } .rh2-special-item-business-other-specials-row { margin-top: 32px; padding: 16px; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 16px; } .rh2-special-item-business-other-specials-title { font-family: "Inter-SemiBold"; font-size: 18px; } .rh2-special-item-business-other-specials-item { margin-top: 16px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; } .rh2-special-item-business-other-specials-icon { width: 22px; height: 22px; margin-right: 8px; background: url('/rh2/static/icon/site/star-special.svg?r') no-repeat center; background-size: contain; } .rh2-special-item-business-other-specials-item.hotdeal .rh2-special-item-business-other-specials-icon { background: url('/rh2/static/icon/site/star-special-hd.svg?r') no-repeat center; background-size: contain; } .rh2-special-link-business-other-specials-link { float: right; color: hsla(0, 0%, 60%, 1); margin-left: auto; white-space: nowrap; } .rh2-special-link-business-other-specials-link:visited { color: hsla(0, 0%, 60%, 1); } .rh2-business-item-special-card-desktop { position: relative; width: 100%; max-width: 100%; margin-right: 8px; margin-bottom: 24px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: row; } .rh2-business-item-special-card-mobile { position: relative; display: block; width: 100%; max-width: 100%; margin-right: 8px; margin-bottom: 16px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; } .rh2-business-item-special-card-part-image-desktop { flex: initial; width: 240px; margin: 10px; display: flex; flex-direction: column; gap: 10px; } .rh2-business-item-special-card-part-image-mobile { flex: initial; } .rh2-business-item-special-card-part-image-image { position: relative; width: 100%; height: 240px; background-size: cover; background-repeat: no-repeat; background-position: center; border-radius: 8px; } .rh2-business-item-special-card-part-image-mobile .rh2-business-item-special-card-part-image-image { height: calc(100vw - 18px); border-radius: 0; } /* share button for mobile */ .rh2-business-item-share { padding: 8px 10px 8px 32px; border: solid 1px grey; border-radius: 8px; display: flex; justify-content: center; align-items: center; height: 40px; border-radius: 8px; font-size: 16px; cursor: pointer; user-select: none; background: url('/rh2/static/image/feather/share-2.svg') no-repeat center; background-repeat: no-repeat; background-size: 24px; background-position: 8px center; padding-left: 40px; padding-right: 10px; } .rh2-business-item-share.copy-ok { background-color: lightgreen; } .rh2-business-item-special-card-part-text-desktop { flex: 1; height: 100%; padding-top: 16px; padding-bottom: 64px; } .rh2-business-item-special-card-part-text-mobile { min-height: 240px; padding-top: 16px; padding-bottom: 70px; position: relative; } .rh2-business-item-special-card-row-title { display: block; width: 100%; padding-left: 16px; color: #F5214E; font-family: "Inter-SemiBold"; font-size: 18px; line-height: 20px; margin-bottom: 1em; text-decoration: underline; text-underline-offset: 3px; } .rh2-business-item-special-card-row-title:visited { color: #F5214E; } .rh2-business-item-special-card-section-schedule { font-size: 14px; padding-left: 16px; padding-right: 16px; overflow: hidden; color: hsla(0, 0%, 50%, 1); margin-bottom: 8px; } .rh2-business-item-special-card-row-condition-0 { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; font-size: 14px; margin-bottom: 1em; overflow: hidden; color: hsla(0, 0%, 50%, 1); } .rh2-business-item-special-card-row-condition-1 { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; font-size: 14px; line-height: 16px; margin-bottom: 4px; color: hsla(0, 0%, 50%, 1); } .rh2-business-item-special-card-row-condition-2 { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; font-size: 14px; line-height: 16px; color: hsla(0, 0%, 50%, 1); } .rh2-business-item-special-card-section-description { margin-top: 8px; padding-left: 16px; padding-right: 16px; margin-bottom: 16px; color: hsla(0, 0%, 25%, 1); } .rh2-business-item-special-card-details-popup { display: none; position: absolute; width: 92%; left: 4%; height: 240px; max-height: 240px; top: 20px; background-color: hsla(0, 0%, 100%, 1); border: 1px solid #DDDDDD; border-radius: 8px; padding: 16px; overflow: auto; } .rh2-business-item-special-card-details-popup-active { display: block !important; } .rh2-business-item-special-card-details-popup-row { font-size: 16px; line-height: 20px; margin-bottom: 8px; } .rh2-business-item-special-card-details-popup-row-title { font-weight: bold; } .rh2-business-item-special-card-details-button { position: absolute; bottom: 8px; right: 8px; padding: 4px; border: 1px solid #F5214E; color: #F5214E; background-color: hsla(0, 0%, 100%, 1); border-radius: 4px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-item-special-card-details-button-active { background-color: #F5214E; color: #FFFFFF; } .rh2-business-item-special-card-details-button:hover { background-color: #F5214E; color: #FFFFFF; } .rh2-business-item-special-card-row-txt-col-1 { display: inline-block; } .rh2-business-item-special-card-row-txt-col-2 { display: inline-block; } .rh2-business-item-special-card-bottom-row { display: flex; gap: 10px; position: absolute; bottom: 15px; right: 15px; align-items: center; } .rh2-business-item-special-card-see-details-button { display: flex; justify-content: center; align-items: center; width: 160px; height: 32px; background-color: hsla(0, 0%, 100%, 1); border-radius: 8px; color: hsla(0, 0%, 35%, 1); border: 1px solid hsla(0, 0%, 35%, 1); text-decoration: none; text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-item-special-card-see-details-button:visited { color: hsla(0, 0%, 35%, 1); } .rh2-business-item-special-card-book-button { display: flex; justify-content: center; align-items: center; height: 40px; border-radius: 8px; background-color: #F5214E; color: hsla(0, 0%, 100%, 1); text-decoration: none; text-align: center; font-size: 16px; font-weight: bold; cursor: pointer; user-select: none; background-image: url('/rh2/static/icon/bookingform/star-s-outline.svg?r'); background-repeat: no-repeat; background-size: 28px; background-position: 8px center; padding-left: 40px; padding-right: 10px; } .rh2-business-item-special-card-book-button.special-hd { background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-item-special-card-book-button:visited { background-color: #F5214E; color: hsla(0, 0%, 100%, 1); } .rh2-business-list-special-card-desktop { position: relative; width: 100%; max-width: 100%; max-height: 999px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: row; transition: max-height 0.25s ease-out; } .rh2-business-list-special-card-section-details { position: relative; max-height: 0px; opacity: 0; transition: max-height 0.25s ease-in, opacity 0.25s ease-in, margin 0.25s ease-in; } .rh2-business-list-special-card-desktop.open .rh2-business-list-special-card-section-details, .rh2-business-list-special-card-mobile.open .rh2-business-list-special-card-section-details { max-height: 999px; opacity: 1; margin-bottom: 1em; } .rh2-business-list-special-card-desktop.open .rh2-business-list-special-card-section-details-description, .rh2-business-list-special-card-mobile.open .rh2-business-list-special-card-section-details-description { margin: 1em 0; } .rh2-business-list-special-card-section-details-conditions { font-size: 14px; color: #666; } .rh2-business-item-special-card-desktop.open .rh2-business-list-special-card-section-details, .rh2-business-item-special-card-mobile.open .rh2-business-list-special-card-section-details { max-height: 999px; opacity: 1; } .rh2-business-list-special-card-mobile { position: relative; width: 100%; max-width: 100%; margin-bottom: 3em; } .rh2-business-list-special-card-mobile .row-main { display: flex; flex-direction: row; gap: 16px; } .rh2-business-list-special-card-part-image-desktop { flex: initial; width: 220px; height: 220px; padding: 10px; } .rh2-business-list-special-card-part-image-mobile { flex: initial; width: 190px; height: 190px; } .rh2-business-list-special-card-part-image-image { display: block; position: relative; width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; border-radius: 8px; } .rh2-business-list-special-card-mobile .rh2-business-list-special-card-part-image-image { width: 190px; height: 190px; box-shadow: 3px 3px 10px 6px #aaa; border-radius: 20px; } .rh2-business-list-special-card-part-image-desktop .rh2-business-list-special-card-part-image-image { border-radius: 8px; } .rh2-business-list-special-card-part-text-desktop { flex: 1; min-height: 100%; padding: 10px 10px 64px; position: relative; } .rh2-business-list-special-card-part-text-mobile { position: relative; } .rh2-business-list-special-card-row-title { display: block; width: 100%; color: #F5214E; font-family: "Inter-SemiBold"; font-size: 16px; line-height: 20px; margin-bottom: 12px; text-decoration: underline; text-underline-offset: 3px; } .rh2-business-list-special-card-row-title:visited { color: #F5214E; } .rh2-business-list-special-card-section-schedule { margin-top: 4px; font-size: 14px; overflow: hidden; color: hsla(0, 0%, 50%, 1); margin-bottom: 8px; } .rh2-business-list-special-card-section-hotdeal-price { margin-top: 4px; font-size: 14px; color: hsla(0, 0%, 50%, 1); margin-bottom: 8px; } .rh2-business-list-special-card-section-business { margin-top: 16px; } .rh2-business-list-special-card-section-business-name-row { margin-top: 8px; font-family: "Inter-SemiBold"; font-size: 16px; text-underline-offset: 3px; } .rh2-business-list-special-card-section-business-name-row:visited { color: initial; } .rh2-business-list-special-card-section-business-attr-row-0 { margin-top: 4px; height: 20px; line-height: 20px; display: flex; flex-direction: row; font-size: 14px; color: hsla(0, 0%, 60%, 1); overflow: hidden; } .rh2-business-list-special-card-section-business-attr-row-0-ta-image { width: 100px; height: 20px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-list-special-card-section-business-attr-row-0-cuisine { margin-left: 8px; } .rh2-business-list-special-card-section-business-attr-row-1 { margin-top: 4px; height: 20px; line-height: 20px; display: flex; flex-direction: row; font-size: 14px; color: hsla(0, 0%, 60%, 1); } .rh2-business-list-special-card-section-business-attr-row-1-special-count {} .rh2-business-list-special-card-section-business-attr-row-1-special-hd-count { margin-left: 10px; } .rh2-business-list-special-card-section-details-description { margin: 0; font-size: 15px; transition: margin 0.25s ease-in; } .rh2-business-list-special-card-buttons { position: absolute; bottom: 0px; right: 0px; display: flex; gap: 10px; align-items: center; justify-content: right; padding: 8px; } .rh2-business-list-special-card-mobile .rh2-business-list-special-card-buttons { width: 100%; justify-content: right; gap: 20px; position: relative; padding: 0; } .rh2-business-list-special-card-details-button { font-size: 14px; text-decoration: underline dashed; text-underline-offset: 3px; user-select: none; cursor: pointer; color: #666; white-space: nowrap; min-width: 62px; } .rh2-business-list-special-card-book-button { display: flex; align-items: center; height: 42px; border-radius: 8px; background-color: #F5214E; color: white; text-decoration: none; font-size: 16px; padding: 0 10px 0 42px; font-weight: bold; cursor: pointer; user-select: none; background-image: url('/rh2/static/icon/bookingform/star-s-outline.svg?r'); background-size: 28px; background-position: 8px center; background-repeat: no-repeat; } .rh2-business-list-special-card-book-button.special-hd { background-image: url('/rh2/static/icon/site/star-special-hd.svg?r'); } .rh2-business-list-special-card-restaurant-button { height: 42px; border-radius: 8px; background-color: #ffa24c; color: white; text-decoration: none; font-size: 16px; line-height: 42px; padding: 0 10px; cursor: pointer; user-select: none; } .rh2-business-list-special-card-desktop .rh2-business-list-special-card-restaurant-button { right: 210px; left: auto; } @media (max-width: 389px) { .rh2-business-list-special-card-restaurant-button { display: none; } } .rh2-business-list-special-card-book-button:visited { background-color: #F5214E; color: white; } .rh2-business-list-special-card-restaurant-button:visited { color: white; }</style> <style>/* Coupon action row */ .rh2-coupon-action-row-date-required {} .rh2-coupon-action-row-date-required-heading { font-family: "Inter-SemiBold"; font-size: 14px; } .rh2-coupon-action-row-date-required-body { margin-top: 4px; display: flex; flex-direction: row; } .rh2-coupon-action-row-date-required-item { margin-right: 1px; text-align: center; width: 13%; max-width: 64px; background-color: #3cc0a2; color: hsla(0, 0%, 100%, 1); padding: 4px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-action-row-date-required-item-disabled { background-color: hsla(0, 0%, 90%, 1); color: hsla(0, 0%, 60%, 1); cursor: initial; } .rh2-coupon-action-row-date-required-item-day-of-week { border-bottom: 1px solid hsla(0, 0%, 90%, 1); margin-left: 4px; margin-right: 4px; font-size: 14px; } .rh2-coupon-action-row-date-required-item-disabled .rh2-coupon-action-row-date-required-item-day-of-week { background-color: hsla(0, 0%, 90%, 1); color: hsla(0, 0%, 60%, 1); } .rh2-coupon-action-row-date-required-item-date { padding-top: 4px; padding-bottom: 4px; } .rh2-coupon-action-row-date-required-item-month { font-size: 12px; } .rh2-coupon-action-row-date-not-required {} .rh2-coupon-action-row-date-not-required-heading { font-family: "Inter-SemiBold"; font-size: 14px; } .rh2-coupon-action-row-date-not-required-body { margin-top: 8px; } .rh2-coupon-action-row-date-not-required-claim-button { display: inline-block; padding: 8px; background-color: #33c1a2; color: #FFFFFF; text-align: center; border-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-action-row-date-not-required-redeem { display: inline; margin-left: 8px; color: hsla(0, 0%, 50%, 1); font-size: 14px; } /* coupon form pop up */ .rh2-coupon-form-slide { position: absolute; top: 0; left: 0; width: 100%; min-height: 100%; background-color: hsla(0, 0%, 100%, 1); padding: 20px; display: flex; flex-direction: column; } .rh2-coupon-form-slide-in { animation-duration: 0.3s; animation-name: rh2-coupon-form-keyframe-slide-in; } @keyframes rh2-coupon-form-keyframe-slide-in { 0% { opacity: 0; } 100% { opacity: 1; } } .rh2-coupon-form-slide-out { animation-duration: 0.3s; animation-name: rh2-coupon-form-keyframe-slide-out; } @keyframes rh2-coupon-form-keyframe-slide-out { 0% { opacity: 1; } 100% { opacity: 0; } } .rh2-coupon-form-slide-2 { width: 100%; height: 360px; position: relative; top: 0; min-height: unset; } .rh2-coupon-form-desktop { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; } .rh2-coupon-form-desktop-header-row { width: 100%; height: 56px; padding-top: 8px; flex: initial; border-bottom: 1px solid hsla(0, 0%, 0%, 0.35); font-size: 20px; font-weight: bold; } .rh2-coupon-form-desktop-body-row { width: 100%; flex: 1; padding-top: 20px; padding-bottom: 20px; padding-left: 8px; padding-right: 8px; display: flex; flex-direction: row; } .rh2-coupon-form-desktop-footer-row { width: 100%; height: 64px; flex: initial; background-color: hsla(0, 0%, 100%, 0.25); display: flex; flex-direction: row; } .rh2-coupon-form-desktop-body-left { flex: 5; overflow: hidden; } .rh2-coupon-form-desktop-body-right { flex: 7; overflow: hidden; padding-left: 32px; padding-right: 16px; } .rh2-coupon-form-date-select-section { padding: 8px; margin-bottom: 16px; } .rh2-coupon-form-date-select-label { font-size: 16px; } .rh2-coupon-form-date-select { margin-left: 8px; font-size: 16px; padding: 4px; } .rh2-coupon-form-desktop-coupon-card { position: relative; overflow: hidden; } .rh2-coupon-form-desktop-coupon-card-top { position: relative; background-color: #33c1a2; height: 48px; font-size: 20px; font-weight: bold; color: #FFFFFF; padding-top: 10px; padding-bottom: 18px; text-align: center; border-top-left-radius: 8px; border-top-right-radius: 8px; overflow: hidden; } .rh2-coupon-form-desktop-coupon-card-top-corner-bottom-left { position: absolute; bottom: -12px; left: -12px; width: 24px; height: 24px; border-radius: 12px; background-color: #FFFFFF; } .rh2-coupon-form-desktop-coupon-card-top-corner-bottom-right { position: absolute; bottom: -12px; right: -12px; width: 24px; height: 24px; border-radius: 12px; background-color: #FFFFFF; } .rh2-coupon-form-desktop-coupon-card-bottom { position: relative; text-align: center; height: 144px; border: 1px solid hsla(15, 0%, 0%, 0.16); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } .rh2-coupon-form-desktop-coupon-card-bottom-corner-top-left { position: absolute; top: -12px; left: -12px; width: 24px; height: 24px; border-radius: 12px; background-color: #FFFFFF; border: 1px solid hsla(0, 0%, 0%, 0.25); } .rh2-coupon-form-desktop-coupon-card-bottom-corner-top-right { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 12px; background-color: #FFFFFF; border: 1px solid hsla(0, 0%, 0%, 0.25); } .rh2-coupon-form-desktop-coupon-card-bottom-title-row { padding-top: 16px; height: 64px; line-height: 24px; overflow: hidden; font-size: 18px; font-family: "Inter-SemiBold"; word-break: normal; } .rh2-coupon-form-desktop-coupon-card-bottom-schedule-time-row { padding-top: 12px; font-size: 14px; color: hsla(0, 0%, 25%, 1); } .rh2-coupon-form-desktop-coupon-card-bottom-schedule-date-row { padding-top: 4px; font-size: 14px; color: hsla(0, 0%, 25%, 1); } .rh2-coupon-form-desktop-description-title { font-family: "Inter-SemiBold"; color: hsla(0, 0%, 25%, 1); } .rh2-coupon-form-desktop-description-text { margin-top: 4px; font-size: 14px; max-height: 154px; overflow: hidden; color: hsla(0, 0%, 25%, 1); } .rh2-coupon-form-desktop-condition-title { margin-top: 24px; font-family: "Inter-SemiBold"; color: hsla(0, 0%, 25%, 1); } .rh2-coupon-form-desktop-condition-text { margin-top: 4px; font-size: 14px; color: hsla(0, 0%, 25%, 1); } .rh2-coupon-form-desktop-footer-left { flex: 1; color: hsla(0, 0%, 0%, 0.5); font-style: italic; line-height: 20px; font-size: 14px; padding-right: 32px; } .rh2-coupon-form-desktop-footer-right { flex: initial; width: 240px; position: relative; padding-top: 8px; } .rh2-coupon-form-desktop-footer-claim { position: relative; width: 100%; height: 48px; } .rh2-coupon-form-desktop-footer-countdown-button { position: absolute; top: 0px; left: 0px; width: 57.14%; height: 100%; background-color: #F5214E; color: #FFFFFF; text-align: center; padding-top: 12px; border-top-left-radius: 8px; border-bottom-left-radius: 8px; } .rh2-coupon-form-desktop-footer-claim-button { position: absolute; top: 0px; right: 0px; width: 42.85%; height: 100%; background-color: #33c1a2; color: #FFFFFF; text-align: center; padding-top: 12px; border-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-form-desktop-footer-stock-row { position: absolute; top: -36px; left: 0; color: #F5214E; font-size: 14px; } .rh2-coupon-form-desktop-footer-stock-number { display: inline-block; font-size: 20px; } .rh2-coupon-form-desktop-footer-stock-text { display: inline-block; margin-left: 8px; } .rh2-coupon-form-slide-1-back-button { font-size: 16px; font-weight: normal; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-form-desktop-slide-1-restaurant-name { color: hsla(0, 0%, 0%, 0.5); width: 100%; text-align: center; padding-bottom: 8px; font-weight: bold; font-size: 14px; } .rh2-coupon-form-desktop-slide-1-guide { width: 100%; font-style: italic; font-size: 14px; padding-top: 16px; } .rh2-coupon-form-desktop-form-label { font-size: 14px; font-weight: bold; padding-top: 4px; padding-bottom: 4px; } .rh2-coupon-form-desktop-form-input { width: 100%; height: 40px; font-size: 20px; padding: 10px; border: 1px solid hsla(0, 0%, 0%, 0.25); border-radius: 4px; } .rh2-coupon-form-desktop-form-select { width: 100%; height: 40px; font-size: 16px; padding: 8px; border: 1px solid hsla(0, 0%, 0%, 0.25); border-radius: 4px; } .rh2-coupon-form-desktop-form { padding-left: 20%; } .rh2-coupon-form-desktop-form-row-0 { display: flex; flex-direction: row; } .rh2-coupon-form-desktop-form-row-0-col-0 { width: 45%; margin-right: 5%; } .rh2-coupon-form-desktop-form-row-0-col-1 { width: 45%; margin-left: 5%; } .rh2-coupon-form-desktop-form-row-1 {} .rh2-coupon-form-desktop-form-row-2 {} .rh2-coupon-form-desktop-form-row-3 {} .rh2-coupon-form-desktop-slide-1-footer-left { flex: 1; color: hsla(0, 0%, 0%, 0.5); font-style: italic; line-height: 20px; font-size: 14px; padding-right: 32px; } .rh2-coupon-form-desktop-slide-1-footer-right { flex: initial; width: 160px; position: relative; } .rh2-coupon-form-desktop-footer-agree-row {} .rh2-coupon-form-desktop-footer-agree-checkbox { display: inline; line-height: 20px; width: 16px; height: 16px; } .rh2-coupon-form-desktop-footer-agree-text { display: inline; line-height: 20px; font-size: 12px; margin-left: 4px; } .rh2-coupon-form-desktop-footer-agree-link { display: inline; line-height: 20px; font-size: 12px; text-decoration: underline; } .rh2-coupon-form-desktop-footer-confirm-button { position: absolute; right: 20px; width: 120px; height: 48px; background-color: #33c1a2; color: #FFFFFF; text-align: center; padding-top: 12px; border-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-form-desktop-footer-confirm-button-disabled { cursor: initial !important; background-color: hsla(0, 0%, 0%, 0.25); color: hsla(0, 0%, 0%, 0.75); } .rh2-coupon-form-desktop-slide-2-body-left { flex: 1; padding-top: 48px; padding-bottom: 48px; padding-left: 24px; padding-right: 48px; } .rh2-coupon-form-desktop-slide-2-body-right { flex: 1; padding-top: 48px; padding-bottom: 48px; padding-left: 24px; padding-right: 48px; } .rh2-coupon-form-desktop-slide-2-success-image { position: relative; width: 32px; height: 32px; left: 50%; margin-left: -16px; background-image: url('/rh2/static/icon/material/action/2x_web/ic_check_circle_black_18dp.png'); background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-coupon-form-desktop-slide-2-success-title { font-size: 20px; font-weight: bold; padding-top: 16px; padding-bottom: 32px; } .rh2-coupon-form-desktop-slide-2-success-email-label { font-size: 14px; font-weight: bold; padding-bottom: 16px; } .rh2-coupon-form-desktop-slide-2-success-email-address { font-size: 16px; } .rh2-coupon-form-desktop-slide-2-valid-row { display: flex; flex-direction: row; line-height: 24px; padding-bottom: 8px; } .rh2-coupon-form-desktop-slide-2-valid-icon { flex: initial; width: 24px; height: 24px; background-image: url('/rh2/static/icon/material/notification/2x_web/ic_event_available_black_18dp.png'); background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-coupon-form-desktop-slide-2-valid-title { flex: 1; font-size: 14px; font-weight: bold; margin-left: 24px; } .rh2-coupon-form-desktop-slide-2-schedule-row-time { font-size: 14px; margin-left: 48px; } .rh2-coupon-form-desktop-slide-2-schedule-row-date { font-size: 14px; margin-left: 48px; } .rh2-coupon-form-desktop-slide-2-notes-row { margin-top: 16px; display: flex; flex-direction: row; line-height: 24px; padding-bottom: 8px; } .rh2-coupon-form-desktop-slide-2-notes-icon { flex: initial; width: 24px; height: 24px; background-image: url('/rh2/static/icon/material/alert/2x_web/ic_error_outline_black_18dp.png'); background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-coupon-form-desktop-slide-2-notes-title { flex: 1; font-size: 14px; font-weight: bold; margin-left: 24px; } .rh2-coupon-form-desktop-slide-2-notes-text { font-size: 14px; margin-left: 48px; padding-bottom: 16px; } .rh2-coupon-form-mobile { position: relative; width: 100%; height: 100%; overflow: scroll; } .rh2-coupon-form-mobile-header-row { width: 100%; height: 56px; padding-top: 8px; border-bottom: 1px solid hsla(0, 0%, 0%, 0.35); font-size: 20px; font-weight: bold; display: flex; flex-direction: row; } .rh2-coupon-form-mobile-header-back-button { flex: initial; width: 32px; height: 32px; font-size: 24px; } .rh2-coupon-form-mobile-header-text { flex: 1; font-size: 18px; font-weight: bold; line-height: 24px; } .rh2-coupon-form-mobile-body-row { position: relative; width: 100%; padding-top: 20px; padding-bottom: 20px; padding-left: 8px; padding-right: 8px; } .rh2-coupon-form-mobile-close-button { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; background-image: url('/rh2/static/image/icon/close-button.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-coupon-form-mobile-footer-row { width: 100%; height: 64px; background-color: hsla(0, 0%, 100%, 0.25); display: flex; flex-direction: row; } .rh2-coupon-form-mobile-footer-claim { margin-top: 48px; position: relative; width: 100%; height: 48px; } .rh2-coupon-form-mobile-footer-claim-button { position: absolute; top: 0px; right: 0px; width: 42.85%; height: 100%; background-color: #33c1a2; color: #FFFFFF; text-align: center; padding-top: 12px; border-radius: 8px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-form-mobile-footer-claim-button-disabled { cursor: initial !important; background-color: hsla(0, 0%, 0%, 0.25); color: hsla(0, 0%, 0%, 0.75); } .rh2-coupon-form-mobile-description { margin-top: 32px; } .rh2-coupon-form-mobile-description-text { font-size: 14px; margin-bottom: 24px; } .rh2-coupon-form-mobile-form { margin-top: 32px; padding-top: 16px; border-top: 1px solid hsla(0, 0%, 0%, 0.35); } .rh2-restaurant-coupon-agree-mobile-agree { margin-top: 32px; } .rh2-coupon-form-mobile-valid { margin-top: 32px; padding-top: 16px; border-top: 1px solid hsla(0, 0%, 0%, 0.35); } .rh2-coupon-form-mobile-valid { margin-top: 48px; padding-top: 16px; } .rh2-fragment-coupon-item-desktop { padding-bottom: 144px; font-family: "Inter-Regular"; } .rh2-coupon-item-heading { position: relative; width: 100%; height: 48px; margin-top: 20px; flex: initial; padding-left: 12px; padding-right: 12px; font-size: 20px; font-family: "Inter-Bold"; line-height: 24px; } .rh2-coupon-item-heading-mobile { display: none; } .rh2-coupon-item-section-image-mobile { flex: initial; height: 240px; margin-bottom: 16px; } .rh2-coupon-item-section-image-desktop { width: 100%; height: 440px; margin-bottom: 32px; } .rh2-coupon-item-section-image-image { position: relative; width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-coupon-item-section-nav { margin-top: 8px; margin-bottom: 24px; padding-left: 8px; padding-right: 8px; display: flex; flex-direction: row; font-family: "Inter-SemiBold"; } .rh2-coupon-item-section-nav-padding { flex: 1; border-bottom: 2px solid hsla(0, 0%, 90%, 1); } .rh2-coupon-item-section-nav-item-coupon { flex: initial; width: 150px; padding: 8px; border-bottom: 2px solid hsla(0, 0%, 90%, 1); } .rh2-coupon-item-section-nav-item-coupon-active { color: #3cc0a2; border-bottom: 2px solid #3cc0a2 !important; } .rh2-coupon-item-section-nav-item-location { flex: initial; width: 150px; padding: 8px; border-bottom: 2px solid hsla(0, 0%, 90%, 1); } .rh2-coupon-item-section-nav-item-location-active { color: #3cc0a2; border-bottom: 2px solid #3cc0a2 !important; } .rh2-coupon-item-body { width: 100%; display: flex; flex-direction: row; } .rh2-coupon-item-left-column-desktop { flex: 5; overflow: hidden; } .rh2-coupon-item-left-column-mobile { flex: 5; padding-left: 8px; padding-right: 8px; } .rh2-coupon-item-left-column-mobile-hidden { display: none; } .rh2-coupon-item-middle-column-desktop { flex: 1; border-right: 1px solid hsla(0, 0%, 80%, 1); margin-right: 32px; } .rh2-coupon-item-middle-column-mobile { display: none; } .rh2-coupon-item-right-column-desktop { flex: 3; overflow: hidden; } .rh2-coupon-item-right-column-mobile { flex: 3; padding-left: 8px; padding-right: 8px; } .rh2-coupon-item-right-column-mobile-hidden { display: none; } .rh2-coupon-item-title-row { font-size: 24px; font-family: "Inter-Bold"; line-height: 24px; } .rh2-coupon-item-description-row { margin-top: 16px; } .rh2-coupon-item-schedule-row { margin-top: 32px; color: hsla(0, 0%, 35%, 1); } .rh2-coupon-item-schedule-item { display: block; } .rh2-coupon-item-schedule-item-mobile { float: none; display: block; } .rh2-coupon-item-action-row { margin-top: 32px; } .rh2-coupon-item-book-button { float: right; width: 160px; height: 48px; border-radius: 8px; background-color: #3cc0a2; color: hsla(0, 0%, 100%, 1); text-decoration: none; padding-top: 14px; margin-bottom: 16px; text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-coupon-item-book-button-mobile { float: none; display: block; margin-top: 8px; position: relative; left: 50%; margin-left: -80px; } .rh2-coupon-item-book-button:visited { color: hsla(0, 0%, 100%, 1); } .rh2-coupon-item-book-button-disabled { background-color: hsla(0, 0%, 80%, 1); color: hsla(0, 0%, 60%, 1); } .rh2-coupon-item-condition-row { color: hsla(0, 0%, 35%, 1); clear: both; margin-top: 16px; padding-top: 16px; border-top: 2px solid hsla(0, 0%, 90%, 1); } .rh2-coupon-item-guide-row { margin-top: 48px; background-color: hsla(0, 0%, 90%, 1); padding: 24px; border-radius: 8px; } .rh2-coupon-item-guide-title { font-family: "Inter-SemiBold"; font-size: 16px; margin-bottom: 8px; } .rh2-coupon-item-guide-item { font-size: 14px; font-style: italic; margin-top: 4px; margin-bottom: 4px; } .rh2-coupon-item-business-basic-row { display: flex; flex-direction: row; } .rh2-coupon-item-business-logo-col { flex: initial; width: 96px; height: 96px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-coupon-item-business-attr-col { flex: 1; padding-left: 8px; } .rh2-coupon-item-business-title-row { display: block; font-family: "Inter-SemiBold"; font-size: 18px; height: 40px; text-decoration: none; } .rh2-coupon-item-business-title-row:visited { color: initial; } .rh2-coupon-item-business-cuisine-row { color: hsla(0, 0%, 60%, 1); } .rh2-coupon-item-business-review-row { height: 32px; padding-top: 8px; display: flex; } .rh2-coupon-item-business-review-row-review-image { flex: initial; width: 96px; height: 24px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-coupon-item-business-review-row-review-number { margin-left: 8px; font-size: 14px; color: hsla(0, 0%, 60%, 1); line-height: 24px; } .rh2-coupon-item-business-review-row-price-col { margin-left: 8px; font-size: 14px; line-height: 24px; } .rh2-coupon-item-business-review-row-price-col-on { display: inline-block; color: hsla(14, 88%, 55%, 1); } .rh2-coupon-item-business-review-row-price-col-off { display: inline-block; color: #d0d0d0; } .rh2-coupon-item-business-photos-row { margin-top: 16px; border: 1px solid hsla(0, 0%, 80%, 1); width: 340px; margin-bottom: 16px; display: flex; flex-direction: row; } .rh2-coupon-item-business-photos-row-item { flex: initial; width: 72px; height: 72px; margin-right: 4px; background-size: contain; background-repeat: no-repeat; background-position: center; } .rh2-coupon-item-business-photos-row-item-more { flex: initial; width: 32px; height: 72px; line-height: 72px; text-align: center; text-decoration: none; } .rh2-coupon-item-business-section-links-row { padding-top: 8px; padding-bottom: 8px; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 8px; width: 340px; text-decoration: none; } .rh2-coupon-item-business-section-links-row-item { margin-left: 8px; margin-right: 8px; text-decoration: none; } .rh2-coupon-item-business-location-title-row { margin-top: 32px; font-family: "Inter-SemiBold"; font-size: 18px; } .rh2-coupon-item-business-address-row { margin-top: 16px; font-size: 14px; } .rh2-coupon-item-business-map-row { margin-top: 16px; width: 100%; height: 192px; } .rh2-coupon-item-business-other-coupons-row { margin-top: 32px; padding: 16px; border: 1px solid hsla(0, 0%, 80%, 1); border-radius: 16px; } .rh2-coupon-item-business-other-coupons-title { font-family: "Inter-SemiBold"; font-size: 18px; } .rh2-coupon-item-business-other-coupons-item { margin-top: 16px; font-size: 14px; } .rh2-coupon-link-business-other-coupons-link { float: right; color: hsla(0, 0%, 60%, 1); } .rh2-coupon-link-business-other-coupons-link:visited { color: hsla(0, 0%, 60%, 1); } /* coupon only */ .rh2-coupon-item-full-screen-overlay { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 1); z-index: 20; } .rh2-coupon-item-full-screen-overlay-active { display: initial; } .rh2-coupon-item-full-screen-overlay-close { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; border: 1px solid hsla(0, 0%, 0%, 1); } .rh2-coupon-item-full-screen-overlay-close:hover { opacity: 1; } .rh2-coupon-item-full-screen-overlay-translucent { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 0.5); z-index: 20; } .rh2-coupon-item-full-screen-overlay-translucent-active { display: initial; } .rh2-coupon-item-full-screen-overlay-translucent-close { position: absolute; right: 50%; top: 50%; margin-right: -440px; margin-top: -290px; width: 32px; height: 32px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; } .rh2-coupon-item-coupon-form-container { position: absolute; width: 800px; height: 500px; left: 50%; margin-left: -400px; top: 50%; margin-top: -250px; } .rh2-coupon-item-coupon-form-container-mobile { position: absolute; width: 100%; height: 100%; z-index: 10; background: hsla(0, 0%, 100%, 1); } .rh2-business-item-coupon-card-desktop { position: relative; width: 100%; max-width: 720px; height: 240px; margin-right: 8px; margin-bottom: 24px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: row; } .rh2-business-item-coupon-card-mobile { position: relative; display: block; width: 100%; max-width: 100%; margin-right: 8px; margin-bottom: 16px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; } .rh2-business-item-coupon-card-part-image-desktop { flex: initial; width: 240px; height: 100%; } .rh2-business-item-coupon-card-part-image-mobile { flex: initial; height: 240px; } .rh2-business-item-coupon-card-part-image-image { display: block; position: relative; width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-item-coupon-card-part-text-desktop { flex: 1; height: 100%; padding-top: 16px; padding-bottom: 16px; } .rh2-business-item-coupon-card-part-text-mobile { min-height: 240px; padding-top: 16px; padding-bottom: 16px; } .rh2-business-item-coupon-card-row-title { display: block; width: 100%; padding-left: 16px; color: #33c1a2; font-family: "Inter-SemiBold"; font-size: 18px; line-height: 20px; margin-bottom: 8px; text-decoration: none; } .rh2-business-item-coupon-card-row-title:visited { color: #33c1a2; } .rh2-business-item-coupon-card-section-schedule { font-size: 14px; padding-left: 16px; padding-right: 16px; overflow: hidden; color: hsla(0, 0%, 50%, 1); margin-bottom: 8px; } .rh2-business-item-coupon-card-row-condition-0 { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; font-size: 14px; margin-bottom: 4px; overflow: hidden; color: hsla(0, 0%, 50%, 1); } .rh2-business-item-coupon-card-row-condition-1 { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; font-size: 14px; line-height: 16px; margin-bottom: 4px; color: hsla(0, 0%, 50%, 1); } .rh2-business-item-coupon-card-row-condition-2 { width: 100%; max-width: 100%; padding-left: 16px; padding-right: 16px; font-size: 14px; line-height: 16px; color: hsla(0, 0%, 50%, 1); } .rh2-business-item-coupon-card-section-action { margin-top: 8px; padding-left: 16px; } .rh2-business-list-coupon-card-desktop { position: relative; width: 100%; max-width: 100%; height: 240px; margin-right: 8px; margin-bottom: 24px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: row; } .rh2-business-list-coupon-card-mobile { position: relative; display: block; width: 100%; max-width: 100%; margin-right: 8px; margin-bottom: 16px; border: 1px solid #DDDDDD; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; } .rh2-business-list-coupon-card-part-image-desktop { flex: initial; width: 280px; height: 100%; } .rh2-business-list-coupon-card-part-image-mobile { flex: initial; height: 240px; } .rh2-business-list-coupon-card-part-image-image { display: block; position: relative; width: 100%; height: 100%; background-size: cover; background-repeat: no-repeat; background-position: center; } .rh2-business-list-coupon-card-part-text-desktop { flex: 1; height: 100%; padding-top: 16px; padding-bottom: 16px; } .rh2-business-list-coupon-card-part-text-mobile { min-height: 200px; padding-top: 16px; padding-bottom: 16px; } .rh2-business-list-coupon-card-row-title { display: block; width: 100%; padding-left: 16px; color: #3cc0a2; font-family: "Inter-SemiBold"; font-size: 18px; line-height: 20px; text-decoration: none; } .rh2-business-list-coupon-card-row-title:visited { color: #3cc0a2; } .rh2-business-list-coupon-card-section-schedule { margin-top: 4px; font-size: 14px; padding-left: 16px; padding-right: 16px; overflow: hidden; color: hsla(0, 0%, 50%, 1); } .rh2-business-list-coupon-card-section-schedule-item { display: block; margin-right: 8px; } .rh2-business-list-coupon-card-section-action { margin-top: 8px; padding-left: 16px; } .rh2-business-list-coupon-card-section-business { margin-top: 8px; } .rh2-business-list-coupon-card-section-business-name-row { margin-top: 8px; padding-left: 16px; font-family: "Inter-SemiBold"; font-size: 14px; } .rh2-business-list-coupon-card-section-business-name-row:visited { color: initial; } .rh2-business-list-coupon-card-section-business-attr-row-0 { margin-top: 4px; padding-left: 16px; height: 20px; line-height: 20px; display: flex; flex-direction: row; font-size: 14px; color: hsla(0, 0%, 60%, 1); overflow: hidden; } .rh2-business-list-coupon-card-section-business-attr-row-0-ta-image { width: 100px; height: 20px; background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-business-list-coupon-card-section-business-attr-row-0-cuisine { margin-left: 8px; } .rh2-business-list-coupon-card-section-business-attr-row-1 { margin-top: 4px; padding-left: 16px; height: 20px; line-height: 20px; display: flex; flex-direction: row; font-size: 14px; color: hsla(0, 0%, 60%, 1); } .rh2-business-list-coupon-card-section-business-attr-row-1-special-count {} .rh2-business-list-coupon-card-section-business-attr-row-1-coupon-count { margin-left: 8px; } .rh2-business-list-coupon-card-see-details-button { position: absolute; bottom: 16px; right: 192px; width: 160px; height: 32px; border-radius: 8px; color: hsla(0, 0%, 35%, 1); border: 1px solid hsla(0, 0%, 35%, 1); text-decoration: none; padding-top: 6px; text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-coupon-card-see-details-button:visited { color: hsla(0, 0%, 35%, 1); } .rh2-business-list-coupon-card-book-button { position: absolute; bottom: 16px; right: 16px; width: 160px; height: 32px; border-radius: 8px; background-color: #3cc0a2; color: hsla(0, 0%, 100%, 1); text-decoration: none; padding-top: 6px; text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-business-list-coupon-card-book-button:visited { background-color: #3cc0a2; color: hsla(0, 0%, 100%, 1); }</style> <style>/* RH BookingForm CSS */ .rh2-bf-generic { width: 100%; height: 100%; border: 1px solid #D3D3D3; border-radius: 16px; box-shadow: 0px 3px 12px #00000014; } .rh2-bf-generic-header { } .rh2-bf-generic-body { } .rh2-bf-generic-footer { } .rh2-bf-generic-header { position: relative; width: 100%; height: 48px; margin-top: 20px; flex: initial; padding-left: 12px; padding-right: 12px; font-size: 20px; font-weight: bold; line-height: 24px; } .rh2-bf-generic-pdt-bar { position: relative; width: 192px; height: 52px; left: 50%; margin-left: -96px; margin-bottom: 20px; border-radius: 26px; border: 1px solid #DDDDDD; font-size: 14px; font-weight: bold; box-shadow: 0px 3px 13px #00000010; display: flex; flex-direction: row; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-bf-generic-pdt-label-col { padding-top: 16px; padding-left: 16px; } .rh2-bf-generic-pax-col { flex: initial; width: 32px; position: relative; height: 100%; } .rh2-bf-generic-pax-span { width: 100%; height: 32px; margin-top: 10px; padding-top: 6px; padding-left: 16px; } .rh2-bf-generic-pdt-overlay { position: absolute; width: 360px; max-width: 90%; max-height: 100%; height: 100%; display: none; z-index: 20; padding-top: 116px; } .rh2-bf-generic-pdt-overlay-active { display: flex !important; flex-direction: column; } /* .rh2-bf-pdt-overlay-left-lane { position: relative; flex: initial; width: 360px; max-width: 100%; } */ .rh2-bf-pdt-overlay-content-area { max-width: 100%; padding: 16px; background: white; margin-top: 8px; height: 360px; max-height: 360px; overflow-y: auto; border: 1px solid #DDDDDD; box-shadow: 0px 3px 13px #00000010; } .rh2-bf-pdt-overlay-content-area-pax { position: absolute; left: 50%; width: 120px; padding-top: 0px; } .rh2-bf-pdt-overlay-content-area-date { } .rh2-bf-pdt-overlay-content-area-time { position: absolute; right: 0px; width: 160px; padding-top: 0px; } .rh2-bf-overlay-pax-value-span { width: 20px; text-align: center; display: inline-block; position: relative; top: -10px; } .rh2-bf-generic-overlay-pax-row { width: 90%; font-size: 14px; font-weight: bold; padding: 14px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-bf-generic-overlay-pax-row-selected { border-radius: 24px; background-color: #EEEEEE; } .rh2-bf-generic-calendar { position: relative; width: 90%; margin-left: 5%; height: 326px; } .rh2-bf-generic-calendar-container { position: relative; left: 50%; margin-left: -140px; width: 280px; height: 320px; } .rh2-bf-generic-continue-button { position: relative; width: 160px; height: 38px; left: 50%; margin-left: -80px; background-color: hsla(15, 85%, 55%, 1); border-radius: 8px; color: hsla(0, 0%, 100%, 1); padding-top: 10px; text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } </style> <style>.rh2-fragment-special-item-desktop { padding-bottom: 144px; font-family: "Inter-Regular"; } .rh2-booking-text-input { display: inline-block; height: 36px; padding-left: 4px; padding-right: 4px; font-size: 16px; line-height: 36px; border-radius: 4px; border: 1px solid #E0E0E0; font-family: 'Inter-Regular'; } .rh2-booking-heading { position: relative; width: 100%; height: 48px; margin-top: 20px; flex: initial; padding-left: 12px; padding-right: 12px; font-size: 20px; font-family: "Inter-Bold"; line-height: 24px; } .rh2-booking-ccform { border: none; outline: none; overflow: hidden; } .rh2-booking-message-row { padding-top: 4px; padding-bottom: 4px; font-size: 16px; } .rh2-booking-message-row-red { color: red; } .rh2-booking-message-row-hidden { display: none; } .rh2-booking-body-desktop { width: 100%; display: flex; padding-bottom: 130px; } .rh2-booking-body-mobile { width: 100%; display: flex; } .rh2-booking-left-column-desktop { flex: 3; } .rh2-booking-left-column-mobile { flex: 3; padding-left: 8px; padding-right: 8px; } .rh2-booking-middle-column-desktop { flex: 1; } .rh2-booking-middle-column-mobile { display: none; } .rh2-booking-right-column-desktop { flex: 5; } .rh2-booking-right-column-mobile { display: none; } .rh2-booking-pax-overlay { position: absolute; width: 360px; max-width: 90%; max-height: 100%; height: 640px; display: none; z-index: 20; padding-top: 50px; } .rh2-booking-pax-overlay-active { display: flex !important; flex-direction: column; } .rh2-booking-pdt-bar { display: flex; flex-direction: row; width: 100%; height: 52px; margin-bottom: 20px; border-radius: 12px; border: 1px solid #DDDDDD; font-size: 14px; font-weight: bold; box-shadow: 0px 3px 13px #00000010; } .rh2-booking-pdt-pax-col { flex: 1; position: relative; height: 100%; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-pdt-pax-icon { position: absolute; top: 16px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/group-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-pdt-pax-span { width: 100%; height: 32px; margin-top: 10px; padding-top: 6px; padding-left: 40px; border-right: 1px solid #EDEDED; } .rh2-booking-pax-overlay-content-area { max-width: 100%; padding: 16px; background: white; margin-top: 8px; border: 1px solid #DDDDDD; box-shadow: 0px 3px 13px #00000010; } .rh2-booking-pax-overlay-content-area-pax { position: absolute; left: 0px; width: 120px; padding-top: 0px; } .rh2-booking-overlay-pax-row { width: 90%; font-size: 14px; font-weight: bold; padding: 14px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-overlay-pax-row-selected { border-radius: 24px; background-color: #EEEEEE; } .rh2-booking-pdt-date-col { flex: 1; position: relative; height: 100%; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-pdt-date-icon { position: absolute; top: 16px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/calendar-event-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-pdt-date-span { width: 100%; height: 32px; margin-top: 10px; padding-top: 6px; padding-left: 40px; border-right: 1px solid #EDEDED; } .rh2-booking-rota-messages { margin-bottom: 20px; } .rh2-booking-pdt-session-row { display: flex; flex-direction: row; border-bottom: 1px solid hsla(0, 0%, 80%, 1); } .rh2-booking-pdt-session-row-item { flex: 1; text-align: center; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-pdt-session-row-item-showing { font-family: "Inter-Bold"; } .rh2-booking-pdt-grid { min-height: 64px; margin-top: 16px; display: flex; flex-wrap: wrap; } .rh2-booking-pdt-grid-button { position: relative; width: 31%; height: 32px; margin-bottom: 16px; margin-left: 1%; margin-right: 1%; text-align: center; padding-top: 8px; border-radius: 8px; border: 1px solid #DDDDDD; font-size: 14px; font-weight: 600; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-pdt-grid-button-unavailable { background-color: #EDEDED !important; color: #B7B7B7; } .rh2-booking-pdt-grid-button-available { cursor: pointer; } .rh2-booking-pdt-grid-button-selected { background-color: #F5214E !important; color: #FFFFFF; } .rh2-booking-pdt-grid-button-star { width: 16px; height: 16px; position: absolute; left: 5px; top: 7px; background-image: url('/rh2/static/icon/bookingform/star-s-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-pdt-grid-button-selected .rh2-booking-pdt-grid-button-star { background-image: url('/rh2/static/icon/bookingform/star-s-outline.svg?r'); } .rh2-booking-pdt-grid-button-star-hd { width: 16px; height: 16px; position: absolute; right: 5px; top: 7px; background-image: url('/rh2/static/icon/bookingform/star-hd-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-pdt-grid-button-selected .rh2-booking-pdt-grid-button-star-hd { background-image: url('/rh2/static/icon/bookingform/star-hd-outline.svg?r'); } .rh2-booking-pdt-time-note-row { clear: both; } .rh2-booking-pdt { margin-bottom: 30px; } .rh2-booking-details-area { clear: both; margin-top: 16px; } .rh2-booking-details-label-row { font-family: "Inter-SemiBold"; margin-top: 16px; margin-bottom: 8px; } .rh2-booking-details-name-row { width: 100%; } .rh2-booking-details-first-name-col { display: inline-block; width: 45%; margin-right: 5%; } .rh2-booking-details-first-name-input { width: 100%; } .rh2-booking-details-last-name-col { display: inline-block; width: 45%; margin-left: 5%; } .rh2-booking-details-last-name-input { width: 100%; } .rh2-booking-details-email-address-input { width: 100%; } .rh2-booking-details-phone-number-input { width: 100%; } .rh2-booking-notes-input { width: 100%; height: auto; font-family: inherit; line-height: 1.5; } .rh2-booking-options-area { margin-top: 32px; } .rh2-booking-options-area-heading { font-family: "Inter-SemiBold"; font-size: 18px; margin-bottom: 16px; } .rh2-booking-options-row { padding-bottom: 0.5em; } .rh2-booking-special-area { clear: both; margin-bottom: 20px; } .rh2-booking-special-tabs-row { display: flex; flex-wrap: nowrap; height: 52px; margin-bottom: 20px; border-radius: 12px; border: 1px solid #DDDDDD; font-size: 14px; font-weight: bold; box-shadow: 0px 3px 13px #00000010; } .rh2-booking-special-tabs-item { display: flex; flex: 0 0 33.3333%; flex-grow: 1; text-align: center; align-items: center; cursor: pointer; user-select: none; } .rh2-booking-special-tabs-all { border-radius: 12px 0 0 12px; } .rh2-booking-special-tabs-hotdeal { border-radius: 0 12px 12px 0; } .rh2-booking-special-tabs-item.selected { background-color: #F5214E; } .rh2-booking-special-tabs-all.selected { .rh2-booking-special-tabs-item-label { color: white; } } .rh2-booking-special-tabs-specials.selected { .rh2-booking-special-tabs-item-icon { background-image: url('/rh2/static/icon/bookingform/star-s-fill-selected.svg'); } .rh2-booking-special-tabs-item-label { color: white; } } .rh2-booking-special-tabs-hotdeal.selected { .rh2-booking-special-tabs-item-icon { background-image: url('/rh2/static/icon/bookingform/star-hd-fill-selected.svg'); } .rh2-booking-special-tabs-item-label { color: white; } } .rh2-booking-special-tabs-specials { border-right: solid 1px #DDD; border-left: solid 1px #DDD; } .rh2-booking-special-tabs-item-label { display: flex; width: 100%; justify-content: center; align-items: center; } .rh2-booking-special-tabs-item-icon { display: inline-block; width: 22px; height: 22px; margin-right: 5px; } .rh2-booking-special-tabs-specials .rh2-booking-special-tabs-item-icon { background: url('/rh2/static/icon/bookingform/star-s-fill.svg') no-repeat center; background-size: contain; } .rh2-booking-special-tabs-hotdeal .rh2-booking-special-tabs-item-icon { background: url('/rh2/static/icon/bookingform/star-hd-fill.svg') no-repeat center; background-size: contain; } .rh2-booking-special-heading-row { font-family: "Inter-SemiBold"; font-size: 18px; margin-bottom: 32px; } .rh2-booking-special-heading-row-mobile { font-family: "Inter-SemiBold"; font-size: 18px; margin-bottom: 16px; } .rh2-booking-special-conditions { margin-top: 25px; font-weight: bold; } .rh2-booking-special-item { padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid hsla(0, 0%, 80%, 1); color: #F5214E; display: flex; align-items: center; flex-direction: row; cursor: pointer; } .rh2-booking-special-item-inactive { opacity: 0.5; } .rh2-booking-special-item-regular { color: unset !important; } .rh2-booking-special-item-control { flex: initial; width: 20px; height: 20px; line-height: 20px; accent-color: #F5214E; cursor: pointer; } .rh2-booking-special-unavail-reason {} .rh2-booking-special-unavail-reason .reason-icon { width: 24px; height: 24px; background: url('/rh2/static/icon/site/question.svg') no-repeat; background-size: cover; } .rh2-booking-special-item-star { width: 1em; height: 1em; line-height: 1em; /* 16px */ background: url('/rh2/static/icon/bookingform/star-s-fill.svg') no-repeat center; background-size: cover; margin: 5px 0 5px 5px; } /* -hd stands for Hot Deals */ .rh2-booking-special-item-star-hd { width: 1em; height: 1em; line-height: 1em; /* 16px */ background: url('/rh2/static/icon/bookingform/star-hd-fill.svg') no-repeat center; background-size: cover; margin: 5px 0 5px 5px; } .rh2-booking-special-item-title { flex: 1; padding-left: 8px; padding-top: 4px; } .rh2-booking-stripe-area { margin: 40px auto 20px; /* border: solid 1px black;*/ } .rh2-booking-stripe-title { margin-bottom: 1em; } .rh2-booking-stripe-form { padding: 1em; border: solid 1px #ccc; border-radius: 10px; } .rh2-booking-stripe-msg { color: red; margin: 20px auto; } .rh2-booking-email-reminder-dialog { border: solid 1px #ccc; border-radius: 10px; } /* copied from .rh2-booking-confirm-button */ .rh2-booking-email-reminder-dialog-close { display: inline-block; background-color: hsla(15, 85%, 55%, 1); border-radius: 8px; color: hsla(0, 0%, 100%, 1); padding: 10px 20px; text-align: center; font-size: 16px; line-height: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-confirm-area-fw-desktop { position: fixed; left: 0px; bottom: 0px; height: 120px; border-top: 1px solid hsla(0, 0%, 80%, 1); background-color: hsla(0, 0%, 100%, 1); } .rh2-booking-confirm-area-fw-mobile { margin-top: 16px; border-top: 1px solid hsla(0, 0%, 80%, 1); } .rh2-booking-confirm-area-pw-desktop { display: flex; flex-direction: row; height: 100%; align-items: center; } .rh2-booking-confirm-area-pw-mobile { margin-top: 16px; padding-left: 8px; padding-right: 8px; } .rh2-booking-confirm-area-agree-row-desktop { flex: 1; } .rh2-booking-confirm-area-agree-row-mobile { margin-bottom: 2em; } .rh2-booking-confirm-area-subscribe-row { margin-bottom: 8px; } .rh2-booking-confirm-area-confirm-row-desktop { line-height: 36px; } .rh2-booking-confirm-area-confirm-row-mobile { text-align: center; line-height: 36px; } .rh2-booking-confirm-area-confirm-row-mobile .rh2-booking-confirm-loader { margin-left: -44px; } .rh2-booking-confirm-loader { display: none; /* inline-block when not hidden */ width: 36px; height: 36px; text-align: center; margin-right: 16px; background: url('/static/img/ajax-loader.gif') no-repeat center center; } .rh2-booking-confirm-button { display: inline-block; background-color: hsla(15, 85%, 55%, 1); border-radius: 8px; color: hsla(0, 0%, 100%, 1); padding: 10px 20px; text-align: center; font-size: 16px; line-height: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-confirm-button-disabled { background-color: hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 100%, 1) !important; cursor: not-allowed !important; } /* date form */ .rh2-booking-full-screen-overlay { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 1); z-index: 20; } .rh2-booking-full-screen-overlay-active { display: initial; } .rh2-booking-full-screen-overlay-close { position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; border: 1px solid hsla(0, 0%, 0%, 1); } .rh2-booking-full-screen-overlay-close:hover { opacity: 1; } .rh2-booking-full-screen-overlay-translucent { display: none; position: fixed; top: 0px; bottom: 0px; width: 100%; height: 100%; background-color: hsla(0, 0%, 0%, 0.5); z-index: 20; overflow: auto; } .rh2-booking-full-screen-overlay-translucent-active { display: initial; } .rh2-booking-full-screen-overlay-translucent-close { position: absolute; right: 50%; top: 50%; margin-right: -440px; margin-top: -290px; width: 32px; height: 32px; background-color: #FFFFFF; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_18dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; z-index: 25; cursor: pointer; opacity: 0.5; } .rh2-booking-dialogue-container-desktop { position: absolute; width: 800px; min-height: 440px; left: 50%; margin-left: -400px; top: 70px; background: hsla(0, 0%, 100%, 1); border-radius: 16px; padding: 16px; } .rh2-booking-dialogue-container-mobile { position: relative; width: 100%; z-index: 10; background: hsla(0, 0%, 100%, 1); padding: 16px; border-radius: 16px; } .rh2-booking-dialogue-heading { position: relative; width: 100%; height: 48px; margin-top: 20px; flex: initial; padding-left: 12px; padding-right: 12px; font-size: 20px; font-family: "Inter-Bold"; line-height: 24px; } .rh2-booking-dialogue-close { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; background: url('/rh2/static/icon/site/close.svg') no-repeat center; background-size: contain; border: solid 1px #666; border-radius: 10px; cursor: pointer; } .rh2-booking-dialogue-body-desktop { width: 100%; display: flex; } .rh2-booking-dialogue-body-mobile { width: 100%; } .rh2-booking-dialogue-left-column-desktop { flex: 5; position: relative; } .rh2-booking-dialogue-left-column-mobile { position: relative; } .rh2-booking-dialogue-middle-column-desktop { flex: 1; position: relative; } .rh2-booking-dialogue-middle-column-mobile { display: none; } .rh2-booking-dialogue-right-column-desktop { flex: 6; position: relative; } .rh2-booking-dialogue-right-column-mobile { position: relative; } .rh2-booking-dialogue-pdt-area { width: 100%; position: relative; } .rh2-booking-dialogue-pdt-bar { display: flex; flex-direction: row; width: 100%; height: 52px; margin-bottom: 20px; border-radius: 12px; border: 1px solid #DDDDDD; font-size: 14px; font-weight: bold; box-shadow: 0px 3px 13px #00000010; } .rh2-booking-dialogue-pdt-pax-col { flex: 1; position: relative; height: 100%; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-dialogue-pdt-pax-icon { position: absolute; top: 16px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/group-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-pdt-pax-span { width: 100%; height: 32px; margin-top: 10px; padding-top: 6px; padding-left: 40px; border-right: 1px solid #EDEDED; } .rh2-booking-dialogue-pax-overlay-content-area { position: absolute; top: 140px; left: 16px; width: 120px; max-width: 100%; padding: 16px; background: white; margin-top: 8px; border: 1px solid #DDDDDD; box-shadow: 0px 3px 13px #00000010; } .rh2-booking-dialogue-overlay-pax-row { width: 90%; font-size: 14px; font-weight: bold; padding: 14px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-dialogue-overlay-pax-row-selected { border-radius: 24px; background-color: #EEEEEE; } .rh2-booking-dialogue-pdt-date-col { flex: 1; position: relative; height: 100%; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-dialogue-pdt-date-icon { position: absolute; top: 16px; left: 12px; width: 20px; height: 20px; background-image: url('/rh2/static/icon/bookingform/calendar-event-line.svg'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-pdt-date-span { width: 100%; height: 32px; margin-top: 10px; padding-top: 6px; padding-left: 40px; border-right: 1px solid #EDEDED; } .rh2-booking-dialogue-pdt-calendar { position: relative; width: 100%; height: 320px; } .rh2-booking-dialogue-pdt-calendar-container { position: relative; left: 50%; margin-left: -140px; width: 280px; height: 320px; } .rh2-booking-dialogue-highlight-select { width: 100%; height: 40px; background-color: hsla(348, 100%, 95%, 1); color: hsla(347, 91%, 55%, 1); display: flex; border-radius: 8px; padding-top: 10px; padding-bottom: 10px; padding-left: 4px; padding-right: 4px; cursor: pointer; margin-bottom: 16px; } .rh2-booking-dialogue-highlight-select-star { width: 20px; height: 20px; flex: initial; background-image: url('/rh2/static/icon/bookingform/star-s-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-highlight-select-star-hd { width: 20px; height: 20px; flex: initial; background-image: url('/rh2/static/icon/bookingform/star-hd-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-highlight-select-title { flex: 1; text-overflow: ellipsis; overflow: hidden; padding-left: 8px; } .rh2-booking-dialogue-highlight-select-arrow { width: 20px; height: 20px; flex: initial; background-image: url('/rh2/static/icon/material/navigation/2x_web/ic_expand_more_black_36dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-pax-overlay { position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; display: none; z-index: 20; padding-top: 50px; } .rh2-booking-dialogue-pax-overlay-active { display: flex !important; flex-direction: column; } .rh2-booking-dialogue-highlight-overlay { position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; display: none; z-index: 20; padding-top: 50px; } .rh2-booking-dialogue-highlight-overlay-active { display: flex !important; flex-direction: column; } .rh2-booking-dialogue-highlight-overlay-content-area { position: absolute; min-width: 85%; top: 192px; left: 0px; margin-left: 16px; margin-right: 16px; border: 1px solid hsla(0, 0%, 80%, 1); max-width: 100%; background: white; margin-top: 8px; overflow-y: auto; border: 1px solid #DDDDDD; box-shadow: 0px 3px 13px #00000010; } .rh2-booking-dialogue-highlight-overlay-content-area-hidden { display: none; } .rh2-booking-dialogue-left-column-mobile .rh2-booking-dialogue-pax-overlay-content-area-highlight { top: 112px; bottom: unset; } .rh2-booking-dialogue-highlight-option { width: 100%; height: 40px; background-color: hsla(0, 0%, 100%, 1); color: hsla(347, 91%, 55%, 1); display: flex; padding-top: 10px; padding-bottom: 10px; padding-left: 4px; padding-right: 4px; cursor: pointer; border-bottom: 1px solid hsla(0, 0%, 80%, 1); } .rh2-booking-dialogue-highlight-option:hover { background-color: hsla(348, 100%, 95%, 1); } .rh2-booking-dialogue-highlight-option-star { width: 20px; height: 20px; flex: initial; background-image: url('/rh2/static/icon/bookingform/star-s-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-highlight-option-star-hd { width: 20px; height: 20px; flex: initial; background-image: url('/rh2/static/icon/bookingform/star-hd-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-highlight-option-title { flex: 1; text-overflow: ellipsis; overflow: hidden; padding-left: 8px; } .rh2-booking-dialogue-specials-heading { font-family: "Inter-SemiBold"; } .rh2-booking-dialogue-right-column-mobile .rh2-booking-dialogue-specials-heading { margin-top: 32px; } .rh2-booking-dialogue-specials-area { margin-top: 16px; /* bottom margin to make room for the button */ margin-bottom: 70px; border-top: 1px solid hsla(0, 0%, 80%, 1); } .rh2-booking-dialogue-specials-item { display: flex; flex-direction: row; padding: 12px 10px 12px 10px; border-bottom: 1px solid hsla(0, 0%, 80%, 1); /*cursor: pointer; user-select: none;*/ } .rh2-booking-dialogue-specials-item.selected { background-color: hsla(348, 100%, 95%, 1); } .rh2-booking-dialogue-specials-item-star { width: 1em; margin-right: 0.25em; flex: initial; background-image: url('/rh2/static/icon/bookingform/star-s-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-specials-item-star-hd { width: 1em; margin-right: 0.25em; flex: initial; background-image: url('/rh2/static/icon/bookingform/star-hd-fill.svg?r'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-dialogue-specials-item-title { flex: 1; color: hsla(347, 91%, 55%, 1); } .rh2-booking-dialogue-specials-item-info { width: 24px; flex: initial; } .rh2-booking-dialogue-continue-button { position: absolute; left: 50%; bottom: 16px; display: flex; justify-content: center; align-items: center; width: 160px; height: 38px; margin-left: -80px; background-color: hsla(15, 85%, 55%, 1); border-radius: 8px; color: hsla(0, 0%, 100%, 1); text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-dialogue-right-column-mobile .rh2-booking-dialogue-continue-button { position: relative; } /* result success */ .rh2-booking-result-success-mobile { text-align: center; } .rh2-booking-result-success-icon-row { width: 100%; margin-top: 32px; } .rh2-booking-result-success-icon { position: relative; left: 50%; margin-left: -32px; width: 64px; height: 64px; background-image: url('/rh2/static/icon/material/action/2x_web/ic_check_circle_black_36dp.png'); background-size: 100%; background-repeat: no-repeat; background-position: center; } .rh2-booking-result-success-title-row { margin-top: 8px; font-family: "Inter-Bold"; font-size: 28px; width: 100%; text-align: center; } .rh2-booking-result-success-email-label-row { margin-top: 16px; font-family: "Inter-SemiBold"; font-size: 16px; width: 100%; text-align: center; } .rh2-booking-result-success-email-value-row { margin-top: 8px; font-size: 18px; width: 100%; text-align: center; } .rh2-booking-result-success-business-name-row { margin-top: 48px; font-family: "Inter-SemiBold"; font-size: 20px; } .rh2-booking-result-success-details-table { margin-top: 32px; width: 160px; } .rh2-booking-result-success-mobile .rh2-booking-result-success-details-table { position: relative; width: 160px; left: 50%; margin-left: -80px; } .rh2-booking-result-success-details-tbody {} .rh2-booking-result-success-details-tr {} .rh2-booking-result-success-details-th { font-family: "Inter-SemiBold"; min-width: 64px; text-align: left; } .rh2-booking-result-success-details-td {} .rh2-booking-result-error-message-label-row { font-family: "Inter-SemiBold"; font-size: 20px; margin-bottom: 16px; } .rh2-booking-result-error-message-value-row { font-size: 16px; margin-bottom: 8px; } /* stripe screen */ .rh2-booking-stripe-card-number-input { width: 100%; max-width: 240px; } .rh2-booking-stripe-second-row { display: flex; flex-direction: row; width: 100%; max-width: 320px; margin-bottom: 32px; } .rh2-booking-stripe-expiry-col { min-width: 160px; } .rh2-booking-stripe-cvc-col {} .rh2-booking-stripe-expiry-control-row { width: 100%; } .rh2-booking-stripe-expiry-month-input { width: 36px; text-align: center; } .rh2-booking-stripe-expiry-year-input { width: 36px; text-align: center; } .rh2-booking-stripe-expiry-separator { display: inline-block; width: 20px; height: 36px; text-align: center; font-size: 16px; line-height: 36px; } .rh2-booking-stripe-expiry-year20 { display: inline-block; width: 20px; height: 36px; text-align: right; font-size: 16px; line-height: 36px; padding-right: 4px; } .rh2-booking-stripe-cvc-input { width: 60px; text-align: center; } .rh2-booking-stripe-submit-row { padding-top: 40px; } .rh2-booking-stripe-submit-button { position: relative; width: 160px; height: 38px; background-color: hsla(15, 85%, 55%, 1); border-radius: 8px; color: hsla(0, 0%, 100%, 1); padding-top: 10px; text-align: center; font-size: 16px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -webkit-touch-callout: none; } .rh2-booking-stripe-submit-button-disabled { background-color: hsla(0, 0%, 80%, 1) !important; color: hsla(0, 0%, 100%, 1) !important; } @font-face { font-family: "Inter-Regular"; font-style: normal; font-weight: normal; src: url("/rh2/static/font/Inter/Inter-Regular.ttf") format("truetype"); } @font-face { font-family: "Inter-SemiBold"; font-style: normal; font-weight: normal; src: url("/rh2/static/font/Inter/Inter-SemiBold.ttf") format("truetype"); } @font-face { font-family: "Inter-Bold"; font-style: normal; font-weight: normal; src: url("/rh2/static/font/Inter/Inter-Bold.ttf") format("truetype"); }</style> <script>if (navigator.userAgent.match('median')) { let appstyle = document.createElement('link'); appstyle.setAttribute('rel', 'stylesheet'); appstyle.setAttribute('type', 'text/css'); appstyle.setAttribute('href', 'https://emailtemplates.hosting.eveve.co.nz/app/appstyle.css'); document.querySelector('head').appendChild(appstyle) }</script> </head> <body data-rh2-google-signin-client-id="137324965566-jdnmcahg329ro6tctmrfv4ejnk7lufq7.apps.googleusercontent.com" data-rh2-facebook-signin-app-id="706608999777126" data-rh2-seo-crawler="" data-rh2-today="2024-11-28"> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TLF6M2XV" height="0" width="0" style="display:none;visibility:hidden"> </iframe> </noscript> <div class="rh2-fragment-manager"> </div> <div class="rh2-page-dialogue-overlay"> </div> <script>// #RH2 const rh2 = window.rh2 = {}; // implement array.flat() for old user-agents (mostly iOS) if (!Array.prototype.flat) { Object.defineProperty(Array.prototype, 'flat', { value: function(depth = 1) { return this.reduce(function(flat, toFlatten) { return flat.concat((Array.isArray(toFlatten) && (depth > 1)) ? toFlatten.flat(depth - 1) : toFlatten); }, []); } }); } // #Utilities (function() { const utils = rh2.utils = {} utils.is_desktop = function() { return parseInt(window.getComputedStyle(document.body).width) >= 640 } utils.is_mobile = function() { return !(this.is_desktop()) } utils.currency_value_to_expr = function(value) { if (value == null) { return null } let cents = value % 100 let dollars = (value - cents) / 100 return dollars + "." + (cents < 10 ? "0" + cents : cents) } utils.currency_expr_to_value = function(expr) { const parsed_float = parseFloat(expr) if (isNaN(parsed_float)) { return null } return parseInt(parsed_float * 100) } utils.get_today_str = function() { const body = document.body return body.getAttribute('data-rh2-today') } utils.urlify = function(params) { if (utils.is_object(params)) { // convert to array let pairs = []; for (let key in params) { pairs.push([key, params[key]]); } params = pairs; } const querystring = params.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]); }).join('&'); return querystring; } utils.is_object = function(obj) { return ( obj !== null && typeof(obj) == 'object' && !Array.isArray(obj) ); } utils.filter_object = function(obj, callback) { let entries = Object.entries(obj) console.log('entries before', entries) entries = entries.filter(([key, val]) => callback(val, key)) console.log('entries after', entries) return Object.fromEntries(entries) } utils.is_empty = function(obj) { if (this.is_object(obj)) { return Object.keys(obj).length === 0; } if (Array.isArray(obj)) { return obj.length === 0; } return obj > '' ? false : true } utils.is_numeric = function(value) { value = Math.floor(value).toString(); return /^\d+$/.test(value); } utils.get_category = function() { let category = 'ALL' let parts = utils.get_href_parts() let query_dict = utils.get_query_dict(parts[3]) if (query_dict.category) { category = query_dict.category[0] } // check if it is valid if (['ALL', 'SPECIAL', 'SPECIAL_HD'].indexOf(category) === -1) { category = 'ALL' } return category } utils.get_href_parts = function(href) { if (href && href.indexOf('http') !== 0) { // detected relative path, make it complete url href = window.location.origin + href } const _href = href || window.location.href const re_href = /(\w+):\/\/(.[^\/]+)([^?]*)[?]{0,1}(.*)/ const mo = re_href.exec(_href) const scheme = mo[1] const host = mo[2] const path = mo[3] const querystring = mo[4] return [ scheme, host, path, querystring, ] } utils.get_query_dict = function(querystring) { if (querystring.indexOf('#') > -1) { querystring = querystring.substring(0, querystring.indexOf('#')) } const d = {} if (!querystring) { return d } const parts = querystring.split('&') for (let i = 0; i < parts.length; i++) { const part = parts[i] const _parts = part.split('=') const key = _parts[0] const value = decodeURIComponent(_parts[1]) if (!Array.isArray(d[key])) { d[key] = [] } d[key].push(value) } return d } // modify querystring args in given url and return new url utils.modify_href = function(href, params) { href = href || window.location.href if (!utils.is_object(params)) { return href } let href_parts = utils.get_href_parts(href) let qs_params = utils.get_query_dict(href_parts[3]) for (let key in params) { let val = params[key] if (qs_params.hasOwnProperty(key)) { if (params[key] == null) { delete qs_params[key] } else { qs_params[key] = val } } else if (params[key] !== null) { qs_params[key] = val } } let qs = utils.urlify(qs_params) return { scheme: href_parts[0], host: href_parts[1], path: href_parts[2], querystring: qs, url_abs: href_parts[0] + '://' + href_parts[1] + href_parts[2] + (qs ? '?' + qs : ''), url_rel: href_parts[2] + (qs ? '?' + qs : '') } } utils.schedule_bgi = function(el, url, delay) { if (el === undefined) { const els = document.getElementsByClassName('rh2-dbgi') for (let i = 0; i < els.length; i++) { utils.schedule_bgi(els[i]) } return } else if (Array.isArray(el)) { for (let i = 0; i < el.length; i++) { utils.schedule_bgi(el[i]) } return } if (url === true) { const els = el.getElementsByClassName('rh2-dbgi') for (let i = 0; i < els.length; i++) { utils.schedule_bgi(els[i]) } return } else if (url === undefined) { url = el.getAttribute('data-rh2-dbgi-url') if (url) { utils.schedule_bgi(el, url) } return } if (delay === undefined) { delay = parseInt(el.getAttribute('data-rh2-dbgi-delay') || 0) } if (delay === 0) { el.style['background-image'] = "url('" + url + "')" } else { window.setTimeout(function() { el.style['background-image'] = "url('" + url + "')" }, delay) } } utils.is_password_valid = function(s) { if (s.length < 8) return false return true } utils.is_email_address_valid = function(s) { const re = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ if (s.match(re) === null) return false return true } utils.is_phone_number_valid = function(s) { const re = /^[\d\+\-]{6,20}$/ if (s.match(re) === null) return false return true } utils.load_google_maps = async function(timeout = 15000, interval = 200) { return new Promise((resolve, reject) => { const check_interval = setInterval(() => { if (window.google && window.google.maps && window.google.maps.Map && window.google.maps.LatLng && window.google.maps.marker && window.markerClusterer) { // console.log('google.maps loaded') clearInterval(check_interval) resolve(true) } timeout -= interval if (timeout <= 0) { // console.error('google.maps failed to load after ', timeout, ' milliseconds') clearInterval(check_interval) resolve(false) } }, interval) }) } utils.wait_objects = async function(object_names, timeout = 10000) { if (!Array.isArray(object_names)) { // console.log('not an array') return false } let interval = 100 return new Promise((resolve, reject) => { const check_interval = setInterval(() => { let fulfilled = true for (let object_name of object_names) { if (window[object_name] === undefined) { fulfilled = false break } } if (fulfilled) { // console.log('objects loaded:', object_names) clearInterval(check_interval) resolve(true) return } timeout -= interval if (timeout <= 0) { // console.log('load timeout:', object_names) clearInterval(check_interval) resolve(false) } }, interval) }) } utils.new_dialogue = function(render) { const Dialogue = function() { const overlay_el = this.overlay_el = document.getElementsByClassName('rh2-page-dialogue-overlay')[0] if (overlay_el.classList.contains('rh2-page-dialogue-overlay-active')) { return null } overlay_el.innerHTML = '' overlay_el.classList.add('rh2-page-dialogue-overlay-active') const dialogue_el = this.dialogue_el = document.createElement('div') dialogue_el.classList.add('rh2-page-dialogue') overlay_el.appendChild(dialogue_el) const dialogue_title_el = this.dialogue_title_el = document.createElement('div') dialogue_title_el.classList.add('rh2-page-dialogue-title') dialogue_el.appendChild(dialogue_title_el) const dialogue_body_el = this.dialogue_body_el = document.createElement('div') dialogue_body_el.classList.add('rh2-page-dialogue-body') dialogue_el.appendChild(dialogue_body_el) const dialogue_footer_el = this.dialogue_footer_el = document.createElement('div') dialogue_footer_el.classList.add('rh2-page-dialogue-footer') dialogue_el.appendChild(dialogue_footer_el) if (render) { render(this) } } Dialogue.prototype = { set_title: function(s) { this.dialogue_title_el.innerText = s }, set_body_text: function(s) { this.dialogue_body_el.innerText = s }, add_body_text: function(s) { const el = document.createElement('div') el.innerText = s this.dialogue_body_el.appendChild(el) }, add_button: function(text, render_callback, click_callback) { const el = document.createElement('div') el.classList.add('rh2-page-dialogue-button') el.innerText = text this.dialogue_footer_el.appendChild(el) if (render_callback) { render_callback(this, el) } el.addEventListener('click', function(e) { if (click_callback) { click_callback(this) } }.bind(this)) }, clear_buttons: function() { this.dialogue_footer_el.innerHTML = '' }, close: function(duration, delay, callback) { duration = duration || 0 delay = delay || 0 window.setTimeout(function() { this.overlay_el.innerHTML = '' this.overlay_el.classList.remove('rh2-page-dialogue-overlay-active') if (callback) { callback(this) } }.bind(this), delay) }, } return new Dialogue() } utils.repr_date = function(date) { let dts = date + 'T00:00:00+00:00' let d = new Date(Date.parse(dts)) let day = d.getUTCDate() day = day >= 10 ? day.toString() : '0' + day.toString() let month = d.getMonth() + 1 month = month >= 10 ? month.toString() : '0' + month.toString() let year = d.getUTCFullYear().toString() let repr = day + '/' + month + '/' + year return repr } utils.month_repr_date = function(date) { const date_obj = new Date(date) let month = '' if (date_obj.getMonth() == 0) { month = 'January' } else if (date_obj.getMonth() == 1) { month = 'February' } else if (date_obj.getMonth() == 2) { month = 'March' } else if (date_obj.getMonth() == 3) { month = 'April' } else if (date_obj.getMonth() == 4) { month = 'May' } else if (date_obj.getMonth() == 5) { month = 'June' } else if (date_obj.getMonth() == 6) { month = 'July' } else if (date_obj.getMonth() == 7) { month = 'August' } else if (date_obj.getMonth() == 8) { month = 'September' } else if (date_obj.getMonth() == 9) { month = 'October' } else if (date_obj.getMonth() == 10) { month = 'November' } else if (date_obj.getMonth() == 11) { month = 'December' } return month } utils.weekday_repr_date = function(date) { const date_obj = new Date(date) let weekday = '' if (date_obj.getDay() == 0) { weekday = 'Sun' } else if (date_obj.getDay() == 1) { weekday = 'Mon' } else if (date_obj.getDay() == 2) { weekday = 'Tue' } else if (date_obj.getDay() == 3) { weekday = 'Wed' } else if (date_obj.getDay() == 4) { weekday = 'Thu' } else if (date_obj.getDay() == 5) { weekday = 'Fri' } else if (date_obj.getDay() == 6) { weekday = 'Sat' } return weekday } utils.repr_time = function(time) { let dts = '1970-01-01T' + time + '+00:00' let d = new Date(Date.parse(dts)) let am_pm = d.getUTCHours() < 12 ? 'am' : 'pm' let hour = d.getUTCHours() if (hour == 0) { hour = 12 } else if (hour > 12) { hour = hour - 12 } let minute = d.getMinutes() minute = minute > 0 ? minute.toString() : '00' let repr = hour + ':' + minute + ' ' + am_pm return repr } utils.zero_pad = function(n) { let s = n.toString() if (s.length == 1) { s = "0" + s } return s } utils.format_time_24 = function(time) { if (time.h != null && time.m != null) { return this.zero_pad(time.h) + ":" + this.zero_pad(time.m) } return '' } utils.monetary_value_to_expr = function(v) { const cents = v % 100 const dollors = (v - cents) / 100 return `${dollors}.${rh2.utils.zero_pad(cents)}` } utils.monetary_expr_to_value = function(e) { const mo = /[\d\.\+\-\,]*/.exec(e)[0] let _e = mo == null ? '0' : mo[0] let dollar_part = '' let cent_part = '' const idx_sep = e.indexOf('.') if (idx_sep > -1) { dollar_part = _e.substring(0, idx_sep) cent_part = _e.substring(idx_sep + 1) } else { dollar_part = _e cent_part = '0' } let v = 0 try { v = parseInt([...dollar_part.matchAll(/[\d\+\-]*/g)].join('')) * 100 + parseInt(cent_part) } catch (e) { throw e v = 0 } return v } utils.load_account_details = function(callback) { const url = '/rh2/service/account/details-get/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) callback(rtn) }.bind(this)) xhr.open("GET", url) xhr.send() } utils.fade_away = function(el) { if (el.classList.contains('rh2-utils-fade-away-transition')) { return } if (el.classList.contains('rh2-utils-fade-in-transition')) { return } if (el.classList.contains('rh2-utils-fade-away-endstate')) { return } el.classList.remove('rh2-utils-fade-in-transition') el.classList.remove('rh2-utils-fade-in-endstate') el.classList.add('rh2-utils-fade-away-transition') window.setTimeout(function() { el.classList.add('rh2-utils-fade-away-endstate') el.classList.remove('rh2-utils-fade-away-transition') }, 500) } utils.fade_in = function(el) { if (el.classList.contains('rh2-utils-fade-in-transition')) { return } if (el.classList.contains('rh2-utils-fade-away-transition')) { window.setTimeout(function() { utils.fade_in(el) }, 500) return } if (el.classList.contains('rh2-utils-fade-in-endstate')) { return } el.classList.remove('rh2-utils-fade-away-endstate') el.classList.remove('rh2-utils-fade-away-transition') el.classList.add('rh2-utils-fade-in-transition') window.setTimeout(function() { el.classList.add('rh2-utils-fade-in-endstate') el.classList.remove('rh2-utils-fade-in-transition') }, 500) } utils.parse_payment_card_number = function(s) { let parsed = "" parsed = s.replace(/[^\d]/g, '') parsed = parsed.substring(0, 19) return parsed } utils.format_payment_card_number = function(s) { let formatted = "" if (s.indexOf('4') == 0) { // visa, 16 digits, in format 4-4-4-4 if (s.length > 12) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12), s.substring(12, 16)].join(' ') } else if (s.length == 12) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12)].join(' ') + ' ' } else if (s.length > 8) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12)].join(' ') } else if (s.length == 8) { formatted = [s.substring(0, 4), s.substring(4, 8)].join(' ') + ' ' } else if (s.length > 4) { formatted = [s.substring(0, 4), s.substring(4, 8)].join(' ') } else if (s.length == 4) { formatted = [s.substring(0, 4)].join(' ') + ' ' } else { formatted = [s.substring(0, 4)].join(' ') } return formatted } if (s.length > 0 && parseInt(s.substring(0, 2)) >= 51 && parseInt(s.substring(0, 2)) <= 55) { // mastercard, 16 digits, in format 4-4-4-4 if (s.length > 12) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12), s.substring(12, 16)].join(' ') } else if (s.length == 12) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12)].join(' ') + ' ' } else if (s.length > 8) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12)].join(' ') } else if (s.length == 8) { formatted = [s.substring(0, 4), s.substring(4, 8)].join(' ') + ' ' } else if (s.length > 4) { formatted = [s.substring(0, 4), s.substring(4, 8)].join(' ') } else if (s.length == 4) { formatted = [s.substring(0, 4)].join(' ') + ' ' } else { formatted = [s.substring(0, 4)].join(' ') } return formatted } if (s.indexOf('34') == 0 || s.indexOf('37') == 0) { // amex, 15 digits, in format 4-6-5 if (s.length > 10) { formatted = [s.substring(0, 4), s.substring(4, 10), s.substring(10, 15)].join(' ') } else if (s.length == 10) { formatted = [s.substring(0, 4), s.substring(4, 10)].join(' ') + ' ' } else if (s.length > 4) { formatted = [s.substring(0, 4), s.substring(4, 10)].join(' ') } else if (s.length == 4) { formatted = [s.substring(0, 4)].join(' ') + ' ' } else { formatted = [s.substring(0, 4)].join(' ') } return formatted } if (true) { // allow 19 digits for anything else, in format 4-4-4-4-3 if (s.length > 16) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12), s.substring(12, 16), s.substring(16, 19)].join(' ') } else if (s.length == 16) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12), s.substring(12, 16)].join(' ') + ' ' } else if (s.length > 12) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12), s.substring(12, 16)].join(' ') } else if (s.length == 12) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12)].join(' ') + ' ' } else if (s.length > 8) { formatted = [s.substring(0, 4), s.substring(4, 8), s.substring(8, 12)].join(' ') } else if (s.length == 8) { formatted = [s.substring(0, 4), s.substring(4, 8)].join(' ') + ' ' } else if (s.length > 4) { formatted = [s.substring(0, 4), s.substring(4, 8)].join(' ') } else if (s.length == 4) { formatted = [s.substring(0, 4)].join(' ') + ' ' } else { formatted = [s.substring(0, 4)].join(' ') } return formatted } } })() // #Components ; (function() { const components = rh2.components = {} components.make_el_link_to_item_page = function(el, cfg) { el.classList.add('rh2-clickable') el.setAttribute('data-rh2-restaurant-slug', cfg.slug) el.setAttribute('data-rh2-restaurant-url', cfg.item_page_url) if (cfg.offer) { el.setAttribute('data-rh2-restaurant-offer', cfg.offer) } el.addEventListener('click', function(e) { if (cfg.onclick) { cfg.onclick(e) } const url = e.currentTarget.getAttribute('data-rh2-restaurant-url') document.location.href = url e.preventDefault() //const params = { // slug: e.currentTarget.getAttribute('data-rh2-restaurant-slug'), // url: e.currentTarget.getAttribute('data-rh2-restaurant-url'), //} //const offer = e.currentTarget.getAttribute('data-rh2-restaurant-offer') //if (offer) { // params['offer'] = offer //} //rh2.fragment_manager.enter_fragment('BusinessItem', params) }) } components.render_restaurants_list_item = function(obj_data, idx, list_state) { if (list_state === undefined) { list_state = 'WIDE' } if (list_state == 'WIDE') { // WIDE const item_el = document.createElement('div') item_el.classList.add('rh2-row') item_el.classList.add('rh2-restaurants-list-item') const image_el = document.createElement('a') image_el.classList.add('rh2-restaurants-list-item-image') const image_url = obj_data.image_url rh2.utils.schedule_bgi(image_el, image_url, 0) item_el.appendChild(image_el) components.make_el_link_to_item_page(image_el, { slug: obj_data.slug, item_page_url: obj_data.item_page_url, offer: obj_data.offer, }) if (obj_data.is_featured) { const featured_el = document.createElement('span') featured_el.classList.add('rh2-restaurants-list-item-image-featured') featured_el.innerText = 'featured' image_el.appendChild(featured_el) } const details_el = document.createElement('div') details_el.classList.add('rh2-restaurants-list-item-details') item_el.appendChild(details_el) const details_body_el = document.createElement('div') details_body_el.classList.add('rh2-row') details_body_el.classList.add('rh2-restaurants-list-item-details-body') details_el.appendChild(details_body_el) const details_row0_el = document.createElement('div') details_row0_el.classList.add('rh2-row') details_row0_el.classList.add('rh2-restaurants-list-item-details-row0') details_body_el.appendChild(details_row0_el) const name_el = document.createElement('a') name_el.classList.add('rh2-restaurants-list-item-name') name_el.innerText = obj_data.name details_row0_el.appendChild(name_el) components.make_el_link_to_item_page(name_el, { slug: obj_data.slug, item_page_url: obj_data.item_page_url, offer: obj_data.offer, }) const price_el = document.createElement('div') price_el.classList.add('rh2-restaurants-list-item-price') price_el.innerText = '' if (obj_data.price_level === 1) { price_el.innerText = '$' } else if (obj_data.price_level === 2) { price_el.innerText = '$$' } else if (obj_data.price_level === 3) { price_el.innerText = '$$$' } else if (obj_data.price_level === 4) { price_el.innerText = '$$$$' } details_row0_el.appendChild(price_el) const details_row0_right_el = document.createElement('div') details_row0_right_el.classList.add('rh2-restaurants-list-item-details-row0-right') details_row0_el.appendChild(details_row0_right_el) const details_row1_el = document.createElement('div') details_row1_el.classList.add('rh2-row') details_row1_el.classList.add('rh2-restaurants-list-item-details-row1') details_body_el.appendChild(details_row1_el) const details_row1_left_el = document.createElement('div') details_row1_left_el.classList.add('rh2-restaurants-list-item-details-row1-left') details_row1_el.appendChild(details_row1_left_el) const address_el = document.createElement('div') address_el.classList.add('rh2-restaurants-list-item-address') address_el.innerText = obj_data.address details_row1_left_el.appendChild(address_el) const details_row2_el = document.createElement('div') details_row2_el.classList.add('rh2-row') details_row2_el.classList.add('rh2-restaurants-list-item-details-row2') details_body_el.appendChild(details_row2_el) const cuisines_el = document.createElement('div') cuisines_el.classList.add('rh2-row') cuisines_el.classList.add('rh2-restaurants-list-item-cuisines') details_row2_el.appendChild(cuisines_el) const cuisines = obj_data.cuisine_vals || [] for (let i = 0; i < Math.min(cuisines.length, 4); i++) { const cuisine = cuisines[i] const cuisine_el = document.createElement('span') cuisine_el.innerText = cuisine cuisines_el.appendChild(cuisine_el) if (i < obj_data.cuisine_vals.length - 1) { const sep_el = document.createElement('span') sep_el.innerText = '·' cuisines_el.appendChild(sep_el) } } const details_row3_el = document.createElement('div') details_row3_el.classList.add('rh2-row') details_row3_el.classList.add('rh2-restaurants-list-item-details-row3') details_body_el.appendChild(details_row3_el) const tripadvisor_info_el = document.createElement('div') tripadvisor_info_el.classList.add('rh2-restaurants-list-item-tripadvisor-info') details_row3_el.appendChild(tripadvisor_info_el) if (obj_data.ta_rating && obj_data.ta_num_reviews) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-restaurants-list-item-tripadvisor-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + obj_data.ta_rating.toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") tripadvisor_info_el.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-restaurants-list-item-tripadvisor-num-reviews') ta_num_reviews_el.innerText = obj_data.ta_num_reviews + ' Reviews' tripadvisor_info_el.appendChild(ta_num_reviews_el) } const details_row4_el = document.createElement('div') details_row4_el.classList.add('rh2-row') details_row4_el.classList.add('rh2-restaurants-list-item-details-row4') details_body_el.appendChild(details_row4_el) const promotion_dedup_s = new Set() const promotions = obj_data.promotions || [] for (let i = 0; i < promotions.length; i++) { if (promotion_dedup_s.size >= 3) { break } const promotion = promotions[i] if (promotion_dedup_s.has(promotion.title)) { continue } else { promotion_dedup_s.add(promotion.title) } const row = document.createElement('div') row.classList.add('rh2-restaurants-list-item-promotion-row') details_row4_el.appendChild(row) const structure_span = document.createElement('span') structure_span.classList.add('rh2-restaurants-list-item-promotion-row-structure-span') structure_span.innerText = promotion.structure_expr + ':' row.appendChild(structure_span) const title_span = document.createElement('span') title_span.classList.add('rh2-restaurants-list-item-promotion-row-title-span') title_span.innerText = promotion.title row.appendChild(title_span) } let reserve_el = document.createElement('div') reserve_el.classList.add('rh2-restaurants-list-item-reserve') details_el.appendChild(reserve_el) if (obj_data.bookable) { let reserve_button_el = document.createElement('div') reserve_button_el.classList.add('rh2-restaurants-list-item-reserve-button') reserve_button_el.innerText = 'Reserve' components.make_el_link_to_item_page(reserve_button_el, { slug: obj_data.slug, item_page_url: obj_data.item_page_url, offer: obj_data.offer, }) //if (obj_data.availability && (obj_data.availability.has_date_availability === false || obj_data.availability.has_pax_session_availability === false)) { // reserve_button_el.innerText = 'Check Availability' // reserve_button_el.classList.add('rh2-restaurants-list-item-reserve-button-pax-session-unmet') //} //reserve_button_el.setAttribute('rh2-restaurants-list-item-slug', obj_data.slug) //if (obj_data.date != undefined) { // reserve_button_el.setAttribute('rh2-restaurants-list-item-date', obj_data.date) //} //if (obj_data.pax != undefined) { // reserve_button_el.setAttribute('rh2-restaurants-list-item-pax', obj_data.pax) //} //reserve_button_el.addEventListener('click', function(e) { // const cfg = {} // cfg.slug = e.target.getAttribute('rh2-restaurants-list-item-slug') // cfg.date = e.target.getAttribute('rh2-restaurants-list-item-date') // cfg.pax = e.target.getAttribute('rh2-restaurants-list-item-pax') // const offers_concat = e.target.getAttribute('rh2-restaurants-list-item-offers') // if (offers_concat) { // const offers = offers_concat.split(',') // offers.unshift('all') // cfg.time_filter_options = offers // cfg.time_filter_option_default = obj_data.offer || 'all' // } // components.display_reservation_form(cfg) //}) reserve_el.appendChild(reserve_button_el) } else {} return item_el } else { // NARROW const item_el = document.createElement('div') item_el.classList.add('rh2-row') item_el.classList.add('rh2-restaurants-list-item-narrow') const image_el = document.createElement('a') image_el.classList.add('rh2-restaurants-list-item-image-narrow') const image_url = obj_data.image_url rh2.utils.schedule_bgi(image_el, image_url, 0) item_el.appendChild(image_el) components.make_el_link_to_item_page(image_el, { slug: obj_data.slug, item_page_url: obj_data.item_page_url, offer: obj_data.offer, }) const details_el = document.createElement('div') details_el.classList.add('rh2-restaurants-list-item-details-narrow') item_el.appendChild(details_el) const details_body_el = document.createElement('div') details_body_el.classList.add('rh2-row') details_body_el.classList.add('rh2-restaurants-list-item-details-body-narrow') details_el.appendChild(details_body_el) const details_row0_el = document.createElement('div') details_row0_el.classList.add('rh2-row') details_row0_el.classList.add('rh2-restaurants-list-item-details-row0') details_body_el.appendChild(details_row0_el) const name_el = document.createElement('a') name_el.classList.add('rh2-restaurants-list-item-name') name_el.innerText = obj_data.name details_row0_el.appendChild(name_el) components.make_el_link_to_item_page(name_el, { slug: obj_data.slug, item_page_url: obj_data.item_page_url, offer: obj_data.offer, }) const price_el = document.createElement('div') price_el.classList.add('rh2-restaurants-list-item-price') price_el.innerText = '' if (obj_data.price_level === 1) { price_el.innerText = '$' } else if (obj_data.price_level === 2) { price_el.innerText = '$$' } else if (obj_data.price_level === 3) { price_el.innerText = '$$$' } else if (obj_data.price_level === 4) { price_el.innerText = '$$$$' } details_row0_el.appendChild(price_el) const details_row0_right_el = document.createElement('div') details_row0_right_el.classList.add('rh2-restaurants-list-item-details-row0-right') details_row0_el.appendChild(details_row0_right_el) const details_row1_el = document.createElement('div') details_row1_el.classList.add('rh2-row') details_row1_el.classList.add('rh2-restaurants-list-item-details-row1') details_body_el.appendChild(details_row1_el) const details_row1_left_el = document.createElement('div') details_row1_left_el.classList.add('rh2-restaurants-list-item-details-row1-left') details_row1_el.appendChild(details_row1_left_el) //const address_el = document.createElement('div') //address_el.classList.add('rh2-restaurants-list-item-address') //address_el.innerText = obj_data.address //details_row1_left_el.appendChild(address_el) const details_row2_el = document.createElement('div') details_row2_el.classList.add('rh2-row') details_row2_el.classList.add('rh2-restaurants-list-item-details-row2') details_body_el.appendChild(details_row2_el) const cuisines_el = document.createElement('div') cuisines_el.classList.add('rh2-row') cuisines_el.classList.add('rh2-restaurants-list-item-cuisines') details_row2_el.appendChild(cuisines_el) for (let i = 0; i < Math.min(obj_data.cuisines.length, 4); i++) { const cuisine = obj_data.cuisine_vals[i] const cuisine_el = document.createElement('span') cuisine_el.innerText = cuisine cuisines_el.appendChild(cuisine_el) if (i < obj_data.cuisine_vals.length - 1) { const sep_el = document.createElement('span') sep_el.innerText = '·' cuisines_el.appendChild(sep_el) } } const details_row3_el = document.createElement('div') details_row3_el.classList.add('rh2-row') details_row3_el.classList.add('rh2-restaurants-list-item-details-row3') details_body_el.appendChild(details_row3_el) const tripadvisor_info_el = document.createElement('div') tripadvisor_info_el.classList.add('rh2-restaurants-list-item-tripadvisor-info') details_row3_el.appendChild(tripadvisor_info_el) if (obj_data.ta_rating && obj_data.ta_num_reviews) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-restaurants-list-item-tripadvisor-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + obj_data.ta_rating.toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") tripadvisor_info_el.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-restaurants-list-item-tripadvisor-num-reviews') ta_num_reviews_el.innerText = obj_data.ta_num_reviews + ' Reviews' tripadvisor_info_el.appendChild(ta_num_reviews_el) } const details_row4_el = document.createElement('div') details_row4_el.classList.add('rh2-row') details_row4_el.classList.add('rh2-restaurants-list-item-details-row4') details_body_el.appendChild(details_row4_el) const promotion_dedup_s = new Set() for (let i = 0; i < obj_data.promotions.length; i++) { if (promotion_dedup_s.size >= 3) { break } const promotion = obj_data.promotions[i] if (promotion_dedup_s.has(promotion.title)) { continue } else { promotion_dedup_s.add(promotion.title) } const row = document.createElement('div') row.classList.add('rh2-restaurants-list-item-promotion-row') details_row4_el.appendChild(row) const structure_span = document.createElement('span') structure_span.classList.add('rh2-restaurants-list-item-promotion-row-structure-span') structure_span.innerText = promotion.structure_expr + ':' row.appendChild(structure_span) const title_span = document.createElement('span') title_span.classList.add('rh2-restaurants-list-item-promotion-row-title-span') title_span.innerText = promotion.title row.appendChild(title_span) } let reserve_el = document.createElement('div') reserve_el.classList.add('rh2-restaurants-list-item-reserve-narrow') details_el.appendChild(reserve_el) if (obj_data.bookable) { let reserve_button_el = document.createElement('div') reserve_button_el.classList.add('rh2-restaurants-list-item-reserve-button') reserve_button_el.innerText = 'Reserve' if (obj_data.availability && (obj_data.availability.has_date_availability === false || obj_data.availability.has_pax_session_availability === false)) { reserve_button_el.innerText = 'Check Availability' reserve_button_el.classList.add('rh2-restaurants-list-item-reserve-button-pax-session-unmet') } reserve_button_el.setAttribute('rh2-restaurants-list-item-slug', obj_data.slug) if (obj_data.date != undefined) { reserve_button_el.setAttribute('rh2-restaurants-list-item-date', obj_data.date) } if (obj_data.pax != undefined) { reserve_button_el.setAttribute('rh2-restaurants-list-item-pax', obj_data.pax) } reserve_button_el.addEventListener('click', function(e) { const cfg = {} cfg.slug = e.target.getAttribute('rh2-restaurants-list-item-slug') cfg.date = e.target.getAttribute('rh2-restaurants-list-item-date') cfg.pax = e.target.getAttribute('rh2-restaurants-list-item-pax') const offers_concat = e.target.getAttribute('rh2-restaurants-list-item-offers') if (offers_concat) { const offers = offers_concat.split(',') offers.unshift('all') cfg.time_filter_options = offers cfg.time_filter_option_default = obj_data.offer || 'all' } components.display_reservation_form(cfg) }) reserve_el.appendChild(reserve_button_el) } else {} return item_el } } components.render_reservation_iframe = function(cfg) { const form_el = rh2.BookingForm.render_generic_form(cfg) return form_el //const iframe_el = document.createElement('iframe') //iframe_el.classList.add('rh2-restaurants-reservation-form-iframe') //let src = '/rh2/booking-form/?vendor_slug=' + cfg.slug //if (cfg.pax) { // src += '&pax=' + cfg.pax //} //if (cfg.date) { // src += '&date=' + cfg.date //} //if (cfg.time) { // src += '&time=' + cfg.time //} //if (cfg.referrer) { // src += '&ref=' + cfg.referrer //} // //iframe_el.setAttribute('src', src) //return iframe_el } components.display_reservation_form = function(cfg) { const overlay_el = document.createElement('div') overlay_el.classList.add('rh2-restaurants-reservation-form-overlay') overlay_el.addEventListener('click', function(e) { e.stopPropagation() e.target.parentNode.removeChild(e.target) }) document.body.appendChild(overlay_el) const container_el = document.createElement('div') container_el.classList.add('rh2-restaurants-reservation-form-container') overlay_el.appendChild(container_el) const iframe_el = components.render_reservation_iframe(cfg) container_el.appendChild(iframe_el) const close_el = document.createElement('div') close_el.classList.add('rh2-restaurants-reservation-form-close-button') container_el.appendChild(close_el) close_el.addEventListener('click', function(e) { e.stopPropagation() container_el.innerHTML = '' overlay_el.parentNode.removeChild(overlay_el) }.bind(this)) } components.load_and_render_reservations = async function(container_el, fm) { container_el.innerHTML = '' const response = await fetch('/rh2/service/account/booking-request-list-get/') const data = await response.json() for (let item_data of data.data) { const item_el = document.createElement('div') item_el.classList.add('rh2-col') item_el.classList.add('rh2-w-8') item_el.classList.add('rh2-w-O-m') item_el.classList.add('rh2-account-home-section-reservation-tile') item_el.classList.add('rh2-account-home-section-reservation-item') container_el.appendChild(item_el) const restaurant_name_el = document.createElement('div') restaurant_name_el.classList.add('rh2-account-reservations-list-item-restaurant') restaurant_name_el.innerText = item_data.v_name item_el.appendChild(restaurant_name_el) const reservation_el = document.createElement('div') reservation_el.classList.add('rh2-account-reservations-list-item-reservation') item_el.appendChild(reservation_el) const reservation_pax_row_el = document.createElement('div') reservation_el.appendChild(reservation_pax_row_el) const reservation_pax_icon_el = document.createElement('span') reservation_pax_icon_el.classList.add('rh2-account-reservations-list-item-reservation-pax-icon') reservation_pax_row_el.appendChild(reservation_pax_icon_el) const reservation_pax_text_el = document.createElement('span') reservation_pax_text_el.innerText = 'Reservation for ' + item_data.br_req_covers + ' ' + (item_data.br_req_covers === 1 ? 'person' : 'people') reservation_pax_row_el.appendChild(reservation_pax_text_el) const reservation_datetime_row_el = document.createElement('div') reservation_el.appendChild(reservation_datetime_row_el) const reservation_datetime_icon_el = document.createElement('span') reservation_datetime_icon_el.classList.add('rh2-account-reservations-list-item-reservation-datetime-icon') reservation_datetime_row_el.appendChild(reservation_datetime_icon_el) const reservation_datetime_text_el = document.createElement('span') reservation_datetime_text_el.innerText = rh2.utils.repr_date(item_data.br_req_date) + ' at ' + rh2.utils.repr_time(item_data.br_req_time) reservation_datetime_row_el.appendChild(reservation_datetime_text_el) const reservation_address_row_el = document.createElement('div') reservation_el.appendChild(reservation_address_row_el) const reservation_address_icon_el = document.createElement('span') reservation_address_icon_el.classList.add('rh2-account-reservations-list-item-reservation-address-icon') reservation_address_row_el.appendChild(reservation_address_icon_el) const reservation_address_text_el = document.createElement('span') reservation_address_text_el.innerText = item_data.address reservation_address_row_el.appendChild(reservation_address_text_el) const action_row_el = document.createElement('div') action_row_el.classList.add('rh2-account-reservations-list-item-action-row') item_el.appendChild(action_row_el) const action_col0_el = document.createElement('div') action_col0_el.classList.add('rh2-col') action_col0_el.classList.add('rh2-w-C') action_row_el.appendChild(action_col0_el) } } components.render_category_row = function(row_el, fragment, on_change) { row_el.innerHTML = '' let category = rh2.utils.get_category() const category_list = [ ['ALL', 'Restaurants'], ['SPECIAL', 'Specials'], ['SPECIAL_HD', 'Hot Deals!'], ] if (rh2.config.homepage_coupons_status == 'enabled') { category_list.push(['COUPON', 'Takeaways']); } for (let i = 0; i < category_list.length; i++) { const category_tuple = category_list[i] const [code, title] = category_tuple const el = document.createElement('div') el.classList.add('rh2-business-list-category-row-item') if (rh2.utils.is_desktop()) { el.classList.add('rh2-business-list-category-row-item-desktop') } else { el.classList.add('rh2-business-list-category-row-item-mobile') if (code == 'ALL') { el.classList.add('restaurants') } if (code == 'SPECIAL') { el.classList.add('specials') } if (code == 'SPECIAL_HD') { el.classList.add('hotdeals') } } el.innerText = title row_el.appendChild(el) if (code == category) { el.classList.add('rh2-business-list-category-row-item-active') } el.addEventListener('click', function(e) { // fragment.set_param_value('category', code) // fragment.clear_param_values('promotion_structure') // fragment.clear_param_values('hd_discount') // rh2.components.render_category_row(row_el, fragment, on_change) // on_change() // fragment.business_filter.render_row(fragment.desktop_filter_row_el) // fragment.business_filter.render_promotion_structure_row($(rh2.utils.is_desktop() ? '.rh2-business-promotion-structure-desktop-row' : '.rh2-business-promotion-structure-mobile-row')[0]) // fragment.search.run() // window.scrollTo({ top: 0, behavior: 'smooth' }) $('.rh2-business-list-category-row-item').removeClass('rh2-business-list-category-row-item-active') el.classList.add('rh2-business-list-category-row-item-active') let url = rh2.utils.modify_href(null, { promotion_structure: null, hd_discount: null, category: code }) document.location.href = url.url_rel }.bind(fragment)) } } components.build_sign_in_options = function(fragment) { const section_el = document.createElement('div') section_el.classList.add('rh2-row') section_el.classList.add('rh2-account-login-row') const google_row_el = document.createElement('div') google_row_el.classList.add('rh2-account-login-row') section_el.appendChild(google_row_el) const google_el = document.createElement('div') google_el.classList.add('rh2-account-login-google') google_row_el.appendChild(google_el) const google_logo_el = document.createElement('div') google_logo_el.classList.add('rh2-account-login-google-logo') google_el.appendChild(google_logo_el) const google_text_el = document.createElement('div') google_text_el.classList.add('rh2-account-login-google-text') google_text_el.innerText = 'Sign in with Google' google_el.appendChild(google_text_el) // const facebook_row_el = document.createElement('div') // facebook_row_el.classList.add('rh2-account-login-row') // section_el.appendChild(facebook_row_el) // const facebook_el = document.createElement('div') // facebook_el.classList.add('rh2-account-login-facebook') // facebook_row_el.appendChild(facebook_el) // const facebook_logo_el = document.createElement('div') // facebook_logo_el.classList.add('rh2-account-login-facebook-logo') // facebook_el.appendChild(facebook_logo_el) // const facebook_text_el = document.createElement('div') // facebook_text_el.classList.add('rh2-account-login-facebook-text') // facebook_text_el.innerText = 'Sign in with Facebook' // facebook_el.appendChild(facebook_text_el) const email_row_el = document.createElement('div') email_row_el.classList.add('rh2-account-login-row') section_el.appendChild(email_row_el) const email_el = document.createElement('div') email_el.classList.add('rh2-account-login-email') email_el.addEventListener('click', function() { const params = {} if (fragment.params.qd.post_login) { const post_login = fragment.params.qd.post_login[0] params.post_login = post_login } fragment.fm.enter_fragment('AccountEmailLogin', params) }) email_row_el.appendChild(email_el) const email_logo_el = document.createElement('div') email_logo_el.classList.add('rh2-account-login-email-logo') email_el.appendChild(email_logo_el) const email_text_el = document.createElement('div') email_text_el.classList.add('rh2-account-login-email-text') email_text_el.innerText = 'Sign in with Email' email_el.appendChild(email_text_el) async function get_user_profile(access_token) { // const tokeninfo_response = await fetch('https://www.googleapis.com/oauth2/v3/tokeninfo', { // headers: { // Authorization: `Bearer ${access_token.access_token}` // } // }) // const tokeninfo = await tokeninfo_response.json() // console.log('tokeninfo', tokeninfo) const userinfo_response = await fetch('https://www.googleapis.com/oauth2/v3/userinfo', { headers: { Authorization: `Bearer ${access_token.access_token}` } }) const userinfo = await userinfo_response.json() // console.log('userinfo', userinfo) // const data = { ...tokeninfo, ...userinfo } // return data return userinfo } // bind Google async function google_auth_callback(access_token) { // console.log('access_token', access_token) const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const user = await get_user_profile(access_token) if (!user || !user.email || !user.sub) { dialogue.set_body_text('Sign in failed.') dialogue.close(1000, 2000, function() {}) return } const login_response = await fetch('/rh2/service/account/google-login/', { method: 'post', body: JSON.stringify(user) }) const login_result = await login_response.json() if (login_result.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('Successfully signed in with Google!') dialogue.close(1000, 2000, function() { window.location.reload() }) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + login_result.errcode + ' ErrMsg: ' + login_result.errmsg) dialogue.close(1000, 2000, function() {}) } } const google_auth_script = document.createElement('script') google_auth_script.setAttribute('src', 'https://accounts.google.com/gsi/client') google_auth_script.setAttribute('async', 'true') google_auth_script.setAttribute('defer', 'true') google_auth_script.setAttribute('onload', 'init_google_auth_client()') document.head.appendChild(google_auth_script) window.init_google_auth_client = function() { const client_id = document.body.getAttribute('data-rh2-google-signin-client-id') const client = google.accounts.oauth2.initTokenClient({ client_id: client_id, scope: 'https://www.googleapis.com/auth/userinfo.profile', callback: google_auth_callback }) google_el.addEventListener('click', () => { client.requestAccessToken() }) } // bind Facebook const facebook_login_callback = function(data) { const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const validated_form_data = data const url = '/rh2/service/account/facebook-login/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('Successfully signed in with Facebook!') dialogue.close(1000, 2000, function() { window.location.reload() }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + rtn.errcode + ' ErrMsg: ' + rtn.errmsg) dialogue.close(1000, 2000, function() {}) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) } // facebook_el.addEventListener('click', function(e) { // FB.login(function(response) { // if (response.authResponse) { // console.log('Welcome! Fetching your information.... '); // FB.api('/me', { fields: 'name, email' }, function(response) { // document.getElementById("profile").innerHTML = "Good to see you, " + response.name + ". i see your email address is " + response.email // }); // } else { // console.log('User cancelled login or did not fully authorize.'); // } // }); // }) return section_el } })();</script> <script>// Fragment and FragmentManager ; (function() { const fm = rh2.fragment_manager = function() { const fm = {} fm.fragments_m = new Map() fm.el = document.getElementsByClassName('rh2-fragment-manager')[0] fm.make_deployment_aware = function() { const href_parts = rh2.utils.get_href_parts() const host = href_parts[1] if (host.indexOf('rc-') > -1 || host.indexOf('localdev') > -1) { const ribbon_el = document.createElement('div') ribbon_el.innerText = 'dev' ribbon_el.classList.add('rh2-fragment-manager-deployment-awareness-ribbon') fm.el.appendChild(ribbon_el) } } fm.is_desktop = function() { return parseInt(window.getComputedStyle(document.body)['width']) >= 770 } fm.is_mobile = function() { return !this.is_desktop() } fm.register = function(f) { const name = f.get_name() this.fragments_m.set(name, f) f.bind_fm(this) } fm.choose_fragment_from_url = function() { const href_parts = rh2.utils.get_href_parts() let fragment = null this.fragments_m.forEach(function(value, name, map) { if (value.match_current_url(href_parts)) { fragment = value } }) return fragment } fm.get_fragment = function(name) { return this.fragments_m.get(name) } fm.enter_fragment = function(name, params, skip_rerender) { //if (name == 'SpecialsOffers') { // name = 'BusinessList' //} const f = this.get_fragment(name) if (this.current_fragment) { const current_fragment_name = this.current_fragment.get_name() this.current_fragment.exit(function() { if (!params) { params = {} } params['previous_fragment_name'] = current_fragment_name this._enter_fragment(f, params, skip_rerender) }.bind(this)) } else { this._enter_fragment(f, params, skip_rerender) } } fm._enter_fragment = function(f, params, skip_rerender) { f.enter(params, skip_rerender) this.current_fragment = f if (params && params.__SKIP_PUSH_STATE__) {} else { const fragment_pathname = f.get_current_url() const browser_pathname = window.location.pathname if (fragment_pathname != browser_pathname) { //console.log('pushState', 'fragment_pathname', fragment_pathname, 'browser_pathname', browser_pathname) window.history.pushState({}, f.get_name(), fragment_pathname) } } } return fm }() const Fragment = rh2.Fragment = function() { this.fm = null this.params = {} this.states = {} } Fragment.prototype.get_name = function() { return null } Fragment.prototype.get_current_url = function() { return window.location.pathname } Fragment.prototype.has_param_value = function(k, v) { if (!this.params.hasOwnProperty(k)) { return false } if (this.params[k].indexOf(v) == -1) { return false } return true } Fragment.prototype.get_param_value = function(k) { if (!this.params) { return null } if (!this.params.hasOwnProperty(k)) { return null } return Array.isArray(this.params[k]) ? this.params[k][0] : this.params[k] } Fragment.prototype.set_param_value = function(k, v) { this.params[k] = [v] } Fragment.prototype.num_param_values = function(k, v) { if (!this.params.hasOwnProperty(k)) { return 0 } return this.params[k].length } Fragment.prototype.clear_param_values = function(k) { this.params[k] = [] } Fragment.prototype.add_param_value = function(k, v) { if (!this.params.hasOwnProperty(k)) { this.params[k] = [] } if (this.params[k].indexOf(v) == -1) { this.params[k].push(v) } } Fragment.prototype.remove_param_value = function(k, v) { if (!this.params.hasOwnProperty(k)) { this.params[k] = [] } if (this.params[k].indexOf(v) != -1) { this.params[k].splice(this.params[k].indexOf(v), 1) } } Fragment.prototype.initialize = function() { if (!this.is_initialized) { const el = this.el = document.createElement('div') el.classList.add('rh2-fragment') this.is_initialized = true } this._initialize() } Fragment.prototype._initialize = function() {} Fragment.prototype.enter = function(params, skip_rerender) { if (params && params.__CLEAR__) { this._is_rendered = false this.params = {} } if (!this.params) { this.params = {} } if (params) { for (let k in params) { this.params[k] = params[k] } } this.initialize() this.fm.el.appendChild(this.el) this.render(skip_rerender) this.load() if (this.params && this.params.__LANDING__) { delete this.params.__LANDING__ } this.after_enter() } Fragment.prototype.after_enter = function() { window.setTimeout(function() { window.scrollTo({ top: this.states && this.states['pageYOffset'] || 0, }) }.bind(this), 50) if (this.get_name() === 'RestaurantsItem') { const vendor_slug = this.params && this.params['slug'] || '' try { if (!window.gtag) { console.error("window.gtag undefined") } window.gtag && gtag('event', 'view_item', { 'items': [{ 'id': vendor_slug, 'name': vendor_slug, 'category': 'Restaurant', }] }) } catch (e) { console.error(e) } //window.ga && ga('RH201905.send', 'event', { // 'eventCategory': 'Restaurant', // 'eventAction': 'ViewItem', // 'eventLabel': vendor_slug, //}) try { if (!window.fbq) { console.error("window.fbq undefined") } window.fbq && fbq('track', 'ViewContent', { contents: [{ 'id': vendor_slug, 'quantity': 1, 'item_price': 5, }], value: 5, currency: 'NZD', }) } catch (e) { console.error(e) } } } Fragment.prototype.exit = function(callback) { this.before_exit() this.fm.el.removeChild(this.el) callback && callback() } Fragment.prototype.before_exit = function() { this._before_exit() { const els = document.getElementsByClassName('rh2-restaurants-reservation-form-overlay') for (let i = 0; i < els.length; i++) { const el = els[i] el.parentNode.removeChild(el) } } } Fragment.prototype._before_exit = function() {} Fragment.prototype.render = function(skip_rerender) { if (this._is_rendered != true) { this._render() rh2.utils.schedule_bgi(this.el, true) } this._is_rendered = true } Fragment.prototype.load = function() {} Fragment.prototype.match_current_url = function(href_parts) {} Fragment.prototype.bind_fm = function(fm) { this.fm = fm } window.onpopstate = function(e) { //console.log('onpopstate', 'window.location.href=', window.location.href) const fragment = rh2.fragment_manager.choose_fragment_from_url() if (fragment) { //console.log('onpopstate', 'fragment found, entering') //fragment.init() rh2.fragment_manager.enter_fragment(fragment.get_name(), { __LANDING__: true, __CLEAR__: true, }) fragment.render() } }.bind(this) })()</script> <script>// # AppBar ; (function() { const AppBar = function(cfg) { const loc = this.current_location = this.get_current_location() || {} this.cfg_f = cfg.f this.cfg_fm = cfg.fm this.cfg_business_filter = cfg.business_filter || null this.cfg_hide_search_on_desktop = cfg.hide_search_on_desktop === true this.cfg_hide_search_on_mobile = cfg.hide_search_on_mobile === true this.cfg_layout = cfg.layout || 'DEFAULT' this.cfg_variant = cfg.variant || 'LIST_VIEW' this.value_q = '' this.value_loc_text = loc.loc_text || '' this.value_loc_code = loc.loc_code || '' this.value_region = loc.region_slug || '' this.value_city = loc.city_slug || '' this.value_suburb = loc.suburb_slug || '' this.value_locate_me = null this.search_location_dropdown_el = null } AppBar.prototype.set_search_freetext = function(v) { this.search_freetext_input_el.value = v this.value_q = v if (!this.value_q) { this.search_freetext_clear_el.classList.add('rh2-appbar-search-freetext-clear-hidden') } else { this.search_freetext_clear_el.classList.remove('rh2-appbar-search-freetext-clear-hidden') } } AppBar.prototype.set_search_location_text = function(v) { if (v == '<Near Me>') { this.value_locate_me = true } else { this.value_locate_me = null } this.search_location_input_el.value = v this.value_loc_text = v if (!this.value_loc_text) { this.search_location_clear_el.classList.add('rh2-appbar-search-location-clear-hidden') } else { this.search_location_clear_el.classList.remove('rh2-appbar-search-location-clear-hidden') } } AppBar.prototype.set_search_location_code = function(v) { this.search_location_input_el.setAttribute('rh2-loc-code', v) this.value_loc_code = v } AppBar.prototype.call_service_area_list = function(v) { const url = '/rh2/service/area/area-list/?loc=' + encodeURIComponent(v) let xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const data = rtn.data this.search_location_dropdown_el.innerHTML = '' if (rh2.utils.is_mobile()) { const locate_el = document.createElement('div') locate_el.classList.add('rh2-appbar-search-location-dropdown-item') locate_el.classList.add('rh2-appbar-search-location-dropdown-item-locate') this.search_location_dropdown_el.appendChild(locate_el) const locate_icon_el = document.createElement('div') locate_icon_el.classList.add('rh2-appbar-search-location-dropdown-item-locate-icon') locate_el.appendChild(locate_icon_el) const locate_text_el = document.createElement('div') locate_text_el.classList.add('rh2-appbar-search-location-dropdown-item-locate-text') locate_text_el.innerText = 'Near Me' locate_el.appendChild(locate_text_el) locate_el.addEventListener('click', function() { this.value_loc_text = '<Near Me>' this.value_loc_code = '' this.value_region = null this.value_city = null this.value_suburb = null this.value_locate_me = true this.search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') this.handle_search_submit.call(this) }.bind(this)) } const list_el = document.createElement('div') list_el.classList.add('rh2-appbar-search-location-dropdown-item') list_el.classList.add('rh2-appbar-search-location-dropdown-item-locate') this.search_location_dropdown_el.appendChild(list_el) const list_icon_el = document.createElement('div') list_icon_el.classList.add('rh2-appbar-search-location-dropdown-item-list-icon') list_el.appendChild(list_icon_el) const list_text_el = document.createElement('div') list_text_el.classList.add('rh2-appbar-search-location-dropdown-item-locate-text') list_text_el.innerText = 'Choose from the list' list_el.appendChild(list_text_el) list_el.addEventListener('click', function() { this.location_dialog('user_select') }.bind(this)) for (let i = 0; i < data.object_list.length; i++) { const obj = data.object_list[i] const obj_area_type = obj.area_type let obj_text = '' let obj_code = '' if (obj_area_type == 'REGION') { obj_text = obj.region_name obj_code = '(Region) ' + obj.region_name } if (obj_area_type == 'CITY') { obj_text = obj.city_name obj_code = '(City) ' + obj.city_name } if (obj_area_type == 'SUBURB') { obj_text = obj.suburb_name obj_code = '(Suburb) ' + obj.suburb_name } const item_el = document.createElement('div') item_el.classList.add('rh2-appbar-search-location-dropdown-item') this.search_location_dropdown_el.appendChild(item_el) if (true) { const span = document.createElement('span') span.innerText = '[' + obj.area_type + ']' span.style['font-size'] = '12px' item_el.appendChild(span) } const span_li = [] if (obj.suburb_name != null && span_li.length < 2) { const span = document.createElement('span') span.innerText = obj.suburb_name span.style['margin-left'] = '4px' span_li.push(span) } if (obj.city_name != null && span_li.length < 2) { const span = document.createElement('span') span.innerText = obj.city_name span.style['margin-left'] = '4px' span_li.push(span) } if (obj.region_name != null && span_li.length < 2) { const span = document.createElement('span') span.innerText = obj.region_name span.style['margin-left'] = '4px' span_li.push(span) } if (obj.country_name != null && obj.region_name == null) { const span = document.createElement('span') span.innerText = obj.country_name span.style['margin-left'] = '4px' span_li.push(span) } for (let i = 0; i < span_li.length; i++) { if (i > 0) { const sep = document.createElement('span') sep.innerText = ', ' sep.style['color'] = 'hsla(0, 0%, 60%, 1)' item_el.appendChild(sep) span_li[i].style['color'] = 'hsla(0, 0%, 60%, 1)' } item_el.appendChild(span_li[i]) } const num_span = document.createElement('span') num_span.innerText = '(' + obj.num_restaurants + ')' num_span.classList.add('restaurant-count') item_el.appendChild(num_span) item_el.addEventListener('click', function() { this.value_loc_text = obj_text this.value_loc_code = obj_code this.search_location_input_el.value = this.value_loc_text this.search_location_input_el.setAttribute('rh2-loc-code', this.value_loc_code) this.value_region = obj.region_slug || null this.value_city = obj.city_slug || null this.value_suburb = obj.suburb_slug || null this.value_locate_me = null this.search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') this.save_current_location({ loc_code: this.value_loc_code, loc_text: this.value_loc_text, region_slug: this.value_region || '', city_slug: this.value_city || '', suburb_slug: this.value_suburb || '', }) this.handle_search_submit.call(this) }.bind(this)) } }.bind(this)) xhr.open('GET', url) xhr.send() } AppBar.prototype.reset_location = function() { this.value_loc_text = '' this.value_loc_code = '' this.search_location_input_el.value = this.value_loc_text this.search_location_input_el.setAttribute('rh2-loc-code', '') this.value_region = null this.value_city = null this.value_suburb = null this.value_locate_me = null this.search_location_clear_el.classList.add('rh2-appbar-search-location-clear-hidden') this.save_current_location({}) } // this version of submit will navigate to url and perform actual pageload // instead of doing all that JS nonsense AppBar.prototype.handle_search_submit2 = function(e) { let fragment_name = this.cfg_f.get_name() // submitting from homepage reset all other params // submitting from /eats/ modify current href preserving all other params (date/pax/filters etc.) let href = (fragment_name == 'Home') ? '/rh2/eats/' : null let url = rh2.utils.modify_href(href, { category: rh2.utils.get_category(), loc_code: this.value_loc_code, loc_text: this.value_loc_text, q: this.value_q }) document.location.href = url.url_rel } AppBar.prototype.handle_search_submit = function(e) { let fragment_name = this.cfg_f.get_name() if (fragment_name == 'Home') { return this.handle_search_submit2(e) } const params = { //__CLEAR__: true, 'q': [this.value_q], 'loc_text': [this.value_loc_text], 'loc_code': [this.value_loc_code], } if (this.value_region != null) { params.region = [this.value_region] params.city = [this.value_city] params.suburb = [this.value_suburb] params.geosw = [null] params.geone = [null] params.geocenter = [null] params.georadius = [null] params.locate_me = [null] } if (this.value_locate_me != null) { params.region = [null] params.city = [null] params.suburb = [null] params.geosw = [null] params.geone = [null] params.geocenter = [null] params.georadius = [null] params.locate_me = [true] } if (this.value_region == null && this.value_locate_me == null) { params.region = [null] params.city = [null] params.suburb = [null] params.geosw = [null] params.geone = [null] params.geocenter = [null] params.georadius = [null] params.locate_me = [null] } if (fragment_name.indexOf('BusinessList') == 0) { // } else { params.__CLEAR__ = true fragment_name = 'BusinessList' } this.save_current_location({ loc_text: this.value_loc_text, loc_code: this.value_loc_code, region_slug: this.value_region || '', city_slug: this.value_city || '', suburb_slug: this.value_suburb || '', }) this.cfg_fm.enter_fragment(fragment_name, params) const appbar_home = rh2.fragment_manager.get_fragment('Home').appbar if (appbar_home) { // update homepage appbar, so we can see the same location after changing it in any other fragment appbar_home.set_search_location_code(this.value_loc_code) appbar_home.set_search_location_text(this.value_loc_text) } const appbar_mobile_map = rh2.fragment_manager.get_fragment('BusinessListMobileMap').appbar if (appbar_mobile_map) { // update mobile map appbar, so we can see the same location after changing it in any other fragment appbar_mobile_map.set_search_location_code(this.value_loc_code) appbar_mobile_map.set_search_location_text(this.value_loc_text) } } AppBar.prototype.apply_current_location = function() { let loc = this.get_current_location() if (loc && loc.loc_code) { this.set_search_location_code(loc.loc_code) this.set_search_location_text(loc.loc_text) this.value_region = loc.region_slug this.value_city = loc.city_slug this.value_suburb = loc.suburb_slug } } AppBar.prototype.render = function() { if (rh2.utils.is_desktop()) { return this.render_desktop() } else if (rh2.utils.is_mobile()) { return this.render_mobile() } this.apply_current_location() } AppBar.prototype.render_desktop = function() { let appbar_wrapper_el = null appbar_wrapper_el = document.createElement('div') if (this.cfg_variant == 'HOME_HEADER') { appbar_wrapper_el.classList.add('rh2-appbar-desktop-wrapper-variant-header') } else { appbar_wrapper_el.classList.add('rh2-appbar-desktop-wrapper') } const appbar_el = document.createElement('div') appbar_el.classList.add('rh2-appbar-desktop') appbar_wrapper_el.appendChild(appbar_el) if (this.cfg_variant != 'HOME_HEADER') { const logo_el = document.createElement('a') logo_el.classList.add('rh2-appbar-desktop-logo') logo_el.classList.add('rh2-clickable') logo_el.setAttribute('href', '/rh2/') appbar_el.appendChild(logo_el) } const search_col = document.createElement('div') search_col.classList.add('rh2-appbar-desktop-search-col') appbar_el.appendChild(search_col) if (this.cfg_variant != 'HOME_TOP') { const search_container_el = document.createElement('div') search_container_el.classList.add('rh2-appbar-desktop-search-container') search_col.appendChild(search_container_el) const search_freetext_part_el = document.createElement('div') search_freetext_part_el.classList.add('rh2-appbar-desktop-search-freetext-part') search_container_el.appendChild(search_freetext_part_el) const search_freetext_icon_el = document.createElement('div') search_freetext_icon_el.classList.add('rh2-appbar-desktop-search-freetext-icon') search_freetext_part_el.appendChild(search_freetext_icon_el) const search_freetext_clear_el = this.search_freetext_clear_el = document.createElement('div') search_freetext_clear_el.classList.add('rh2-appbar-search-freetext-clear') search_freetext_clear_el.classList.add('rh2-appbar-search-freetext-clear-hidden') search_freetext_part_el.appendChild(search_freetext_clear_el) search_freetext_clear_el.addEventListener('click', function() { this.set_search_freetext('') this.handle_search_submit.call(this) }.bind(this)) const search_freetext_input_el = this.search_freetext_input_el = document.createElement('input') search_freetext_input_el.classList.add('rh2-appbar-desktop-search-freetext-input') search_freetext_input_el.setAttribute('placeholder', 'Restaurants, Cuisine, Features') search_freetext_input_el.addEventListener('change', function(e) { const value = e.target.value this.value_q = value if (value) { search_freetext_clear_el.classList.remove('rh2-appbar-search-freetext-clear-hidden') } else { search_freetext_clear_el.classList.add('rh2-appbar-search-freetext-clear-hidden') } this.handle_search_submit.call(this) e.target.blur() }.bind(this)) search_freetext_part_el.appendChild(search_freetext_input_el) const search_separator_part_el = document.createElement('div') search_separator_part_el.classList.add('rh2-appbar-desktop-search-separator-part') search_container_el.appendChild(search_separator_part_el) const search_location_part_el = document.createElement('div') search_location_part_el.classList.add('rh2-appbar-desktop-search-location-part') search_container_el.appendChild(search_location_part_el) const search_location_icon_el = document.createElement('div') search_location_icon_el.classList.add('rh2-appbar-desktop-search-location-icon') search_location_part_el.appendChild(search_location_icon_el) const search_location_input_el = this.search_location_input_el = document.createElement('input') search_location_input_el.classList.add('rh2-appbar-desktop-search-location-input') search_location_input_el.setAttribute('placeholder', 'Location') search_location_part_el.appendChild(search_location_input_el) search_location_input_el.value = this.value_loc_text const search_location_clear_el = this.search_location_clear_el = document.createElement('div') search_location_clear_el.classList.add('rh2-appbar-search-location-clear') if (!search_location_input_el.value) { search_location_clear_el.classList.add('rh2-appbar-search-location-clear-hidden') } search_location_part_el.appendChild(search_location_clear_el) search_location_clear_el.addEventListener('click', function() { this.reset_location.call(this) this.handle_search_submit.call(this) }.bind(this)) const search_location_dropdown_el = this.search_location_dropdown_el = document.createElement('div') search_location_dropdown_el.classList.add('rh2-appbar-desktop-search-location-dropdown') search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') search_location_part_el.appendChild(search_location_dropdown_el) search_location_input_el.addEventListener('focus', function(e) { search_location_input_el.setSelectionRange(0, search_location_input_el.value.length) search_location_dropdown_el.classList.remove('rh2-appbar-search-location-dropdown-hidden') this.call_service_area_list(search_location_input_el.getAttribute('rh2-loc-code') || search_location_input_el.value) }.bind(this)) search_location_input_el.addEventListener('focusout', function(e) { window.setTimeout(function() { search_location_input_el.value = this.value_loc_text search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') if (search_location_input_el.value) { search_location_clear_el.classList.remove('rh2-appbar-search-location-clear-hidden') } else { search_location_clear_el.classList.add('rh2-appbar-search-location-clear-hidden') } }.bind(this), 200) }.bind(this)) search_location_input_el.addEventListener('keyup', function(e) { // to make the dropdown re-appear when keep typing after a submit search_location_dropdown_el.classList.remove('rh2-appbar-search-location-dropdown-hidden') if (e.code == 'Enter') { search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') this.value_loc_text = search_location_input_el.value this.value_loc_code = '' search_location_input_el.setAttribute('rh2-loc-code', this.value_loc_code) this.value_region = null this.value_city = null this.value_region = null this.value_locate_me = null if (search_location_input_el.value) { search_location_clear_el.classList.remove('rh2-appbar-search-location-clear-hidden') } else { search_location_clear_el.classList.add('rh2-appbar-search-location-clear-hidden') } this.handle_search_submit.call(this) return } this.call_service_area_list(search_location_input_el.value) }.bind(this)) const search_button_el = document.createElement('div') search_button_el.classList.add('rh2-appbar-desktop-search-button') search_button_el.innerText = 'Find' search_col.appendChild(search_button_el) search_button_el.addEventListener('click', function() { this.apply_current_location() this.handle_search_submit.call(this) }.bind(this)) } if (this.cfg_variant != 'HOME_HEADER') { const nav_container_el = this.appbar_nav_container_el = document.createElement('div') nav_container_el.classList.add('rh2-appbar-desktop-nav-container') appbar_el.appendChild(nav_container_el) const nav_businesses_el = document.createElement('a') nav_businesses_el.setAttribute('data-rh2-appbar-desktop-nav-item-name', 'BusinessList') nav_businesses_el.classList.add('rh2-clickable') nav_businesses_el.classList.add('rh2-appbar-desktop-nav-item') if (this.cfg_f && this.cfg_f.get_name() == 'BusinessList') { nav_businesses_el.classList.add('rh2-appbar-desktop-nav-item-active') } nav_businesses_el.innerText = 'Eats' const blfm = this.cfg_fm.fragments_m.get('BusinessList') nav_businesses_el.addEventListener('click', function(e) { e.preventDefault() let params = {} let loc = this.get_current_location() if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) document.location.href = url.url_rel }.bind(this)) nav_container_el.appendChild(nav_businesses_el) const nav_events_el = document.createElement('a') nav_events_el.setAttribute('data-rh2-appbar-desktop-nav-item-name', 'EventfindaEvents') nav_events_el.classList.add('rh2-clickable') nav_events_el.classList.add('rh2-appbar-desktop-nav-item') if (this.cfg_f && this.cfg_f.get_name() == 'EventfindaEvents') { nav_events_el.classList.add('rh2-appbar-desktop-nav-item-active') } nav_events_el.innerText = 'Events' nav_events_el.addEventListener('click', function(e) { document.location.href = '/rh2/eventfinda-events/' }.bind(this)) nav_container_el.appendChild(nav_events_el) const nav_account_el = document.createElement('a') nav_account_el.setAttribute('data-rh2-appbar-desktop-nav-item-name', 'Account') nav_account_el.classList.add('rh2-clickable') nav_account_el.classList.add('rh2-appbar-desktop-nav-item') if (this.cfg_f && this.cfg_f.get_name() == 'AccountHome') { nav_account_el.classList.add('rh2-appbar-desktop-nav-item-active') } if (this.cfg_f && this.cfg_f.get_name() == 'AccountLogin') { nav_account_el.classList.add('rh2-appbar-desktop-nav-item-active') } nav_account_el.innerText = 'Account' nav_account_el.addEventListener('click', function(e) { document.location.href = '/rh2/account/' }.bind(this)) nav_container_el.appendChild(nav_account_el) } if (this.cfg_hide_search_on_desktop) { search_col.innerHTML = '' } return appbar_wrapper_el } AppBar.prototype.render_mobile = function() { let appbar_wrapper_el = null appbar_wrapper_el = document.createElement('div') appbar_wrapper_el.classList.add('rh2-appbar-mobile-wrapper') if (this.cfg_variant == 'MAP_VIEW') { appbar_wrapper_el.classList.add('rh2-appbar-mobile-map-wrapper') } if (this.cfg_layout == 'HOME') { if (rh2.utils.is_mobile()) { appbar_wrapper_el.classList.add('rh2-appbar-mobile-wrapper-home') } } const logo_row = document.createElement('div') logo_row.classList.add('rh2-appbar-mobile-logo-row') appbar_wrapper_el.appendChild(logo_row) if (this.cfg_layout == 'HOME' && rh2.utils.is_mobile()) { logo_row.style['margin-bottom'] = '32px' } const logo_el = document.createElement('a') if (this.cfg_layout == 'BUSINESS_LIST_MOBILE') { logo_el.classList.add('rh2-appbar-mobile-logo-icon-only') } else if (this.cfg_layout == 'HOME' && rh2.utils.is_mobile()) { logo_el.classList.add('rh2-appbar-mobile-logo-home') } else { logo_el.classList.add('rh2-appbar-mobile-logo') } logo_el.classList.add('rh2-clickable') logo_el.href = '/rh2/' logo_row.appendChild(logo_el) const logo_row_search_col = document.createElement('div') logo_row_search_col.classList.add('rh2-appbar-mobile-logo-row-search-col') logo_row.appendChild(logo_row_search_col) const nav_container_el = document.createElement('div') nav_container_el.classList.add('rh2-appbar-mobile-nav-container') logo_row.appendChild(nav_container_el) const nav_hamburger_el = document.createElement('a') nav_hamburger_el.setAttribute('data-rh2-appbar-mobile-nav-item-name', 'Account') nav_hamburger_el.classList.add('rh2-appbar-mobile-nav-item') nav_hamburger_el.classList.add('rh2-appbar-mobile-nav-item-hamburger') nav_hamburger_el.classList.add('rh2-clickable') nav_hamburger_el.addEventListener('click', function(e) { e.preventDefault() const hamburger_menu_el = document.createElement('div') hamburger_menu_el.classList.add('rh2-appbar-mobile-hamburger-menu') this.cfg_fm.el.appendChild(hamburger_menu_el) const close_el = document.createElement('div') close_el.classList.add('rh2-appbar-mobile-hamburger-menu-close') close_el.addEventListener('click', function() { hamburger_menu_el.parentNode.removeChild(hamburger_menu_el) }.bind(this)) hamburger_menu_el.appendChild(close_el) const home_el = document.createElement('div') home_el.classList.add('rh2-appbar-mobile-hamburger-menu-item') if (this.cfg_f && this.cfg_f.get_name() == 'Home') { home_el.classList.add('rh2-appbar-mobile-hamburger-menu-item-active') } home_el.innerText = 'Home' home_el.addEventListener('click', function(e) { document.location.href = '/rh2/' }.bind(this)) hamburger_menu_el.appendChild(home_el) const blfm = this.cfg_fm.fragments_m.get('BusinessList') const business_el = document.createElement('div') business_el.classList.add('rh2-appbar-mobile-hamburger-menu-item') if (this.cfg_f && this.cfg_f.get_name() == 'BusinessList') { business_el.classList.add('rh2-appbar-mobile-hamburger-menu-item-active') } business_el.innerText = 'Eats' business_el.addEventListener('click', function(e) { hamburger_menu_el.parentNode.removeChild(hamburger_menu_el) let params = { category: rh2.utils.get_category() } let loc = this.get_current_location() if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) document.location.href = url.url_rel }.bind(this)) hamburger_menu_el.appendChild(business_el) const account_el = document.createElement('div') account_el.classList.add('rh2-appbar-mobile-hamburger-menu-item') if (this.cfg_f && this.cfg_f.get_name() == 'AccountHome') { account_el.classList.add('rh2-appbar-mobile-hamburger-menu-item-active') } if (this.cfg_f && this.cfg_f.get_name() == 'AccountLogin') { account_el.classList.add('rh2-appbar-mobile-hamburger-menu-item-active') } account_el.innerText = 'Account' account_el.addEventListener('click', function(e) { document.location.href = '/rh2/account/' }.bind(this)) hamburger_menu_el.appendChild(account_el) }.bind(this)) nav_container_el.appendChild(nav_hamburger_el) const search_row = document.createElement('div') search_row.classList.add('rh2-appbar-mobile-search-row') if (this.cfg_layout == 'BUSINESS_LIST_MOBILE') { logo_row_search_col.appendChild(search_row) } else if (this.cfg_layout == 'HOME') { const pad = document.createElement('div') pad.classList.add('rh2-appbar-mobile-search-row-pad') appbar_wrapper_el.appendChild(pad) pad.appendChild(search_row) search_row.style['background-color'] = 'unset' } else { //appbar_wrapper_el.appendChild(search_row) } const search_col = document.createElement('div') search_col.classList.add('rh2-appbar-mobile-search-col') search_row.appendChild(search_col) const search_container_el = document.createElement('div') search_container_el.classList.add('rh2-appbar-mobile-search-container') search_col.appendChild(search_container_el) const search_freetext_part_el = document.createElement('div') search_freetext_part_el.classList.add('rh2-appbar-mobile-search-freetext-part') search_container_el.appendChild(search_freetext_part_el) const search_freetext_icon_el = document.createElement('div') search_freetext_icon_el.classList.add('rh2-appbar-mobile-search-freetext-icon') search_freetext_part_el.appendChild(search_freetext_icon_el) const search_freetext_clear_el = this.search_freetext_clear_el = document.createElement('div') search_freetext_clear_el.classList.add('rh2-appbar-search-freetext-clear') search_freetext_clear_el.classList.add('rh2-appbar-search-freetext-clear-hidden') search_freetext_part_el.appendChild(search_freetext_clear_el) search_freetext_clear_el.addEventListener('click', function() { this.set_search_freetext('') this.handle_search_submit.call(this) }.bind(this)) const search_freetext_input_el = this.search_freetext_input_el = document.createElement('input') search_freetext_input_el.classList.add('rh2-appbar-mobile-search-freetext-input') search_freetext_input_el.type = 'text' search_freetext_input_el.placeholder = 'Restaurant, Cuisine' search_freetext_input_el.setAttribute('inputmode', 'search') search_freetext_input_el.addEventListener('change', function(e) { this.value_q = e.target.value e.target.blur() this.handle_search_submit.call(this) }.bind(this)) search_freetext_part_el.appendChild(search_freetext_input_el) if (this.cfg_fm.current_fragment && this.cfg_fm.current_fragment.params.search_freetext) { search_freetext_input_el.value = this.cfg_fm.current_fragment.params.search_freetext } const search_separator_part_el = document.createElement('div') search_separator_part_el.classList.add('rh2-appbar-mobile-search-separator-part') search_container_el.appendChild(search_separator_part_el) const search_location_part_el = document.createElement('div') search_location_part_el.classList.add('rh2-appbar-mobile-search-location-part') search_container_el.appendChild(search_location_part_el) const search_location_icon_el = document.createElement('div') search_location_icon_el.classList.add('rh2-appbar-mobile-search-location-icon') search_location_part_el.appendChild(search_location_icon_el) const search_location_input_el = this.search_location_input_el = document.createElement('input') search_location_input_el.classList.add('rh2-appbar-mobile-search-location-input') search_location_input_el.type = 'text' search_location_input_el.placeholder = 'Location' search_location_input_el.setAttribute('inputmode', 'search') search_location_part_el.appendChild(search_location_input_el) search_location_input_el.value = this.value_loc_text const search_location_clear_el = this.search_location_clear_el = document.createElement('div') search_location_clear_el.classList.add('rh2-appbar-search-location-clear') if (!search_location_input_el.value) { search_location_clear_el.classList.add('rh2-appbar-search-location-clear-hidden') } search_location_part_el.appendChild(search_location_clear_el) search_location_clear_el.addEventListener('click', function() { this.reset_location.call(this) this.handle_search_submit.call(this) }.bind(this)) const search_location_dropdown_el = this.search_location_dropdown_el = document.createElement('div') search_location_dropdown_el.classList.add('rh2-appbar-mobile-search-location-dropdown') search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') search_row.appendChild(search_location_dropdown_el) search_location_input_el.addEventListener('focus', function(e) { search_location_input_el.setSelectionRange(0, search_location_input_el.value.length) search_location_dropdown_el.classList.remove('rh2-appbar-search-location-dropdown-hidden') this.call_service_area_list(search_location_input_el.getAttribute('rh2-loc-code') || search_location_input_el.value) }.bind(this)) search_location_input_el.addEventListener('focusout', function(e) { window.setTimeout(function() { search_location_input_el.value = this.value_loc_text search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') }.bind(this), 200) }.bind(this)) search_location_input_el.addEventListener('change', function(e) { search_location_dropdown_el.classList.add('rh2-appbar-search-location-dropdown-hidden') this.value_loc_text = search_location_input_el.value this.value_loc_code = '' search_location_input_el.setAttribute('rh2-loc-code', this.value_loc_code) this.value_region = null this.value_city = null this.value_region = null this.value_locate_me = null this.handle_search_submit.call(this) }.bind(this)) search_location_input_el.addEventListener('keyup', function(e) { this.call_service_area_list(search_location_input_el.value) }.bind(this)) if (this.cfg_hide_search_on_mobile) { search_row.innerHTML = '' } return appbar_wrapper_el } AppBar.prototype.location_dialog = async function(mode) { const appbar = this const current_location = this.get_current_location() if (current_location !== null && mode !== 'user_select') { // it's set, skip dialog return } let $bg = $('.rh2-page-dialogue-overlay') $bg.addClass('rh2-page-dialogue-overlay-active') let $dialog = $('<dialog>').addClass('rh2-location-dialog') $dialog.appendTo($bg) const response = await fetch('/rh2/service/area/bookable-list/') const areas = await response.json() function confirm_location(e) { let is_entire_nz = e.data && e.data.entire_nz ? true : false // close dialog $dialog.remove() $bg.removeClass('rh2-page-dialogue-overlay-active') let region_slug = $dialog.find('select[name="region"]').val() let city_slug = $dialog.find('select[name="city"]').val() let suburb_slug = $dialog.find('select[name="suburb"]').val() let region_name = areas[region_slug].name let city_name = '' let suburb_name = '' if (city_slug) { city_name = areas[region_slug].cities[city_slug].name } if (suburb_slug) { suburb_name = areas[region_slug].cities[city_slug].suburbs[suburb_slug].name } loc_text = region_name if (city_name > '') { loc_text = city_name } if (suburb_name > '') { loc_text = suburb_name } let loc_code = '(Region) ' + region_name if (city_name > '') { loc_code = '(City) ' + city_name } if (suburb_name > '') { loc_code = '(Suburb) ' + suburb_name } let current_location = { loc_code: loc_code, loc_text: loc_text, region_slug: region_slug, city_slug: city_slug, suburb_slug: suburb_slug, } if (is_entire_nz) { current_location = { loc_code: '', loc_text: '', region_slug: '', city_slug: '', suburb_slug: '', } } appbar.save_current_location(current_location) appbar.apply_current_location.call(appbar) appbar.handle_search_submit(appbar) } function render_form(current_region, current_city, current_suburb) { // empty existing content and child elements $dialog.empty() $('<div class="rh2-location-dialog-title">Choose your location</div>').appendTo($dialog) const $form_el = $('<div class="rh2-location-dialog-form">').appendTo($dialog) const $region_sel = $('<select name="region" class="input">').appendTo($form_el) const $city_sel = $('<select name="city" class="input">').appendTo($form_el) $('<option value="">City (optional)</option>').appendTo($city_sel) const $suburb_sel = $('<select name="suburb" class="input">').appendTo($form_el) $('<option value ="">Suburb (optional)</option>').appendTo($suburb_sel) const $count_text_el = $('<div class="rh2-location-count-row">').appendTo($form_el).text('Restaurants in area: ') const $count_el = $('<span class="rh2-location-count">').appendTo($count_text_el).text('?') const $confirm_row = $('<div class="rh2-location-dialog-confirm-row">').appendTo($dialog) const $confirm = $('<button class="button">').text('Select this location').appendTo($confirm_row) $confirm.on('click', confirm_location) const $nz_row = $('<div class="rh2-location-dialog-nz-row">').appendTo($dialog) const $nz = $('<button class="button">').text('Entire New Zealand').appendTo($nz_row) $nz.on('click', { entire_nz: true }, confirm_location) for (let region_slug in areas) { if (!current_region) { current_region = region_slug } let region_name = areas[region_slug].name let $option_region = $('<option>').text(region_name).attr('value', region_slug).appendTo($region_sel) if (region_slug == current_region) { $option_region.attr('selected', '') $count_el.text(areas[region_slug].bookable_count) let cities = areas[region_slug].cities for (let city_slug in cities) { let city_name = cities[city_slug].name let $option_city = $('<option>').text(city_name).attr('value', city_slug).appendTo($city_sel) if (city_slug == current_city) { $option_city.attr('selected', '') $count_el.text(cities[city_slug].bookable_count) let suburbs = cities[city_slug].suburbs for (let suburb_slug in suburbs) { let suburb_name = suburbs[suburb_slug].name let $option_suburb = $('<option>').text(suburb_name).attr('value', suburb_slug).appendTo($suburb_sel) if (suburb_slug == current_suburb) { $option_suburb.attr('selected', '') $count_el.text(suburbs[suburb_slug].bookable_count) } } } } } } $region_sel.on('change', () => { current_region = $region_sel.val() render_form(current_region) }) $city_sel.on('change', () => { current_city = $city_sel.val() render_form(current_region, current_city) }) $suburb_sel.on('change', () => { current_suburb = $suburb_sel.val() render_form(current_region, current_city, current_suburb) }) $dialog.on('click', (e) => { let event = e.originalEvent let node_name = e.target.nodeName.toLowerCase() if (node_name == 'select') { return } // clicking outside of dialog will close it let rect = $dialog[0].getBoundingClientRect() let is_dialog = (rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width ) if (is_dialog) { return } let params = current_location === null ? { data: { entire_nz: true } } : {} confirm_location(params) }) } if (current_location && current_location.region_slug > '') { render_form(current_location.region_slug, current_location.city_slug, current_location.suburb_slug) } else { render_form() } $dialog[0].showModal() } AppBar.prototype.save_current_location = function(loc) { localStorage.setItem('current_location', JSON.stringify(loc)) } AppBar.prototype.get_current_location = function() { let current_location = null try { current_location = JSON.parse(localStorage.getItem('current_location')) } catch (e) { console.error(e) } return current_location } rh2.AppBar = AppBar })()</script> <script>// #Calendar ; (function() { const Calendar = function(cfg) { this.date = null this.dates_m = new Map() this.special_idx = null this.promotions = [] this.dates_closed = [] if (cfg && cfg.date) { this.date = this.parse_date(cfg.date) } else { //let date = new Date() //this.date = new Date(date.getFullYear(), date.getMonth(), date.getDate()) } if (cfg && cfg.min_date) { this.min_date = new Date(cfg.min_date + "T00:00:00Z") //this.min_date = this.parse_date(cfg.min_date) } if (cfg && cfg.max_date) { this.max_date = new Date(cfg.max_date + "T00:00:00Z") //this.max_date = this.parse_date(cfg.max_date) } if (cfg && cfg.num_months) { this.num_months = cfg.num_months } if (cfg && cfg.dates) { for (let i = 0; i < cfg.dates.length; i++) { let k = cfg.dates[i][0] let promotion_idx_ar = cfg.dates[i][1] this.dates_m.set(k, promotion_idx_ar) } this.dates = cfg.dates } if (cfg && cfg.promotions) { this.promotions = cfg.promotions } if (cfg && cfg.dates_closed) { this.dates_closed = cfg.dates_closed } if (cfg && cfg.special_uuid) { for (let i = 0; i < this.promotions.length; i++) { if (this.promotions[i]['uuid'] == cfg.special_uuid) { this.special_idx = i } } } this.onselect = cfg && cfg.onselect || null this.m_el_list = [] this.m_data_list = [] } Calendar.prototype.zero_pad = function(n) { let s = n.toString() if (s.length == 1) { s = "0" + s } return s } Calendar.prototype.month_repr_date = function(date) { const date_obj = new Date(date) let month = '' if (date_obj.getMonth() == 0) { month = 'January' } else if (date_obj.getMonth() == 1) { month = 'February' } else if (date_obj.getMonth() == 2) { month = 'March' } else if (date_obj.getMonth() == 3) { month = 'April' } else if (date_obj.getMonth() == 4) { month = 'May' } else if (date_obj.getMonth() == 5) { month = 'June' } else if (date_obj.getMonth() == 6) { month = 'July' } else if (date_obj.getMonth() == 7) { month = 'August' } else if (date_obj.getMonth() == 8) { month = 'September' } else if (date_obj.getMonth() == 9) { month = 'October' } else if (date_obj.getMonth() == 10) { month = 'November' } else if (date_obj.getMonth() == 11) { month = 'December' } return month } Calendar.prototype.render = function(container_el) { this.container_el = container_el container_el.classList.add('rh2-calendar-container') this.m_el_list = [] this.m_data_list = [] for (let i = 0; i < this.num_months; i++) { const m = document.createElement('div') m.classList.add('rh2-calendar-month') container_el.appendChild(m) this.m_el_list.push(m) } } Calendar.prototype.render_date = function(date) { if (date) { this.date = date } const d = this.date || new Date() for (let i = 0; i < this.num_months; i++) { if (!this.m_data_list[i]) { if (i === 0) { this.m_data_list[i] = [d.getFullYear(), d.getMonth()] } else { this.m_data_list[i] = this.data_step_month(this.m_data_list[i - 1], 1) } } this.render_month(i, d) } } Calendar.prototype.render_month = function(m_idx, date) { const m_el = this.m_el_list[m_idx] const m_data = this.m_data_list[m_idx] m_el.innerHTML = '' const row_control = document.createElement('div') row_control.classList.add('rh2-calendar-row-control') m_el.appendChild(row_control) const row_control_col_prev = document.createElement('div') row_control_col_prev.classList.add('rh2-calendar-row-control-col-prev') row_control.appendChild(row_control_col_prev) if (m_idx === 0) { row_control_col_prev.addEventListener('click', function(e) { this.go_prev() }.bind(this)) } const row_control_col_name = document.createElement('div') row_control_col_name.classList.add('rh2-calendar-row-control-col-value') row_control_col_name.innerText = this.month_repr_date(this.parse_date(m_data)) + ' ' + m_data[0] row_control.appendChild(row_control_col_name) const row_control_col_next = document.createElement('div') row_control_col_next.classList.add('rh2-calendar-row-control-col-next') row_control.appendChild(row_control_col_next) if (m_idx === this.num_months - 1) { row_control_col_next.addEventListener('click', function(e) { this.go_next() }.bind(this)) } const table = document.createElement('table') table.classList.add('rh2-calendar-month') m_el.appendChild(table) const thead = document.createElement('thead') table.appendChild(thead) const thead_tr = document.createElement('tr') thead.appendChild(thead_tr) const weekdays = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'] for (let i = 0; i < weekdays.length; i++) { const th = document.createElement('th') th.innerText = weekdays[i] thead_tr.appendChild(th) } const tbody = document.createElement('tbody') table.appendChild(tbody) let tr = null const d_upper = this.parse_date(this.data_step_month(m_data, +1)) //let d = new Date(m_data + "T00:00:00Z") let d = new Date(this.parse_date(m_data).getTime()) while (true) { if (d >= d_upper) { break } if (tr === null) { tr = document.createElement('tr') tbody.appendChild(tr) } if (d.getDate() == 1 && d.getDay() !== 1) { for (let i = 0; i < (d.getDay() - 1 + 7) % 7; i++) { const td = document.createElement('td') tr.appendChild(td) } } const td = document.createElement('td') td.innerText = d.getDate() let td_class = 'rh2-calendar-selectable' if (this.min_date && d < this.min_date) { td_class = 'rh2-calendar-unselectable' } if (this.max_date && this.max_date < d) { td_class = 'rh2-calendar-unselectable' } td.classList.add(td_class) d_str = d.toISOString().substring(0, 10) let is_closed = this.dates_closed.indexOf(d_str) > -1 if (this.dates_m.has(d_str) && !is_closed) { const promotion_idx_ar = this.dates_m.get(d_str) let has_promotions = false let has_promotions_hd = false for (let idx of promotion_idx_ar) { let promo = this.promotions[idx] if (promo) { if (promo.structure == 'TABLE_DISCOUNT_HOT_DEAL') { // to show as separate blue star has_promotions_hd = true } else { // any other specials, old pink star has_promotions = true } } } if (has_promotions) { let star = document.createElement('div') star.classList.add('rh2-calendar-date-star') if (!has_promotions_hd) { // center single star star.style = 'margin-left: -5px' } td.appendChild(star) } if (has_promotions_hd) { star = document.createElement('div') star.classList.add('rh2-calendar-date-star-hd') if (!has_promotions) { // center single star star.style = 'margin-left: -5px' } td.appendChild(star) } if (promotion_idx_ar.indexOf(this.special_idx) > -1) { td.classList.add('rh2-calendar-date-highlight') } } if (this.date && (this.format_date(this.date) === this.format_date(d))) { td.classList.add('rh2-calendar-selected') } td.setAttribute('data-rh2-calendar-date', this.format_date(d)) td.addEventListener('click', function(e) { const t = e.currentTarget if (t.classList.contains('rh2-calendar-unselectable')) { return } const value = t.getAttribute('data-rh2-calendar-date') //const d = this.parse_date(t.getAttribute('data-rh2-calendar-date')) const tds = this.container_el.getElementsByTagName('td') for (let i = 0; i < tds.length; i++) { const td = tds[i] td.classList.remove('rh2-calendar-selected') //if (td.classList.contains('rh2-calendar-selected')) } t.classList.add('rh2-calendar-selected') if (this.onselect != null) { const datestr_nz = value.substring(8, 10) + "/" + value.substring(5, 7) + "/" + value.substring(0, 4) this.onselect.call(this, value, datestr_nz) } }.bind(this)) tr.appendChild(td) if (d.getDay() === 0) { tr = null } d = new Date(d.getTime() + 86400000) } } Calendar.prototype.go_prev = function() { for (let i = 0; i < this.num_months; i++) { this.m_data_list[i] = this.data_step_month(this.m_data_list[i], -1) } this.render_date() } Calendar.prototype.go_next = function() { for (let i = 0; i < this.num_months; i++) { this.m_data_list[i] = this.data_step_month(this.m_data_list[i], +1) } this.render_date() } Calendar.prototype.data_step_month = function(data, direction) { const _data = [data[0], data[1]] if (direction >= 0) { _data[1] += 1 if (_data[1] > 11) { _data[0] += 1 _data[1] = 0 } } else if (direction < 0) { _data[1] -= 1 if (_data[1] < 0) { _data[0] -= 1 _data[1] = 11 } } return _data } Calendar.prototype.parse_date = function(d) { let date = null if (typeof d === 'string') { let mo_yyyymmdd = d.match(/(\d{4})-(\d{2})-(\d{2})/) if (mo_yyyymmdd) { date = new Date(d + "T00:00:00Z") } let mo_ddmmyyyy = d.match(/(\d{2})\/(\d{2})\/(\d{4})/) if (mo_ddmmyyyy) { let yyyymmdd = [ mo_ddmmyyyy[3], mo_ddmmyyyy[2], mo_ddmmyyyy[1], ].join('-') date = new Date(yyyymmdd + "T00:00:00Z") } } else if (Array.isArray(d)) { if (d.length === 1) { date = new Date(d[0] + "-01-01T00:00:00Z") } else if (d.length === 2) { date = new Date(d[0] + "-" + this.zero_pad(d[1] + 1) + "-01T00:00:00Z") } else if (d.length === 3) { date = new Date(d[0] + "-" + this.zero_pad(d[1] + 1) + this.zero_pad(d[2]) + "T00:00:00Z") } } else { date = new Date(d.getFullYear() + "-" + this.zero_pad(d.getMonth() + 1) + +this.zero_pad(d.getDate()) + "T00:00:00Z") } return date } Calendar.prototype.format_date = function(d) { let month = "" + (d.getMonth() + 1) if (month.length < 2) { month = "0" + month } let date = "" + d.getDate() if (date.length < 2) { date = "0" + date } //return date + "/" + month + "/" + d.getFullYear() return d.getFullYear() + "-" + month + "-" + date } window.rh2.Calendar = Calendar })()</script> <script>// #Footer ; (function() { const Footer = {} const CONSUMER_APP_ANDROID_LOCATION = "https://play.google.com/store/apps/details?id=nz.co.restauranthub.restauranthub_nz_app" const CONSUMER_APP_IOS_LOCATION = "https://apps.apple.com/nz/app/restauranthub-nz/id1485078335" const MERCHANT_APP_ANDROID_LOCATION = "https://play.google.com/store/apps/details?id=nz.co.restauranthub.rhnz_merchant_android" const MERCHANT_APP_IOS_LOCATION = "https://apps.apple.com/nz/app/restauranthub-nz/id1518384302" Footer.cfg = { 'CONSUMER_APP_ANDROID_LOCATION': CONSUMER_APP_ANDROID_LOCATION, 'CONSUMER_APP_IOS_LOCATION': CONSUMER_APP_IOS_LOCATION, 'MERCHANT_APP_ANDROID_LOCATION': MERCHANT_APP_ANDROID_LOCATION, 'MERCHANT_APP_IOS_LOCATION': MERCHANT_APP_IOS_LOCATION, } Footer.build = function() { const footer = document.createElement('div') const footer_fw_row_0_el = document.createElement('div') footer_fw_row_0_el.classList.add('rh2-row-fw') footer.appendChild(footer_fw_row_0_el) const footer_row_0_el = document.createElement('div') footer_row_0_el.classList.add('rh2-row-pw') footer_row_0_el.classList.add('rh2-home-footer-row-0') footer_fw_row_0_el.appendChild(footer_row_0_el) const footer_row_0_col_0_el = document.createElement('div') footer_row_0_col_0_el.classList.add('rh2-col') footer_row_0_col_0_el.classList.add('rh2-w-8') footer_row_0_col_0_el.classList.add('rh2-w-O-s') footer_row_0_el.appendChild(footer_row_0_col_0_el) const footer_row_0_col_0_heading_el = document.createElement('div') footer_row_0_col_0_heading_el.classList.add('rh2-home-footer-heading') footer_row_0_col_0_heading_el.innerText = 'Restaurant Hub' footer_row_0_col_0_el.appendChild(footer_row_0_col_0_heading_el) let div_a = document.createElement('div') const footer_row_0_col_0_row_0_el = document.createElement('a') footer_row_0_col_0_row_0_el.innerText = 'About Us' footer_row_0_col_0_row_0_el.setAttribute('href', '/about-restaurant-hub/about-us/') div_a.appendChild(footer_row_0_col_0_row_0_el) footer_row_0_col_0_el.appendChild(div_a) div_a = document.createElement('div') const footer_row_0_col_0_row_3_el = document.createElement('a') footer_row_0_col_0_row_3_el.innerText = 'Contact Us' footer_row_0_col_0_row_3_el.setAttribute('href', '/about-restaurant-hub/contact-us/') div_a.appendChild(footer_row_0_col_0_row_3_el) footer_row_0_col_0_el.appendChild(div_a) const footer_row_0_col_1_el = document.createElement('div') footer_row_0_col_1_el.classList.add('rh2-col') footer_row_0_col_1_el.classList.add('rh2-w-8') footer_row_0_col_1_el.classList.add('rh2-w-O-s') footer_row_0_el.appendChild(footer_row_0_col_1_el) const footer_row_0_col_1_heading_el = document.createElement('div') footer_row_0_col_1_heading_el.classList.add('rh2-home-footer-heading') footer_row_0_col_1_heading_el.innerText = 'Diners' footer_row_0_col_1_el.appendChild(footer_row_0_col_1_heading_el) div_a = document.createElement('div') const footer_row_0_col_1_row_0_el = document.createElement('a') footer_row_0_col_1_row_0_el.innerText = 'Booking Your Restaurant' footer_row_0_col_1_row_0_el.setAttribute('href', '/for-diners/booking-your-restaurant/') div_a.appendChild(footer_row_0_col_1_row_0_el) footer_row_0_col_1_el.appendChild(div_a) div_a = document.createElement('div') const footer_row_0_col_1_row_1_el = document.createElement('a') footer_row_0_col_1_row_1_el.innerText = 'FAQ' footer_row_0_col_1_row_1_el.setAttribute('href', '/for-diners/FAQs/') div_a.appendChild(footer_row_0_col_1_row_1_el) footer_row_0_col_1_el.appendChild(div_a) const footer_row_0_col_1_row_2_el = document.createElement('div') footer_row_0_col_1_row_2_el.innerText = 'Consumer Apps' footer_row_0_col_1_el.appendChild(footer_row_0_col_1_row_2_el) div_a = document.createElement('div') const consumer_app_android = document.createElement('a') consumer_app_android.classList.add('rh2-home-consumer-app-android') consumer_app_android.setAttribute('href', this.cfg['CONSUMER_APP_ANDROID_LOCATION']) consumer_app_android.setAttribute('target', '_blank') div_a.appendChild(consumer_app_android) footer_row_0_col_1_row_2_el.appendChild(div_a) const consumer_app_android_img = document.createElement('div') consumer_app_android_img.classList.add('rh2-home-consumer-app-android-img') consumer_app_android.appendChild(consumer_app_android_img) div_a = document.createElement('div') const consumer_app_ios = document.createElement('a') consumer_app_ios.classList.add('rh2-home-consumer-app-ios') consumer_app_ios.setAttribute('href', this.cfg['CONSUMER_APP_IOS_LOCATION']) consumer_app_ios.setAttribute('target', '_blank') div_a.appendChild(consumer_app_ios) footer_row_0_col_1_row_2_el.appendChild(div_a) const consumer_app_ios_img = document.createElement('div') consumer_app_ios_img.classList.add('rh2-home-consumer-app-ios-img') consumer_app_ios.appendChild(consumer_app_ios_img) const footer_row_0_col_2_el = document.createElement('div') footer_row_0_col_2_el.classList.add('rh2-col') footer_row_0_col_2_el.classList.add('rh2-w-8') footer_row_0_col_2_el.classList.add('rh2-w-O-s') footer_row_0_el.appendChild(footer_row_0_col_2_el) const footer_row_0_col_2_heading_el = document.createElement('div') footer_row_0_col_2_heading_el.classList.add('rh2-home-footer-heading') footer_row_0_col_2_heading_el.innerText = 'Restaurateurs' footer_row_0_col_2_el.appendChild(footer_row_0_col_2_heading_el) div_a = document.createElement('div') const link_join = document.createElement('a') link_join.innerText = 'Joining Restaurant Hub' link_join.setAttribute('href', '/for-restaurants/joining-restaurant-hub/') div_a.appendChild(link_join) footer_row_0_col_2_el.appendChild(div_a) div_a = document.createElement('div') const link_merchant = document.createElement('a') link_merchant.innerText = 'Merchant Center Dashboard' link_merchant.setAttribute('href', '/rh2/merchant/') div_a.appendChild(link_merchant) footer_row_0_col_2_el.appendChild(div_a) div_a = document.createElement('div') const link_merchant_support = document.createElement('a') link_merchant_support.innerText = 'Merchant Help Center' link_merchant_support.setAttribute('href', 'https://support.eveve.co.nz/knowledge') link_merchant_support.setAttribute('target', '_blank') div_a.appendChild(link_merchant_support) footer_row_0_col_2_el.appendChild(div_a) div_a = document.createElement('div') const link_products = document.createElement('a') link_products.innerText = 'Our Products' link_products.setAttribute('href', '/for-restaurants/our-products/') div_a.appendChild(link_products) footer_row_0_col_2_el.appendChild(div_a) div_a = document.createElement('div') const link_partners = document.createElement('a') link_partners.innerText = 'Our Partners' link_partners.setAttribute('href', '/for-restaurants/our-partners/') div_a.appendChild(link_partners) footer_row_0_col_2_el.appendChild(div_a) const footer_row_0_col_2_row_4_el = document.createElement('div') footer_row_0_col_2_row_4_el.innerText = 'Merchant Apps' footer_row_0_col_2_el.appendChild(footer_row_0_col_2_row_4_el) div_a = document.createElement('div') const merchant_app_android = document.createElement('a') merchant_app_android.classList.add('rh2-home-merchant-app-android') merchant_app_android.setAttribute('href', this.cfg['MERCHANT_APP_ANDROID_LOCATION']) merchant_app_android.setAttribute('target', '_blank') div_a.appendChild(merchant_app_android) footer_row_0_col_2_row_4_el.appendChild(div_a) const merchant_app_android_img = document.createElement('div') merchant_app_android_img.classList.add('rh2-home-merchant-app-android-img') merchant_app_android.appendChild(merchant_app_android_img) div_a = document.createElement('div') const merchant_app_ios = document.createElement('a') merchant_app_ios.classList.add('rh2-home-merchant-app-ios') merchant_app_ios.setAttribute('href', this.cfg['MERCHANT_APP_IOS_LOCATION']) merchant_app_ios.setAttribute('target', '_blank') div_a.appendChild(merchant_app_ios) footer_row_0_col_2_row_4_el.appendChild(div_a) const merchant_app_ios_img = document.createElement('div') merchant_app_ios_img.classList.add('rh2-home-merchant-app-ios-img') merchant_app_ios.appendChild(merchant_app_ios_img) // const footer_row_0_col_3_el = document.createElement('div') // footer_row_0_col_3_el.classList.add('rh2-col') // footer_row_0_col_3_el.classList.add('rh2-w-8') // footer_row_0_col_3_el.classList.add('rh2-w-O-s') // footer_row_0_el.appendChild(footer_row_0_col_3_el) // const footer_row_0_col_3_heading_el = document.createElement('div') // footer_row_0_col_3_heading_el.classList.add('rh2-home-footer-heading') // footer_row_0_col_3_heading_el.innerText = 'Partners' // footer_row_0_col_3_el.appendChild(footer_row_0_col_3_heading_el) // const footer_row_0_col_3_row_0_el = document.createElement('a') // footer_row_0_col_3_row_0_el.innerText = 'Eveve' // footer_row_0_col_3_row_0_el.setAttribute('href', 'http://eveve.co.nz/') // footer_row_0_col_3_el.appendChild(footer_row_0_col_3_row_0_el) // const footer_row_0_col_3_row_1_el = document.createElement('a') // footer_row_0_col_3_row_1_el.innerText = 'Restaurant NZ' // footer_row_0_col_3_row_1_el.setAttribute('href', 'http://www.restaurantnz.co.nz/') // footer_row_0_col_3_el.appendChild(footer_row_0_col_3_row_1_el) // const footer_row_0_col_3_row_2_el = document.createElement('a') // footer_row_0_col_3_row_2_el.innerText = 'Hospitality NZ' // footer_row_0_col_3_row_2_el.setAttribute('href', 'http://www.hospitalitynz.org.nz/') // footer_row_0_col_3_el.appendChild(footer_row_0_col_3_row_2_el) const footer_fw_row_1_el = document.createElement('div') footer_fw_row_1_el.classList.add('rh2-row-fw') footer_fw_row_1_el.classList.add('rh2-home-footer-row-1') footer_fw_row_1_el.innerText = 'Restaurant Hub provides a fast and convenient way to find and book instantly confirmed tables at New Zealand’s most popular and buzziest restaurants.' footer.appendChild(footer_fw_row_1_el) const footer_fw_row_2_el = document.createElement('div') footer_fw_row_2_el.classList.add('rh2-row-fw') footer_fw_row_2_el.classList.add('rh2-home-footer-row-2') footer.appendChild(footer_fw_row_2_el) const footer_row_2_col_0_el = document.createElement('a') footer_row_2_col_0_el.innerText = '© Restaurant Hub NZ Ltd.' footer_fw_row_2_el.appendChild(footer_row_2_col_0_el) const footer_row_2_col_1_el = document.createElement('a') footer_row_2_col_1_el.innerText = 'Terms and Conditions' footer_row_2_col_1_el.setAttribute('href', '/terms-and-conditions/') footer_fw_row_2_el.appendChild(footer_row_2_col_1_el) const footer_row_2_col_2_el = document.createElement('a') footer_row_2_col_2_el.innerText = 'Privacy Policy' footer_row_2_col_2_el.setAttribute('href', '/privacy-policy/') footer_fw_row_2_el.appendChild(footer_row_2_col_2_el) if (!navigator.userAgent.match(/median/i)) { const footer_row_2_col_3_el = document.createElement('a') footer_row_2_col_3_el.innerText = 'Sitemap' footer_row_2_col_3_el.setAttribute('href', '/sitemap.xml') footer_fw_row_2_el.appendChild(footer_row_2_col_3_el) } // maintenance warning const m_text = rh2.config.maintenance_message || '' const m_seen = get_cookie('maintenance') if (m_text && !m_seen) { const mwarning = el('div') mwarning.classList.add('rh2-maintenance-warning') mwarning.innerText = m_text const mwarning_close = el('span') mwarning_close.innerText = 'x' mwarning_close.classList.add('close') mwarning.appendChild(mwarning_close) $(mwarning_close).click(() => { $(mwarning).remove() set_cookie('maintenance', true, 120) }) footer.appendChild(mwarning) } return footer } rh2.Footer = Footer })()</script> <script>// # Promotion ; (function() { const Promotion = {} Promotion.prices_hd = { 50: 300, 40: 300, 30: 200, } Promotion.get_price_hd = function(promotion) { if (!promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { return 0 } let price = Promotion.prices_hd[promotion.value_int_0] price = price / 100 return price } Promotion.get_promotion_type = function(promotion) { let promotion_type = '' if (promotion['structure'] == 'TABLE_UPGRADE') { promotion_type = 'Table: Upgrade' } else if (promotion['structure'] == 'TABLE_DISCOUNT_RECURRING') { promotion_type = 'Table: Dynamic Pricing' } else if (promotion['structure'] == 'TABLE_DISCOUNT_FLASHSALE') { promotion_type = 'Table: Flash Sale' } else if (promotion['structure'] == 'TABLE_DISCOUNT_HOT_DEAL') { promotion_type = 'Table: Hot Deal' } else if (promotion['structure'] == 'DISH_DISCOUNT') { promotion_type = 'Item: Special / Combo' } else if (promotion['structure'] == 'DISH_COMPLIMENTARY') { promotion_type = 'Item: Complimentary' } else if (promotion['structure'] == 'DISH_BxGyF') { promotion_type = 'Item: Buy 1 Get 1 Free' } else if (promotion['structure'] == 'DISH_STARSPECIAL') { promotion_type = 'Set Menus / Degustation' } return promotion_type } Promotion.get_promotion_title = function(promotion) { let title = '' if (promotion['structure'] == 'TABLE_UPGRADE') { let manifestation_part = '' if (promotion['manifestation'] == 'EVEVE') { manifestation_part = 'Booking' } else if (promotion['manifestation'] == 'COUPON') { manifestation_part = 'Takeaway' } const expr_spend = rh2.utils.currency_value_to_expr(promotion['value_int_0']) const expr_get = rh2.utils.currency_value_to_expr(promotion['value_int_1']) title = [ 'Upgrade your ', manifestation_part, ': Spend $', expr_spend.substring(0, expr_spend.length - 3), ' & Get $', expr_get.substring(0, expr_get.length - 3), ' Value' ].join('') } else if (['TABLE_DISCOUNT_RECURRING', 'TABLE_DISCOUNT_HOT_DEAL'].indexOf(promotion['structure']) > -1) { if (!promotion.value_str_0 || promotion.value_str_0 == 'Food Bill') { title = promotion['value_int_0'] + '% discount on Food Bill' } else { title = promotion.value_str_0 } } else if (promotion['structure'] == 'TABLE_DISCOUNT_FLASHSALE') { title = promotion['value_int_0'] + '% discount on ' + promotion['value_str_0'] } else if (promotion['structure'] == 'DISH_DISCOUNT') { title = promotion['value_str_0'] } else if (promotion['structure'] == 'DISH_COMPLIMENTARY') { title = promotion['value_str_0'] } else if (promotion['structure'] == 'DISH_BxGyF') { title = promotion['value_str_0'] } else if (promotion['structure'] == 'DISH_STARSPECIAL') { title = promotion['value_str_0'] } return title } Promotion.get_promotion_ordering_text = function(promotion) { let text = 'Position: ' + promotion.ordering return text } Promotion.get_promotion_image_url = function(promotion) { let image_url = '/rh2/service/merchant/restaurant/cloudfile-get/' + promotion['image_0'] if (promotion['image_0'] == '') { let folder = 'special' if (promotion['manifestation'] == 'COUPON') { folder = 'coupon' } if (promotion['structure'] == 'TABLE_UPGRADE') { const upgrade_pctg = promotion['value_int_2'] image_url = '/rh2/static/image/rh/' + folder + '/Upgrade_' + upgrade_pctg + '.png' } else if (promotion['structure'].indexOf('TABLE_') == 0) { image_url = '/rh2/static/image/rh/' + folder + '/DynamicPricing' image_url += '_' + promotion['value_int_0'] if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { image_url += '_HotDeal' } else if (promotion['value_str_0'] == 'Food Bill') { image_url += '_FoodOnly' } else { image_url += '_FoodAndDrink' } image_url += '.png' } else if (promotion['structure'] == 'DISH_DISCOUNT') { image_url = '/rh2/static/image/rh/' + folder + '/DishDiscount.png' } else if (promotion['structure'] == 'DISH_COMPLIMENTARY') { image_url = '/rh2/static/image/rh/' + folder + '/DishComplimentary.png' } else if (promotion['structure'] == 'DISH_BxGyF') { image_url = '/rh2/static/image/rh/' + folder + '/DishB1G1F.png' } else if (promotion['structure'] == 'DISH_STARSPECIAL') { image_url = '/rh2/static/image/rh/' + folder + '/SetMenu.png' } } return image_url } Promotion.get_schedule_sentence = function(schedule) { if (schedule.custom_text > '') { return schedule.custom_text } const parts = [] { const time_begin = schedule['time_begin'].substring(0, 5) const time_end = schedule['time_end'].substring(0, 5) if (time_begin != '00:00' || time_end != '23:30') { if (time_begin != time_end) { parts.push(time_begin + '-' + time_end) } else { parts.push(time_begin) } } } { const days = schedule['date_days_of_week'].split(',') parts.push(days.join(',')) //if (days.length > 0 && days.length < 7) { //} } { const format_datestr = function(datestr) { return [datestr.substring(8, 10), datestr.substring(5, 7), datestr.substring(0, 4)].join('/') } const date_begin_formatted = format_datestr(schedule['date_begin']) const date_end_formatted = format_datestr(schedule['date_end']) const current_date_str = (new Date()).toISOString().substring(0, 10) const remote_future_str = (new Date((new Date()).getTime() + 86400000 * 180)).toISOString().substring(0, 10) const date_begin_in_past = schedule['date_begin'] <= current_date_str const date_begin_in_future = schedule['date_begin'] > current_date_str const date_end_in_past = schedule['date_end'] <= current_date_str const date_end_in_future = schedule['date_end'] > current_date_str const date_end_in_remote_future = schedule['date_end'] > remote_future_str if (date_begin_in_future) { if (date_end_in_remote_future) { parts.push('from ' + date_begin_formatted) } else { parts.push(date_begin_formatted + ' to ' + date_end_formatted) } } else { if (date_end_in_remote_future) {} else { parts.push('until ' + date_end_formatted) } } } return parts.join(' ') } Promotion.is_promotion_pax_limited = function(promotion) { // coupons - no limit if (promotion.manifestation !== 'EVEVE') { return false } // table upgrade / dynamic pricing if (promotion.structure.indexOf('TABLE_') == 0) { return true } // set menu if (promotion.structure == 'DISH_STARSPECIAL') { return true } // other specials (DISH_) return false } rh2.Promotion = Promotion })()</script> <script>// # Special ; (function() { const Special = {} Special.call_service_special_item = function(promotion_id, on_success) { let url = '/rh2/service/promotion/promotion_item_get/' + promotion_id + '/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText if (e.target.status == 200) { const resp = JSON.parse(s) //console.log(resp) if (on_success != undefined) { on_success(resp) } } }.bind(this)) xhr.open("GET", url) xhr.send() } Special.render_card_for_business_item_page = function(promotion, schedules, business, fragment) { let special_booking_url = '' { const pairs = [ ['special', promotion.uuid] ] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') special_booking_url = business['item_page_url'] + 'booking/' if (querystring) { special_booking_url += '?' + querystring } } const promotion_title = rh2.Promotion.get_promotion_title(promotion) const promotion_el = document.createElement('div') if (rh2.utils.is_desktop()) { promotion_el.classList.add('rh2-business-item-special-card-desktop') } else { promotion_el.classList.add('rh2-business-item-special-card-mobile') } promotion_el.setAttribute('id', promotion.uuid) let image_url = rh2.Promotion.get_promotion_image_url(promotion) const part_image = document.createElement('div') if (rh2.utils.is_desktop()) { part_image.classList.add('rh2-business-item-special-card-part-image-desktop') image_url += '/imgproc-resizecrop=240,240/' } else { part_image.classList.add('rh2-business-item-special-card-part-image-mobile') image_url += '/imgproc-resizecrop=400,400/' } promotion_el.appendChild(part_image) const part_image_image = document.createElement('div') part_image_image.classList.add('rh2-business-item-special-card-part-image-image') part_image.appendChild(part_image_image) part_image_image.style['background-image'] = "url('" + image_url + "')" const domain = document.location.origin const share_url = domain + business.item_page_url + '?special=' + promotion.uuid const share_image = domain + image_url const share_title = promotion_title const share_text = promotion.description.split('\n')[0] const part_text = document.createElement('div') if (rh2.utils.is_desktop()) { part_text.classList.add('rh2-business-item-special-card-part-text-desktop') } else { part_text.classList.add('rh2-business-item-special-card-part-text-mobile') } promotion_el.appendChild(part_text) const row_title = document.createElement('a') row_title.classList.add('rh2-business-item-special-card-row-title') row_title.setAttribute('href', special_booking_url) part_text.appendChild(row_title) row_title.innerText = promotion_title const section_description = document.createElement('div') section_description.classList.add('rh2-business-item-special-card-section-description') section_description.innerText = promotion['description'] part_text.appendChild(section_description) const tc_details = el('div') tc_details.classList.add('rh2-business-list-special-card-section-details') if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { const section_hotdeal_price = document.createElement('div') section_hotdeal_price.classList.add('rh2-business-item-special-card-row-condition-0') section_hotdeal_price.innerText = 'Booking fee $' + rh2.Promotion.get_price_hd(promotion) + ' NZD per person' tc_details.appendChild(section_hotdeal_price) } const section_schedule = document.createElement('div') section_schedule.classList.add('rh2-business-item-special-card-section-schedule') tc_details.appendChild(section_schedule) if (promotion.schedule_text) { for (let line of promotion.schedule_text.split('\n')) { const schedule_el = document.createElement('div') schedule_el.innerText = line section_schedule.appendChild(schedule_el) } } else { const schedule_sentence_ar = [] for (let i = 0; i < schedules.length; i++) { const schedule = schedules[i] const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) schedule_sentence_ar.push(schedule_sentence) } schedule_sentence_ar.sort(function(a, b) { if (a.indexOf('Mon') > -1) return -3 if (a.indexOf('Tue') > -1) return -2 if (a.indexOf('Wed') > -1) return -1 if (a.indexOf('Thu') > -1) return 0 if (a.indexOf('Fri') > -1) return 1 if (a.indexOf('Sat') > -1) return 2 if (a.indexOf('Sun') > -1) return 3 }) for (let schedule_sentence of schedule_sentence_ar) { const schedule_el = document.createElement('div') schedule_sentence = schedule_sentence.replace('Sun,Mon,Tue,Wed,Thu,Fri,Sat', 'Daily') schedule_sentence = schedule_sentence.replace('Mon,Tue,Wed,Thu,Fri,Sat,Sun', 'Daily') schedule_el.innerText = schedule_sentence section_schedule.appendChild(schedule_el) } } const details_conditions = document.createElement('div') details_conditions.classList.add('rh2-business-list-special-card-section-details-conditions') tc_details.appendChild(details_conditions) const row_condition_0 = document.createElement('div') row_condition_0.classList.add('rh2-business-item-special-card-row-condition-0') row_condition_0.innerHTML = `* Not to be used in conjunction with any other offer.<br> * Excludes public holidays and special dates.<br>` if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { row_condition_0.innerHTML += '* Booking Fee is non refundable.<br>' } row_condition_0.innerHTML += '* Dine-in ONLY. Booking is essential.' details_conditions.appendChild(row_condition_0) const row_condition_1 = document.createElement('div') row_condition_1.classList.add('rh2-business-item-special-card-row-condition-1') row_condition_1.innerText = promotion['value_str_1'] != '' ? "* " + promotion['value_str_1'] : '' details_conditions.appendChild(row_condition_1) const row_condition_2 = document.createElement('div') row_condition_2.classList.add('rh2-business-item-special-card-row-condition-2') row_condition_2.innerText = promotion['value_str_2'] != '' ? "* " + promotion['value_str_2'] : '' details_conditions.appendChild(row_condition_2) part_text.appendChild(tc_details) const bottom_row = document.createElement('div') bottom_row.classList.add('rh2-business-item-special-card-bottom-row') part_text.appendChild(bottom_row) const details_button = document.createElement('span') details_button.innerText = 'See more' details_button.classList.add('rh2-business-list-special-card-details-button') bottom_row.appendChild(details_button) $(details_button).on('click', (event) => { let $btn = $(details_button) let card_class = rh2.utils.is_desktop() ? '.rh2-business-item-special-card-desktop' : '.rh2-business-item-special-card-mobile' let $card = $btn.parents(card_class) $card.toggleClass('open') let is_open = $card.hasClass('open') let text = is_open ? 'See less' : 'See more' $btn.text(text) }) const share = function(share_url, share_title, share_text) { try { if (navigator.share) { navigator.share({ url: share_url }) } else if (navigator.clipboard) { navigator.clipboard.writeText(share_url) share_btn.innerText = 'Copied' $(share_btn).blink('lightgreen', 1500) setTimeout(() => { share_btn.innerText = 'Share' }, 1500) } else { alert('Share / Clipboard functionality unavailable.') } } catch (err) { console.error(err.name, err.message) } } const share_btn = document.createElement('div') share_btn.classList.add('rh2-business-item-share') share_btn.innerText = 'Share' bottom_row.appendChild(share_btn) share_btn.addEventListener('click', () => { share(share_url, share_title, share_text) }) if (business.bookable) { const pairs = [ ['special', promotion.uuid] ] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') let booking_url = business['item_page_url'] + 'booking/' if (querystring) { booking_url += '?' + querystring } const book_button = document.createElement('a') book_button.setAttribute('href', booking_url) book_button.classList.add('rh2-business-item-special-card-book-button') if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { book_button.innerText = 'Book this Hot Deal' book_button.classList.add('special-hd') } else { book_button.innerText = 'Book this Special' } bottom_row.appendChild(book_button) } return promotion_el } Special.render_card_for_business_list_page = function(promotion, business, fragment) { const is_hot_deal = promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL' const schedules = promotion['schedules'] let special_item_page_url = business['item_page_url'] { const pairs = [ ['special', promotion.uuid] ] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') special_item_page_url += '?' + querystring } const promotion_el = document.createElement('div') if (rh2.utils.is_desktop()) { promotion_el.classList.add('rh2-business-list-special-card-desktop') } else { promotion_el.classList.add('rh2-business-list-special-card-mobile') } const part_image = document.createElement('div') if (rh2.utils.is_desktop()) { part_image.classList.add('rh2-business-list-special-card-part-image-desktop') } else { part_image.classList.add('rh2-business-list-special-card-part-image-mobile') } promotion_el.appendChild(part_image) const part_image_image = document.createElement('a') part_image_image.classList.add('rh2-business-list-special-card-part-image-image') part_image_image.setAttribute('href', special_item_page_url) part_image.appendChild(part_image_image) let image_url = rh2.Promotion.get_promotion_image_url(promotion) if (image_url.match('/cloudfile-get/')) { image_url += '/imgproc-resizecrop=200,200/' } part_image_image.style['background-image'] = "url('" + image_url + "')" const part_text = document.createElement('div') if (rh2.utils.is_desktop()) { part_text.classList.add('rh2-business-list-special-card-part-text-desktop') } else { part_text.classList.add('rh2-business-list-special-card-part-text-mobile') } promotion_el.appendChild(part_text) const row_title = document.createElement('a') row_title.classList.add('rh2-business-list-special-card-row-title') row_title.setAttribute('href', special_item_page_url) part_text.appendChild(row_title) const promotion_title = rh2.Promotion.get_promotion_title(promotion) row_title.innerText = promotion_title if (is_hot_deal) { const section_hotdeal_price = document.createElement('div') section_hotdeal_price.classList.add('rh2-business-list-special-card-section-hotdeal-price') section_hotdeal_price.innerText = 'Booking fee $' + rh2.Promotion.get_price_hd(promotion) + ' NZD per person' part_text.appendChild(section_hotdeal_price) } const section_schedule = document.createElement('div') section_schedule.classList.add('rh2-business-list-special-card-section-schedule') part_text.appendChild(section_schedule) if (promotion.schedule_text) { for (let line of promotion.schedule_text.split('\n')) { const schedule_el = document.createElement('div') schedule_el.innerText = line section_schedule.appendChild(schedule_el) } } else { const schedule_sentence_ar = [] for (let i = 0; i < schedules.length; i++) { const schedule = schedules[i] const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) schedule_sentence_ar.push(schedule_sentence) } schedule_sentence_ar.sort(function(a, b) { if (a.indexOf('Mon') > -1) return -3 if (a.indexOf('Tue') > -1) return -2 if (a.indexOf('Wed') > -1) return -1 if (a.indexOf('Thu') > -1) return 0 if (a.indexOf('Fri') > -1) return 1 if (a.indexOf('Sat') > -1) return 2 if (a.indexOf('Sun') > -1) return 3 }) for (let schedule_sentence of schedule_sentence_ar) { const schedule_el = document.createElement('div') schedule_sentence = schedule_sentence.replace('Sun,Mon,Tue,Wed,Thu,Fri,Sat', 'Daily') schedule_sentence = schedule_sentence.replace('Mon,Tue,Wed,Thu,Fri,Sat,Sun', 'Daily') schedule_el.innerText = schedule_sentence section_schedule.appendChild(schedule_el) } } const section_business = document.createElement('div') section_business.classList.add('rh2-business-list-special-card-section-business') part_text.appendChild(section_business) const business_name_row = document.createElement('a') business_name_row.classList.add('rh2-business-list-special-card-section-business-name-row') business_name_row.setAttribute('href', business['item_page_url']) business_name_row.innerText = business['name'] section_business.appendChild(business_name_row) const business_attr_row_0 = document.createElement('div') business_attr_row_0.classList.add('rh2-business-list-special-card-section-business-attr-row-0') section_business.appendChild(business_attr_row_0) const business_attr_row_1 = document.createElement('div') business_attr_row_1.classList.add('rh2-business-list-special-card-section-business-attr-row-1') section_business.appendChild(business_attr_row_1) if (business['ta_rating'] && business['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-list-special-card-section-business-attr-row-0-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + business['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") business_attr_row_0.appendChild(ta_image_el) } let cuisine_ar = [] for (let i = 0; i < 3; i++) { const cuisine_val = business['cuisine_vals'][i] if (cuisine_val == undefined) { continue } cuisine_ar.push(cuisine_val) } const cuisine_text = cuisine_ar.join(' · ') const business_cuisine = document.createElement('div') business_cuisine.classList.add('rh2-business-list-special-card-section-business-attr-row-0-cuisine') business_cuisine.innerText = cuisine_text business_attr_row_0.appendChild(business_cuisine) if (business['special_count'] && business['special_count'] > 0) { const txt = business['special_count'] + ' ' + (business['special_count'] == 1 ? 'Special' : 'Specials') const span = document.createElement('div') span.classList.add('rh2-business-list-special-card-section-business-attr-row-1-special-count') span.innerText = txt business_attr_row_1.appendChild(span) } if (business['special_hd_count'] && business['special_hd_count'] > 0) { const txt = business['special_hd_count'] + ' ' + (business['special_hd_count'] == 1 ? 'Hot Deal' : 'Hot Deals') const span = document.createElement('div') span.classList.add('rh2-business-list-special-card-section-business-attr-row-1-special-hd-count') span.innerText = txt business_attr_row_1.appendChild(span) } const details_row = document.createElement('div') details_row.classList.add('rh2-business-list-special-card-section-details') part_text.appendChild(details_row) const details_description = document.createElement('div') details_description.classList.add('rh2-business-list-special-card-section-details-description') details_description.innerText = promotion.description details_row.appendChild(details_description) const details_conditions = document.createElement('div') details_conditions.classList.add('rh2-business-list-special-card-section-details-conditions') details_row.appendChild(details_conditions) const row_condition_0 = document.createElement('div') row_condition_0.innerHTML = `* Not to be used in conjunction with any other offer.<br> * Excludes public holidays and special dates.<br>` if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { row_condition_0.innerHTML += '* Booking Fee is non refundable.<br>' } row_condition_0.innerHTML += '* Dine-in ONLY. Booking is essential.' details_conditions.appendChild(row_condition_0) const row_condition_1 = document.createElement('div') row_condition_1.innerText = promotion.value_str_1 ? ('* ' + promotion.value_str_1) : '' details_conditions.appendChild(row_condition_1) const row_condition_2 = document.createElement('div') row_condition_2.innerText = promotion.value_str_2 ? ('* ' + promotion.value_str_2) : '' details_conditions.appendChild(row_condition_2) const buttons_row = document.createElement('div') buttons_row.classList.add('rh2-business-list-special-card-buttons') part_text.appendChild(buttons_row) const details_button = document.createElement('span') details_button.innerText = 'See more' details_button.classList.add('rh2-business-list-special-card-details-button') buttons_row.appendChild(details_button) $(details_button).on('click', (event) => { let $btn = $(details_button) let card_class = rh2.utils.is_desktop() ? '.rh2-business-list-special-card-desktop' : '.rh2-business-list-special-card-mobile' let $card = $btn.parents(card_class) $card.toggleClass('open') let is_open = $card.hasClass('open') let text = is_open ? 'See less' : 'See more' $btn.text(text) }) const pairs = [ ['special', promotion.uuid] ] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') let restaurant_url = business['item_page_url'] if (querystring) { restaurant_url += '?' + querystring } if (fragment.get_name() == 'BusinessList') { const restaurant_button = document.createElement('a') restaurant_button.setAttribute('href', restaurant_url) restaurant_button.classList.add('rh2-business-list-special-card-restaurant-button') restaurant_button.innerText = 'View Restaurant' buttons_row.appendChild(restaurant_button) } let booking_url = business['item_page_url'] + 'booking/' if (querystring) { booking_url += '?' + querystring } const book_button = document.createElement('a') book_button.setAttribute('href', booking_url) book_button.classList.add('rh2-business-list-special-card-book-button') book_button.innerText = 'Book It!' if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { book_button.classList.add('special-hd') } buttons_row.appendChild(book_button) return promotion_el } // not a good idea to separate this for mobile // the code is 95% similar, but there was a difficulty with elements structure // should be a single method for both mobile and desktop, refactor when possible Special.render_card_for_mobile = function(promotion, business, fragment) { const is_hot_deal = promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL' const schedules = promotion['schedules'] let special_item_page_url = business['item_page_url'] { const pairs = [ ['special', promotion.uuid] ] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') special_item_page_url += '?' + querystring } const promotion_el = document.createElement('div') if (rh2.utils.is_desktop()) { promotion_el.classList.add('rh2-business-list-special-card-desktop') } else { promotion_el.classList.add('rh2-business-list-special-card-mobile') } const row_title = document.createElement('a') row_title.classList.add('rh2-business-list-special-card-row-title') row_title.setAttribute('href', special_item_page_url) row_title.innerText = rh2.Promotion.get_promotion_title(promotion) promotion_el.appendChild(row_title) const row_main = el('div') row_main.classList.add('row-main') promotion_el.appendChild(row_main) const part_image = document.createElement('div') if (rh2.utils.is_desktop()) { part_image.classList.add('rh2-business-list-special-card-part-image-desktop') } else { part_image.classList.add('rh2-business-list-special-card-part-image-mobile') } row_main.appendChild(part_image) const part_image_image = document.createElement('a') part_image_image.classList.add('rh2-business-list-special-card-part-image-image') part_image_image.setAttribute('href', special_item_page_url) part_image.appendChild(part_image_image) let image_url = rh2.Promotion.get_promotion_image_url(promotion) if (image_url.match('/cloudfile-get/')) { image_url += '/imgproc-resizecrop=200,200/' } part_image_image.style['background-image'] = "url('" + image_url + "')" const part_info = el('div') part_info.classList.add('rh2-business-list-special-card-part-info') row_main.appendChild(part_info) const part_text = document.createElement('div') if (rh2.utils.is_desktop()) { part_text.classList.add('rh2-business-list-special-card-part-text-desktop') } else { part_text.classList.add('rh2-business-list-special-card-part-text-mobile') } promotion_el.appendChild(part_text) if (is_hot_deal) { const section_hotdeal_price = document.createElement('div') section_hotdeal_price.classList.add('rh2-business-list-special-card-section-hotdeal-price') section_hotdeal_price.innerText = 'Booking fee $' + rh2.Promotion.get_price_hd(promotion) + ' NZD per person' part_info.appendChild(section_hotdeal_price) } const section_schedule = document.createElement('div') section_schedule.classList.add('rh2-business-list-special-card-section-schedule') part_info.appendChild(section_schedule) if (promotion.schedule_text) { for (let line of promotion.schedule_text.split('\n')) { const schedule_el = document.createElement('div') schedule_el.innerText = line section_schedule.appendChild(schedule_el) } } else { const schedule_sentence_ar = [] for (let i = 0; i < schedules.length; i++) { const schedule = schedules[i] const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) schedule_sentence_ar.push(schedule_sentence) } schedule_sentence_ar.sort(function(a, b) { if (a.indexOf('Mon') > -1) return -3 if (a.indexOf('Tue') > -1) return -2 if (a.indexOf('Wed') > -1) return -1 if (a.indexOf('Thu') > -1) return 0 if (a.indexOf('Fri') > -1) return 1 if (a.indexOf('Sat') > -1) return 2 if (a.indexOf('Sun') > -1) return 3 }) for (let schedule_sentence of schedule_sentence_ar) { const schedule_el = document.createElement('div') schedule_sentence = schedule_sentence.replace('Sun,Mon,Tue,Wed,Thu,Fri,Sat', 'Daily') schedule_sentence = schedule_sentence.replace('Mon,Tue,Wed,Thu,Fri,Sat,Sun', 'Daily') schedule_el.innerText = schedule_sentence section_schedule.appendChild(schedule_el) } } const section_business = document.createElement('div') section_business.classList.add('rh2-business-list-special-card-section-business') part_info.appendChild(section_business) const business_name_row = document.createElement('a') business_name_row.classList.add('rh2-business-list-special-card-section-business-name-row') business_name_row.setAttribute('href', business['item_page_url']) business_name_row.innerText = business['name'] section_business.appendChild(business_name_row) const business_attr_row_0 = document.createElement('div') business_attr_row_0.classList.add('rh2-business-list-special-card-section-business-attr-row-0') section_business.appendChild(business_attr_row_0) const business_attr_row_1 = document.createElement('div') business_attr_row_1.classList.add('rh2-business-list-special-card-section-business-attr-row-1') section_business.appendChild(business_attr_row_1) if (business['ta_rating'] && business['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-list-special-card-section-business-attr-row-0-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + business['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") business_attr_row_0.appendChild(ta_image_el) } let cuisine_ar = [] for (let i = 0; i < 3; i++) { const cuisine_val = business['cuisine_vals'][i] if (cuisine_val == undefined) { continue } cuisine_ar.push(cuisine_val) } const cuisine_text = cuisine_ar.join(' · ') const business_cuisine = document.createElement('div') business_cuisine.classList.add('rh2-business-list-special-card-section-business-attr-row-0-cuisine') business_cuisine.innerText = cuisine_text business_attr_row_0.appendChild(business_cuisine) if (business['special_count'] && business['special_count'] > 0) { const txt = business['special_count'] + ' ' + (business['special_count'] == 1 ? 'Special' : 'Specials') const span = document.createElement('div') span.classList.add('rh2-business-list-special-card-section-business-attr-row-1-special-count') span.innerText = txt business_attr_row_1.appendChild(span) } if (business['special_hd_count'] && business['special_hd_count'] > 0) { const txt = business['special_hd_count'] + ' ' + (business['special_hd_count'] == 1 ? 'Hot Deal' : 'Hot Deals') const span = document.createElement('div') span.classList.add('rh2-business-list-special-card-section-business-attr-row-1-special-hd-count') span.innerText = txt business_attr_row_1.appendChild(span) } const details_row = document.createElement('div') details_row.classList.add('rh2-business-list-special-card-section-details') part_text.appendChild(details_row) const details_description = document.createElement('div') details_description.classList.add('rh2-business-list-special-card-section-details-description') details_description.innerText = promotion.description details_row.appendChild(details_description) const details_conditions = document.createElement('div') details_conditions.classList.add('rh2-business-list-special-card-section-details-conditions') details_row.appendChild(details_conditions) const row_condition_0 = document.createElement('div') row_condition_0.innerHTML = `* Not to be used in conjunction with any other offer.<br> * Excludes public holidays and special dates.<br>` if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { row_condition_0.innerHTML += '* Booking Fee is non refundable.<br>' } row_condition_0.innerHTML += '* Dine-in ONLY. Booking is essential.' details_conditions.appendChild(row_condition_0) const row_condition_1 = document.createElement('div') row_condition_1.innerText = promotion.value_str_1 ? ('* ' + promotion.value_str_1) : '' details_conditions.appendChild(row_condition_1) const row_condition_2 = document.createElement('div') row_condition_2.innerText = promotion.value_str_2 ? ('* ' + promotion.value_str_2) : '' details_conditions.appendChild(row_condition_2) const buttons_row = document.createElement('div') buttons_row.classList.add('rh2-business-list-special-card-buttons') part_text.appendChild(buttons_row) const details_button = document.createElement('span') details_button.innerText = 'See more' details_button.classList.add('rh2-business-list-special-card-details-button') buttons_row.appendChild(details_button) $(details_button).on('click', (event) => { let $btn = $(details_button) let card_class = rh2.utils.is_desktop() ? '.rh2-business-list-special-card-desktop' : '.rh2-business-list-special-card-mobile' let $card = $btn.parents(card_class) $card.toggleClass('open') let is_open = $card.hasClass('open') let text = is_open ? 'See less' : 'See more' $btn.text(text) }) const pairs = [ ['special', promotion.uuid] ] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') let restaurant_url = business['item_page_url'] if (querystring) { restaurant_url += '?' + querystring } if (fragment.get_name() == 'BusinessList' && rh2.utils.is_desktop()) { const restaurant_button = document.createElement('a') restaurant_button.setAttribute('href', restaurant_url) restaurant_button.classList.add('rh2-business-list-special-card-restaurant-button') restaurant_button.innerText = 'View Restaurant' buttons_row.appendChild(restaurant_button) } let booking_url = business['item_page_url'] + 'booking/' if (querystring) { booking_url += '?' + querystring } const book_button = document.createElement('a') book_button.setAttribute('href', booking_url) book_button.classList.add('rh2-business-list-special-card-book-button') book_button.innerText = 'Book It!' if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { book_button.classList.add('special-hd') } buttons_row.appendChild(book_button) return promotion_el } rh2.Special = Special })()</script> <script>// # Coupon ; (function() { const Coupon = {} const CouponScheduleStruct = Coupon.CouponScheduleStruct = function() { this.uuid = '' this.is_active = '' this.date_begin = '' this.date_end = '' this.date_days_of_week = '' this.time_begin = '' this.time_end = '' this.quantity_measure = '' this.quantity = '' } CouponScheduleStruct.prototype.decode = function(jstr) { this.uuid = jstr.uuid this.is_active = jstr.is_active this.date_begin = jstr.date_begin this.date_end = jstr.date_end this.date_days_of_week = jstr.date_days_of_week this.time_begin = jstr.time_begin this.time_end = jstr.time_end this.quantity_measure = jstr.quantity_measure this.quantity = jstr.quantity } CouponScheduleStruct.prototype.get_availability_for_date = function(datestr) { let av = true if (this.is_active == false) { av = false } if (this.date_begin > datestr) { av = false } if (this.date_end < datestr) { av = false } let d = new Date(datestr + 'T00:00:00Z') let day_of_week = d.toUTCString().substring(0, 3) if (this.date_days_of_week.split(',').indexOf(day_of_week) == -1) { av = false } return av } CouponScheduleStruct.prototype.get_availability_date_range = function(datestr) { let date_begin = null let date_end = null date_begin = this.date_begin date_end = this.date_end if (this.is_active == false) { date_begin = null date_end = null } if (date_begin == null || date_end == null) { return null } return [date_begin, date_end] } CouponScheduleStruct.prototype.get_available_time_range_for_date = function(datestr) { const av = this.get_availability_for_date(datestr) if (av == false) { return null } return [this.time_begin, this.time_end] } const CouponStruct = Coupon.CouponStruct = function() { this.manifestation = 'COUPON' this.uuid = '' this.is_active = false this.min_pax = 1 this.max_pax = 8 this.structure = '' this.value_int_0 = 0 this.value_int_1 = 0 this.value_int_2 = 0 this.value_str_0 = '' this.value_str_1 = '' this.value_str_2 = '' this.image_0 = '' this.image_1 = '' this.image_2 = '' this.description = '' this.coupon_type = '' this.schedules = [] } CouponStruct.prototype.decode = function(jstr) { this.uuid = jstr.uuid this.is_active = jstr.is_active this.min_pax = jstr.min_pax this.max_pax = jstr.max_pax this.structure = jstr.structure this.value_int_0 = jstr.value_int_0 this.value_int_1 = jstr.value_int_1 this.value_int_2 = jstr.value_int_2 this.value_str_0 = jstr.value_str_0 this.value_str_1 = jstr.value_str_1 this.value_str_2 = jstr.value_str_2 this.image_0 = jstr.image_0 this.image_1 = jstr.image_1 this.image_2 = jstr.image_2 this.description = jstr.description this.coupon_type = jstr.coupon_type for (let schedule_jstr of jstr.schedules) { //console.log('decoding schedule', schedule_jstr) const schedule = new CouponScheduleStruct() schedule.decode(schedule_jstr) this.schedules.push(schedule) } } CouponStruct.prototype.get_availability_ar = function() { const today_str = rh2.utils.get_today_str() const today_d = new Date(today_str + 'T00:00:00Z') const av_ar = [] for (let i = 0; i < 7; i++) { const d = new Date(today_d.getTime() + 86400000 * i) const d_str = d.toISOString().substring(0, 10) const av = this.get_availability_for_date(d_str) av_ar.push([d_str, av]) } return av_ar } CouponStruct.prototype.get_availability_for_date = function(datestr) { let av = false for (let schedule of this.schedules) { let schedule_av = schedule.get_availability_for_date(datestr) av = av || schedule_av if (av === true) { break } } if (this.is_active == false) { return false } return av } CouponStruct.prototype.get_available_schedule_and_time_ranges_for_date = function(datestr) { let schedule = null const ranges = [] for (let _schedule of this.schedules) { const range = _schedule.get_available_time_range_for_date(datestr) if (range != null) { if (schedule == null) { schedule = _schedule } ranges.push(range) } } const rtn = { schedule: schedule, time_ranges: ranges } return rtn } CouponStruct.prototype.get_availability_date_ranges = function(today_datestr) { const cutoff_datestr = new Date(new Date(today_datestr + 'T00:00:00Z').getTime() + 86400000 * 90).toISOString().substring(0, 10) let ranges = [] for (let _schedule of this.schedules) { const _range = _schedule.get_availability_date_range() if (_range == null) { continue } const _date_begin = _range[0] const _date_end = _range[1] ranges.push([_date_begin, _date_end]) } ranges = ranges.sort(function(a, b) { if (a[0] < b[0]) { return -1 } else if (a[0] == b[0]) { if (a[1] < b[1]) { return -1 } else if (a[1] == b[1]) { return 0 } else { return 1 } } else { return 1 } }) for (let i = ranges.length - 1; i > 0; i--) { const a = ranges[i - 1] const b = ranges[i] //console.log(a, b) if (a[1] < b[0]) { continue } else { const _date_begin = a[0] let _date_end = a[1] if (b[1] > a[1]) { _date_end = b[1] } ranges.splice(i, 1) ranges[i - 1] = [_date_begin, _date_end] } } for (let i = ranges.length - 1; i > -1; i--) { const range = ranges[i] if (range[0] > cutoff_datestr) { ranges.splice(i, 1) continue } if (range[1] < today_datestr) { ranges.splice(i, 1) continue } if (range[0] < today_datestr) { range[0] = today_datestr } if (range[1] > cutoff_datestr) { range[1] = cutoff_datestr } } if (!this.is_active) { ranges = [] } return ranges } Coupon.call_service_coupon_item = function(promotion_id, on_success) { let url = '/rh2/service/promotion/promotion_item_get/' + promotion_id + '/' const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const s = e.target.responseText if (e.target.status == 200) { const resp = JSON.parse(s) //console.log(resp) if (on_success != undefined) { on_success(resp) } } }.bind(this)) xhr.open('GET', url) xhr.send() } Coupon.render_action_row = function(coupon, business, fragment) { let action_row = null if (coupon.coupon_type == 'DATE_REQUIRED') { action_row = document.createElement('div') action_row.classList.add('rh2-coupon-action-row-date-required') const heading = document.createElement('div') heading.classList.add('rh2-coupon-action-row-date-required-heading') heading.innerText = 'Claim a free Takeaway Coupon:' action_row.appendChild(heading) const body = document.createElement('div') body.classList.add('rh2-coupon-action-row-date-required-body') action_row.appendChild(body) const av_ar = coupon.get_availability_ar() for (let pair of av_ar) { const datestr = pair[0] const av = pair[1] const d = new Date(datestr + 'T00:00:00Z') const day_of_week_str = d.toUTCString().split(',')[0] const date_text = datestr.substring(8, 10) const month_part = d.toUTCString().split(' ')[2] const item_el = document.createElement('div') item_el.classList.add('rh2-coupon-action-row-date-required-item') if (av) { item_el.addEventListener('click', function() { rh2.Coupon.open_coupon_form(coupon, business, datestr, fragment) }.bind(this)) } else { item_el.classList.add('rh2-coupon-action-row-date-required-item-disabled') } body.appendChild(item_el) const day_of_week_el = document.createElement('div') day_of_week_el.classList.add('rh2-coupon-action-row-date-required-item-day-of-week') day_of_week_el.innerText = day_of_week_str item_el.appendChild(day_of_week_el) const date_el = document.createElement('div') date_el.classList.add('rh2-coupon-action-row-date-required-item-date') date_el.innerText = date_text item_el.appendChild(date_el) const month_el = document.createElement('div') month_el.classList.add('rh2-coupon-action-row-date-required-item-month') month_el.innerText = month_part item_el.appendChild(month_el) } } else if (coupon.coupon_type == 'DATE_NOT_REQUIRED') { action_row = document.createElement('div') action_row.classList.add('rh2-coupon-action-row-date-not-required') const today_datestr = rh2.utils.get_today_str() const ranges = coupon.get_availability_date_ranges(today_datestr) if (ranges.length > 0) { const heading = document.createElement('div') heading.classList.add('rh2-coupon-action-row-date-not-required-heading') heading.innerText = 'Claim a free Takeaway Coupon:' action_row.appendChild(heading) const body = document.createElement('div') body.classList.add('rh2-coupon-action-row-date-not-required-body') action_row.appendChild(body) const claim_button = document.createElement('a') claim_button.classList.add('rh2-coupon-action-row-date-not-required-claim-button') claim_button.innerText = 'Claim Now' body.appendChild(claim_button) claim_button.addEventListener('click', function() { rh2.Coupon.open_coupon_form(coupon, business, null, fragment) }.bind(this)) const redeem = document.createElement('span') redeem.classList.add('rh2-coupon-action-row-date-not-required-redeem') body.appendChild(redeem) let redeem_text = 'to redeem between ' const range_text_ar = [] for (let range of ranges) { range_text_ar.push(rh2.utils.repr_date(range[0]) + ' and ' + rh2.utils.repr_date(range[1])) } redeem_text += range_text_ar.join(', ') redeem.innerText = redeem_text } } else { action_row = document.createElement('div') } return action_row } Coupon.render_coupon_form = function(coupon, business, datestr, container_el, platform) { const is_desktop = parseInt(window.getComputedStyle(document.body).width) >= 640 const is_mobile = !is_desktop //const schedule = coupon.schedules[0] //get_available_schedule_and_time_ranges_for_date const form_el = document.createElement('div') if (is_desktop) { form_el.classList.add('rh2-coupon-form-desktop') } if (is_mobile) { form_el.classList.add('rh2-coupon-form-mobile') } container_el.appendChild(form_el) const SLIDE_TRANSITION_DURATION = 295 let current_slide_idx = -1 let next_slide_idx = 0 let current_slide = null let next_slide = null const today_str = rh2.utils.get_today_str() let var_datestr = datestr let var_schedule_uuid = null let var_schedule_time_text = null let var_schedule_date_text = null let first_name_input = null let last_name_input = null let email_address_input = null let phone_number_input = null let number_of_coupons_select = null let agree_checkbox_0 = null let agree_checkbox_1 = null let confirm_button = null let claim_button = null let confirm_button_state = null let email_address = '' const build_slide = function(idx) { if (idx == -1) { return build_slide_empty() } if (idx == 0) { return build_slide_0() } if (idx == 1) { return build_slide_1() } if (idx == 2) { return build_slide_2() } } const transition_slides = function(next_idx) { next_slide = build_slide(next_idx) next_slide.classList.add('rh2-coupon-form-slide-in') form_el.appendChild(next_slide) current_slide.classList.add('rh2-coupon-form-slide-out') window.setTimeout(function() { current_slide.parentNode.removeChild(current_slide) current_slide = next_slide current_slide_idx = next_idx next_slide_idx = null next_slide = null }, SLIDE_TRANSITION_DURATION) } const build_slide_empty = function() { const slide = document.createElement('div') slide.classList.add('rh2-coupon-form-slide') return slide } const build_coupon_card = function(coupon) { let schedule_and_time_ranges = null if (coupon.coupon_type == 'DATE_REQUIRED') { schedule_and_time_ranges = coupon.get_available_schedule_and_time_ranges_for_date(var_datestr) var_schedule_uuid = schedule_and_time_ranges.schedule.uuid } else if (coupon.coupon_type == 'DATE_NOT_REQUIRED') { for (let schedule of coupon.schedules) { if (schedule.is_active) { var_schedule_uuid = schedule.uuid } } } //console.log('build coupon card', coupon) //console.log('var_schedule_uuid', var_schedule_uuid) const coupon_card = document.createElement('div') coupon_card.classList.add('rh2-coupon-form-desktop-coupon-card') const coupon_card_top = document.createElement('div') coupon_card_top.classList.add('rh2-coupon-form-desktop-coupon-card-top') coupon_card.appendChild(coupon_card_top) coupon_card_top.innerText = 'Coupon' if (var_datestr == null) { coupon_card_top.innerText = 'Upcoming Coupon' } const coupon_card_top_corner_bottom_left = document.createElement('div') coupon_card_top_corner_bottom_left.classList.add('rh2-coupon-form-desktop-coupon-card-top-corner-bottom-left') coupon_card_top.appendChild(coupon_card_top_corner_bottom_left) const coupon_card_top_corner_bottom_right = document.createElement('div') coupon_card_top_corner_bottom_right.classList.add('rh2-coupon-form-desktop-coupon-card-top-corner-bottom-right') coupon_card_top.appendChild(coupon_card_top_corner_bottom_right) const coupon_card_bottom = document.createElement('div') coupon_card_bottom.classList.add('rh2-coupon-form-desktop-coupon-card-bottom') coupon_card.appendChild(coupon_card_bottom) const coupon_card_bottom_corner_top_left = document.createElement('div') coupon_card_bottom_corner_top_left.classList.add('rh2-coupon-form-desktop-coupon-card-bottom-corner-top-left') coupon_card_bottom.appendChild(coupon_card_bottom_corner_top_left) const coupon_card_bottom_corner_top_right = document.createElement('div') coupon_card_bottom_corner_top_right.classList.add('rh2-coupon-form-desktop-coupon-card-bottom-corner-top-right') coupon_card_bottom.appendChild(coupon_card_bottom_corner_top_right) const coupon_card_bottom_title_row = document.createElement('div') coupon_card_bottom_title_row.classList.add('rh2-coupon-form-desktop-coupon-card-bottom-title-row') coupon_card_bottom.appendChild(coupon_card_bottom_title_row) coupon_card_bottom_title_row.innerText = rh2.Promotion.get_promotion_title(coupon) const coupon_card_bottom_schedule_time_row = document.createElement('div') coupon_card_bottom_schedule_time_row.classList.add('rh2-coupon-form-desktop-coupon-card-bottom-schedule-time-row') coupon_card_bottom.appendChild(coupon_card_bottom_schedule_time_row) const coupon_card_bottom_schedule_date_row = document.createElement('div') coupon_card_bottom_schedule_date_row.classList.add('rh2-coupon-form-desktop-coupon-card-bottom-schedule-date-row') coupon_card_bottom.appendChild(coupon_card_bottom_schedule_date_row) var_schedule_time_text = 'Valid: ' if (coupon.coupon_type == 'DATE_REQUIRED') { const range_text_ar = [] for (let time_range of schedule_and_time_ranges.time_ranges) { let text = time_range[0].substring(0, 5) + '-' + time_range[1].substring(0, 5) range_text_ar.push(text) } var_schedule_time_text += range_text_ar.join(', ') } else if (coupon.coupon_type == 'DATE_NOT_REQUIRED') { const range_text_ar = [] for (let schedule of coupon.schedules) { const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) range_text_ar.push(schedule_sentence) } var_schedule_time_text += range_text_ar.join(', ') } coupon_card_bottom_schedule_time_row.innerText = var_schedule_time_text if (coupon.coupon_type == 'DATE_REQUIRED') { var_schedule_date_text = rh2.utils.repr_date(var_datestr) } else if (coupon.coupon_type == 'DATE_NOT_REQUIRED') { const today_datestr = rh2.utils.get_today_str() const ranges = coupon.get_availability_date_ranges(today_datestr) let redeem_text = 'between ' const range_text_ar = [] for (let range of ranges) { range_text_ar.push(rh2.utils.repr_date(range[0]) + ' and ' + rh2.utils.repr_date(range[1])) } redeem_text += range_text_ar.join(', ') var_schedule_date_text = redeem_text } coupon_card_bottom_schedule_date_row.innerText = var_schedule_date_text return coupon_card } const build_section_description = function(coupon) { const section = document.createElement('div') if (is_mobile) { section.classList.add('rh2-coupon-form-mobile-description') } if (coupon.description != '') { const description_title = document.createElement('div') description_title.classList.add('rh2-coupon-form-desktop-description-title') description_title.innerText = 'Description' section.appendChild(description_title) const description_text = document.createElement('div') if (is_desktop) { description_text.classList.add('rh2-coupon-form-desktop-description-text') } if (is_mobile) { description_text.classList.add('rh2-coupon-form-mobile-description-text') } description_text.innerText = coupon.description || '' section.appendChild(description_text) } return section } const build_section_condition = function(coupon) { const section = document.createElement('div') const condition_title = document.createElement('div') condition_title.classList.add('rh2-coupon-form-desktop-condition-title') condition_title.innerText = 'Conditions' section.appendChild(condition_title) { const condition_text = document.createElement('div') condition_text.classList.add('rh2-coupon-form-desktop-condition-text') condition_text.innerText = '● ' + 'Not to be used in conjunction with any other offer.' section.appendChild(condition_text) } if (coupon.value_str_1 != '') { const condition_text = document.createElement('div') condition_text.classList.add('rh2-coupon-form-desktop-condition-text') condition_text.innerText = '● ' + coupon.value_str_1 section.appendChild(condition_text) } if (coupon.value_str_2 != '') { const condition_text = document.createElement('div') condition_text.classList.add('rh2-coupon-form-desktop-condition-text') condition_text.innerText = '● ' + coupon.value_str_2 section.appendChild(condition_text) } return section } const build_section_form = function(coupon) { const section = document.createElement('form') if (is_desktop) { section.classList.add('rh2-coupon-form-desktop-form') } if (is_mobile) { section.classList.add('rh2-coupon-form-mobile-form') } const form_row_0 = document.createElement('div') form_row_0.classList.add('rh2-coupon-form-desktop-form-row-0') section.appendChild(form_row_0) const form_row_0_col_0 = document.createElement('div') form_row_0_col_0.classList.add('rh2-coupon-form-desktop-form-row-0-col-0') form_row_0.appendChild(form_row_0_col_0) const form_row_0_col_1 = document.createElement('div') form_row_0_col_1.classList.add('rh2-coupon-form-desktop-form-row-0-col-1') form_row_0.appendChild(form_row_0_col_1) { const label = document.createElement('div') label.classList.add('rh2-coupon-form-desktop-form-label') label.innerText = 'First name' form_row_0_col_0.appendChild(label) } first_name_input = document.createElement('input') first_name_input.classList.add('rh2-coupon-form-desktop-form-input') form_row_0_col_0.appendChild(first_name_input) first_name_input.addEventListener('keyup', function() { const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } }.bind(this)) { const label = document.createElement('div') label.classList.add('rh2-coupon-form-desktop-form-label') label.innerText = 'Last name' form_row_0_col_1.appendChild(label) } last_name_input = document.createElement('input') last_name_input.classList.add('rh2-coupon-form-desktop-form-input') form_row_0_col_1.appendChild(last_name_input) last_name_input.addEventListener('keyup', function() { const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } }.bind(this)) const form_row_1 = document.createElement('div') form_row_1.classList.add('rh2-coupon-form-desktop-form-row-1') section.appendChild(form_row_1) { const label = document.createElement('div') label.classList.add('rh2-coupon-form-desktop-form-label') label.innerText = 'Email address' form_row_1.appendChild(label) } email_address_input = document.createElement('input') email_address_input.classList.add('rh2-coupon-form-desktop-form-input') email_address_input.setAttribute('type', 'email') form_row_1.appendChild(email_address_input) email_address_input.addEventListener('keyup', function() { const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } }.bind(this)) const form_row_2 = document.createElement('div') form_row_2.classList.add('rh2-coupon-form-desktop-form-row-2') section.appendChild(form_row_2) { const label = document.createElement('div') label.classList.add('rh2-coupon-form-desktop-form-label') label.innerText = 'Phone number' form_row_2.appendChild(label) } phone_number_input = document.createElement('input') phone_number_input.classList.add('rh2-coupon-form-desktop-form-input') form_row_2.appendChild(phone_number_input) phone_number_input.addEventListener('keyup', function() { const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } }.bind(this)) const form_row_3 = document.createElement('div') form_row_3.classList.add('rh2-coupon-form-desktop-form-row-3') section.appendChild(form_row_3) { const label = document.createElement('div') label.classList.add('rh2-coupon-form-desktop-form-label') label.innerText = 'Number of coupons' form_row_3.appendChild(label) } number_of_coupons_select = document.createElement('select') number_of_coupons_select.classList.add('rh2-coupon-form-desktop-form-select') form_row_3.appendChild(number_of_coupons_select) for (let i = 1; i <= coupon.max_pax; i++) { const option = document.createElement('option') option.innerText = i option.setAttribute('value', i) number_of_coupons_select.appendChild(option) } //let quantity_left = schedule['quantity_left'] //if (quantity_left < 0) { // quantity_left = 64 //} //for (let i = 1; i <= Math.min(8, quantity_left); i++) { // const option = document.createElement('option') // option.innerText = i // option.setAttribute('value', i) // number_of_coupons_select.appendChild(option) //} return section } const build_section_agree = function(coupon) { const section = document.createElement('div') if (is_desktop) { section.classList.add('rh2-restaurant-coupon-agree-desktop-agree') } if (is_mobile) { section.classList.add('rh2-restaurant-coupon-agree-mobile-agree') } const agree_row_0 = document.createElement('div') agree_row_0.classList.add('rh2-coupon-form-desktop-footer-agree-row') section.appendChild(agree_row_0) agree_checkbox_0 = document.createElement('input') agree_checkbox_0.setAttribute('type', 'checkbox') agree_checkbox_0.setAttribute('checked', 'true') agree_checkbox_0.classList.add('rh2-coupon-form-desktop-footer-agree-checkbox') agree_row_0.appendChild(agree_checkbox_0) agree_checkbox_0.addEventListener('change', function() { const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } }.bind(this)) const agree_text_0 = document.createElement('div') agree_text_0.classList.add('rh2-coupon-form-desktop-footer-agree-text') agree_text_0.innerText = "You agree to the vendor's conditions and have the intention of using the claimed coupons" agree_row_0.appendChild(agree_text_0) const agree_row_1 = document.createElement('div') agree_row_1.classList.add('rh2-coupon-form-desktop-footer-agree-row') section.appendChild(agree_row_1) agree_checkbox_1 = document.createElement('input') agree_checkbox_1.setAttribute('type', 'checkbox') agree_checkbox_1.setAttribute('checked', 'true') agree_checkbox_1.classList.add('rh2-coupon-form-desktop-footer-agree-checkbox') agree_row_1.appendChild(agree_checkbox_1) agree_checkbox_1.addEventListener('change', function() { const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } }.bind(this)) const agree_text_1 = document.createElement('div') agree_text_1.classList.add('rh2-coupon-form-desktop-footer-agree-text') agree_text_1.innerText = "You agree to Restaurant Hub's " agree_row_1.appendChild(agree_text_1) const agree_link_1 = document.createElement('div') agree_link_1.classList.add('rh2-coupon-form-desktop-footer-agree-link') agree_link_1.innerText = 'Terms and Conditions' agree_row_1.appendChild(agree_link_1) agree_link_1.addEventListener('click', function() { window.open('https://www.restauranthub.co.nz/terms-and-conditions/', '_blank') }.bind(this)) return section } const build_section_claim = function(coupon) { const section = document.createElement('div') if (is_desktop) { section.classList.add('rh2-coupon-form-desktop-footer-claim') } if (is_mobile) { section.classList.add('rh2-coupon-form-mobile-footer-claim') } //if (availability != 'LIVE') { // return section //} //const countdown_button = document.createElement('div') //countdown_button.classList.add('rh2-coupon-form-desktop-footer-countdown-button') ////countdown_button.innerText = '01:23:45 left' //section.appendChild(countdown_button) //let time_left = schedule['time_left'] //window.setInterval(function() { // time_left -= 1 // if (time_left < 0) { // return // } // if (!countdown_button) { // return // } // const time_left_s = time_left % 60 // const time_left_m = (time_left - 1 * time_left_s) / 60 % 60 // const time_left_h = (time_left - 1 * time_left_s - 60 * time_left_m) / 3600 // let time_left_str = rh2.utils.zero_pad(time_left_h) // time_left_str += ':' + rh2.utils.zero_pad(time_left_m) // time_left_str += ':' + rh2.utils.zero_pad(time_left_s) // time_left_str += ' left' // countdown_button.innerText = time_left_str //}.bind(this), 1000) claim_button = document.createElement('div') if (is_desktop) { claim_button.classList.add('rh2-coupon-form-desktop-footer-claim-button') } if (is_mobile) { claim_button.classList.add('rh2-coupon-form-mobile-footer-claim-button') } claim_button.innerText = 'Claim >' section.appendChild(claim_button) claim_button.addEventListener('click', function() { if (is_desktop) { transition_slides(1) } if (is_mobile) { if (confirm_button_state != true) { return } const validation_result = validate_form() email_address = validation_result.data.email_address call_service_claim( business.rh2_uuid, coupon.uuid, var_schedule_uuid, var_datestr, validation_result.data.number_of_coupons, validation_result.data.first_name, validation_result.data.last_name, validation_result.data.email_address, validation_result.data.phone_number, function(resp) { //console.log(resp) }.bind(this) ) transition_slides(2) } }.bind(this)) //if (schedule['quantity_left'] > 0) { // const stock_row = document.createElement('div') // stock_row.classList.add('rh2-coupon-form-desktop-footer-stock-row') // section.appendChild(stock_row) // const stock_number = document.createElement('div') // stock_number.classList.add('rh2-coupon-form-desktop-footer-stock-number') // stock_number.innerText = schedule['quantity_left'] // stock_row.appendChild(stock_number) // const stock_text = document.createElement('div') // stock_text.classList.add('rh2-coupon-form-desktop-footer-stock-text') // stock_text.innerText = 'Coupons remaining' // stock_row.appendChild(stock_text) //} return section } const build_section_valid = function(promotion) { const section = document.createElement('div') if (is_desktop) { section.classList.add('rh2-coupon-form-desktop-valid') } if (is_mobile) { section.classList.add('rh2-coupon-form-mobile-valid') } const valid_row = document.createElement('div') valid_row.classList.add('rh2-coupon-form-desktop-slide-2-valid-row') section.appendChild(valid_row) const valid_icon = document.createElement('div') valid_icon.classList.add('rh2-coupon-form-desktop-slide-2-valid-icon') valid_row.appendChild(valid_icon) const valid_title = document.createElement('div') valid_title.classList.add('rh2-coupon-form-desktop-slide-2-valid-title') valid_title.innerText = 'Valid' valid_row.appendChild(valid_title) const schedule_row_time = document.createElement('div') schedule_row_time.classList.add('rh2-coupon-form-desktop-slide-2-schedule-row-time') section.appendChild(schedule_row_time) const schedule_row_date = document.createElement('div') schedule_row_date.classList.add('rh2-coupon-form-desktop-slide-2-schedule-row-date') section.appendChild(schedule_row_date) let var_schedule_time_text = '' let var_schedule_date_text = '' const coupon = new rh2.Coupon.CouponStruct() coupon.decode(promotion) if (coupon.coupon_type == 'DATE_REQUIRED') { const range_text_ar = [] const schedule_and_time_ranges = coupon.get_available_schedule_and_time_ranges_for_date(var_datestr) for (let time_range of schedule_and_time_ranges.time_ranges) { let text = time_range[0].substring(0, 5) + '-' + time_range[1].substring(0, 5) range_text_ar.push(text) } var_schedule_time_text += range_text_ar.join(', ') } else if (coupon.coupon_type == 'DATE_NOT_REQUIRED') { const range_text_ar = [] for (let schedule of coupon.schedules) { const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) range_text_ar.push(schedule_sentence) } var_schedule_time_text += range_text_ar.join(', ') } schedule_row_time.innerText = var_schedule_time_text if (coupon.coupon_type == 'DATE_REQUIRED') { var_schedule_date_text = rh2.utils.repr_date(var_datestr) } else if (coupon.coupon_type == 'DATE_NOT_REQUIRED') { const today_datestr = rh2.utils.get_today_str() const ranges = coupon.get_availability_date_ranges(today_datestr) let redeem_text = 'between ' const range_text_ar = [] for (let range of ranges) { range_text_ar.push(rh2.utils.repr_date(range[0]) + ' and ' + rh2.utils.repr_date(range[1])) } redeem_text += range_text_ar.join(', ') var_schedule_date_text = redeem_text } schedule_row_date.innerText = var_schedule_date_text return section } const build_section_notes = function(coupon) { const section = document.createElement('div') const notes_row = document.createElement('div') notes_row.classList.add('rh2-coupon-form-desktop-slide-2-notes-row') section.appendChild(notes_row) const notes_icon = document.createElement('div') notes_icon.classList.add('rh2-coupon-form-desktop-slide-2-notes-icon') notes_row.appendChild(notes_icon) const notes_title = document.createElement('div') notes_title.classList.add('rh2-coupon-form-desktop-slide-2-notes-title') notes_title.innerText = 'Redemption notes' notes_row.appendChild(notes_title) const notes_text = document.createElement('div') notes_text.classList.add('rh2-coupon-form-desktop-slide-2-notes-text') notes_text.innerText = 'Coupon will be sent to your email, and can be redeemed either by showing the email on your phone or tablet, or printing and bringing a copy, to the vendor.' section.appendChild(notes_text) return section } const build_section_success = function(coupon) { const section = document.createElement('div') if (is_desktop) { section.classList.add('rh2-coupon-form-desktop-success') } if (is_mobile) { section.classList.add('rh2-coupon-form-mobile-success') } const success_image = document.createElement('div') success_image.classList.add('rh2-coupon-form-desktop-slide-2-success-image') section.appendChild(success_image) const success_title = document.createElement('div') success_title.classList.add('rh2-coupon-form-desktop-slide-2-success-title') section.appendChild(success_title) success_title.innerText = 'Live Coupon Claimed' const success_email_label = document.createElement('div') success_email_label.classList.add('rh2-coupon-form-desktop-slide-2-success-email-label') section.appendChild(success_email_label) success_email_label.innerText = 'Coupon sent to' const success_email_address = document.createElement('div') success_email_address.classList.add('rh2-coupon-form-desktop-slide-2-success-email-address') section.appendChild(success_email_address) success_email_address.innerText = email_address return section } const toggle_confirm_button = function(state) { confirm_button_state = state if (is_desktop) { if (state == false) { confirm_button.classList.add('rh2-coupon-form-desktop-footer-confirm-button-disabled') } else { confirm_button.classList.remove('rh2-coupon-form-desktop-footer-confirm-button-disabled') } } if (is_mobile) { if (state == false) { claim_button.classList.add('rh2-coupon-form-mobile-footer-claim-button-disabled') } else { claim_button.classList.remove('rh2-coupon-form-mobile-footer-claim-button-disabled') } } } const validate_form = function() { let is_valid = true const first_name = first_name_input.value.trim() const last_name = last_name_input.value.trim() const email_address = email_address_input.value.trim() const phone_number = phone_number_input.value.trim() const number_of_coupons = number_of_coupons_select.value const agree_0 = agree_checkbox_0.checked if (!agree_0) { is_valid = false } const agree_1 = agree_checkbox_1.checked if (!agree_1) { is_valid = false } if (rh2.utils.is_email_address_valid(email_address) == false) { is_valid = false } if (first_name == '') { is_valid = false } if (last_name == '') { is_valid = false } if (phone_number.length < 6) { is_valid = false } return { errcode: is_valid ? 0 : 1, errmsg: '', data: { first_name: first_name, last_name: last_name, email_address: email_address, phone_number: phone_number, number_of_coupons: number_of_coupons, } } } const toggle_claim_button = function(state) { if (state == false) { claim_button.classList.add('rh2-coupon-form-mobile-footer-claim-button-disabled') } else { claim_button.classList.remove('rh2-coupon-form-mobile-footer-claim-button-disabled') } } const build_slide_0 = function() { if (is_desktop) { const slide = document.createElement('div') slide.classList.add('rh2-coupon-form-slide') const header_row = document.createElement('div') header_row.classList.add('rh2-coupon-form-desktop-header-row') slide.appendChild(header_row) let header_text = '' header_text += ' Coupon at ' + business.name header_row.innerText = header_text const body_row = document.createElement('div') body_row.classList.add('rh2-coupon-form-desktop-body-row') slide.appendChild(body_row) const footer_row = document.createElement('div') footer_row.classList.add('rh2-coupon-form-desktop-footer-row') slide.appendChild(footer_row) const body_left = document.createElement('div') body_left.classList.add('rh2-coupon-form-desktop-body-left') body_row.appendChild(body_left) const body_right = document.createElement('div') body_right.classList.add('rh2-coupon-form-desktop-body-right') body_row.appendChild(body_right) if (coupon.coupon_type == 'DATE_REQUIRED') { const date_select_section = document.createElement('div') date_select_section.classList.add('rh2-coupon-form-date-select-section') body_left.appendChild(date_select_section) const label = document.createElement('label') label.classList.add('rh2-coupon-form-date-select-label') label.innerText = 'Claiming for:' date_select_section.appendChild(label) const date_select = document.createElement('select') date_select.classList.add('rh2-coupon-form-date-select') date_select_section.appendChild(date_select) const av_ar = coupon.get_availability_ar() for (let pair of av_ar) { const datestr = pair[0] const av = pair[1] if (av) { const option = document.createElement('option') option.setAttribute('value', datestr) option.innerText = rh2.utils.weekday_repr_date(datestr) + ' ' + rh2.utils.repr_date(datestr) date_select.appendChild(option) if (datestr == var_datestr) { option.selected = true } } } date_select.addEventListener('change', function() { var_datestr = date_select.value this.coupon_card_container.innerHTML = '' const coupon_card = build_coupon_card(coupon) this.coupon_card_container.appendChild(coupon_card) }.bind(this)) } const coupon_card_container = this.coupon_card_container = document.createElement('div') body_left.appendChild(coupon_card_container) const coupon_card = build_coupon_card(coupon) coupon_card_container.appendChild(coupon_card) const section_description = build_section_description(coupon) body_right.appendChild(section_description) const section_condition = build_section_condition(coupon) body_right.appendChild(section_condition) const footer_left = document.createElement('div') footer_left.classList.add('rh2-coupon-form-desktop-footer-left') footer_row.appendChild(footer_left) footer_left.innerText = '* Coupon will be sent to your email, and can be redeemed either by showing the email on your phone or tablet, or printing and bringing a copy, to the vendor.' const footer_right = document.createElement('div') footer_right.classList.add('rh2-coupon-form-desktop-footer-right') footer_row.appendChild(footer_right) const claim_row = build_section_claim(coupon) footer_right.appendChild(claim_row) return slide } if (is_mobile) { const slide = document.createElement('div') slide.classList.add('rh2-coupon-form-slide') const header_row = document.createElement('div') header_row.classList.add('rh2-coupon-form-mobile-header-row') slide.appendChild(header_row) const header_back_button = document.createElement('div') header_back_button.classList.add('rh2-coupon-form-mobile-header-back-button') header_back_button.innerText = '<' header_row.appendChild(header_back_button) header_back_button.addEventListener('click', function() { const full_screen_overlay = container_el.parentNode full_screen_overlay.classList.remove('rh2-full-screen-overlay-translucent-active') full_screen_overlay.innerHTML = '' }.bind(this)) const header_text = document.createElement('div') header_text.classList.add('rh2-coupon-form-mobile-header-text') header_text.innerText = business.name header_row.appendChild(header_text) const body_row = document.createElement('div') body_row.classList.add('rh2-coupon-form-mobile-body-row') slide.appendChild(body_row) const footer_row = document.createElement('div') footer_row.classList.add('rh2-coupon-form-mobile-footer-row') slide.appendChild(footer_row) if (coupon.coupon_type == 'DATE_REQUIRED') { const date_select_section = document.createElement('div') date_select_section.classList.add('rh2-coupon-form-date-select-section') body_row.appendChild(date_select_section) const label = document.createElement('label') label.classList.add('rh2-coupon-form-date-select-label') label.innerText = 'Claiming for:' date_select_section.appendChild(label) const date_select = document.createElement('select') date_select.classList.add('rh2-coupon-form-date-select') date_select_section.appendChild(date_select) const av_ar = coupon.get_availability_ar() for (let pair of av_ar) { const datestr = pair[0] const av = pair[1] if (av) { const option = document.createElement('option') option.setAttribute('value', datestr) option.innerText = rh2.utils.weekday_repr_date(datestr) + ' ' + rh2.utils.repr_date(datestr) date_select.appendChild(option) if (datestr == var_datestr) { option.selected = true } } } date_select.addEventListener('change', function() { var_datestr = date_select.value this.coupon_card_container.innerHTML = '' const coupon_card = build_coupon_card(coupon) this.coupon_card_container.appendChild(coupon_card) }.bind(this)) } const coupon_card_container = this.coupon_card_container = document.createElement('div') body_row.appendChild(coupon_card_container) const coupon_card = build_coupon_card(coupon) coupon_card_container.appendChild(coupon_card) const section_description = build_section_description(coupon) body_row.appendChild(section_description) const section_condition = build_section_condition(coupon) body_row.appendChild(section_condition) const form_row = build_section_form(coupon) body_row.appendChild(form_row) const agree_row = build_section_agree(coupon) body_row.appendChild(agree_row) const claim_row = build_section_claim(coupon) body_row.appendChild(claim_row) return slide } } const build_slide_1 = function() { const slide = document.createElement('div') slide.classList.add('rh2-coupon-form-slide') const header_row = document.createElement('div') header_row.classList.add('rh2-coupon-form-desktop-header-row') slide.appendChild(header_row) const back_button = document.createElement('div') back_button.classList.add('rh2-coupon-form-slide-1-back-button') back_button.innerText = '< Back' header_row.appendChild(back_button) back_button.addEventListener('click', function(e) { transition_slides(0) }.bind(this)) const body_row = document.createElement('div') body_row.classList.add('rh2-coupon-form-desktop-body-row') slide.appendChild(body_row) const footer_row = document.createElement('div') footer_row.classList.add('rh2-coupon-form-desktop-footer-row') slide.appendChild(footer_row) const body_left = document.createElement('div') body_left.classList.add('rh2-coupon-form-desktop-body-left') body_row.appendChild(body_left) const body_right = document.createElement('div') body_right.classList.add('rh2-coupon-form-desktop-body-right') body_row.appendChild(body_right) const restaurant_name = document.createElement('div') restaurant_name.classList.add('rh2-coupon-form-desktop-slide-1-restaurant-name') restaurant_name.innerText = business.name body_left.appendChild(restaurant_name) const coupon_card = build_coupon_card(coupon) body_left.appendChild(coupon_card) const guide = document.createElement('div') guide.classList.add('rh2-coupon-form-desktop-slide-1-guide') guide.innerText = '* Coupon will be sent to your email, and can be redeemed either by showing the email on your phone or tablet, or printing and bringing a copy, to the vendor.' body_left.appendChild(guide) const form_row = build_section_form(coupon) body_right.appendChild(form_row) const footer_left = document.createElement('div') footer_left.classList.add('rh2-coupon-form-desktop-slide-1-footer-left') footer_row.appendChild(footer_left) const footer_right = document.createElement('div') footer_right.classList.add('rh2-coupon-form-desktop-slide-1-footer-right') footer_row.appendChild(footer_right) const agree_row = build_section_agree(coupon) footer_left.appendChild(agree_row) confirm_button = document.createElement('div') confirm_button.classList.add('rh2-coupon-form-desktop-footer-confirm-button') confirm_button.innerText = 'Confirm' footer_right.appendChild(confirm_button) confirm_button.addEventListener('click', function() { if (confirm_button_state != true) { return } const validation_result = validate_form() email_address = validation_result.data.email_address call_service_claim( business.rh2_uuid, coupon.uuid, var_schedule_uuid, var_datestr, validation_result.data.number_of_coupons, validation_result.data.first_name, validation_result.data.last_name, validation_result.data.email_address, validation_result.data.phone_number, function(resp) { //console.log(resp) }.bind(this) ) transition_slides(2) }.bind(this)) const validation_result = validate_form() if (validation_result.errcode != 0) { toggle_confirm_button(false) } else { toggle_confirm_button(true) } return slide } const build_slide_2 = function() { if (is_desktop) { const slide = document.createElement('div') slide.classList.add('rh2-coupon-form-slide') slide.classList.add('rh2-coupon-form-slide-2') const body_row = document.createElement('div') body_row.classList.add('rh2-coupon-form-desktop-body-row') slide.appendChild(body_row) const body_left = document.createElement('div') body_left.classList.add('rh2-coupon-form-desktop-slide-2-body-left') body_row.appendChild(body_left) const body_right = document.createElement('div') body_right.classList.add('rh2-coupon-form-desktop-slide-2-body-right') body_row.appendChild(body_right) const success_row = build_section_success(coupon) body_left.appendChild(success_row) const valid_row = build_section_valid(coupon) body_right.appendChild(valid_row) const notes_row = build_section_notes(coupon) body_right.appendChild(notes_row) return slide } if (is_mobile) { const slide = document.createElement('div') slide.classList.add('rh2-coupon-form-slide') slide.classList.add('rh2-coupon-form-slide-2') const body_row = document.createElement('div') body_row.classList.add('rh2-coupon-form-mobile-body-row') slide.appendChild(body_row) const close_button = document.createElement('div') close_button.classList.add('rh2-coupon-form-mobile-close-button') body_row.appendChild(close_button) close_button.addEventListener('click', function() { const full_screen_overlay = container_el.parentNode full_screen_overlay.classList.remove('rh2-restaurant-item-full-screen-overlay-translucent-active') full_screen_overlay.innerHTML = '' }.bind(this)) const success_row = build_section_success(coupon) body_row.appendChild(success_row) const valid_row = build_section_valid(coupon) body_row.appendChild(valid_row) const notes_row = build_section_notes(coupon) body_row.appendChild(notes_row) return slide } } const call_service_claim = function(restaurant_uuid, promotion_uuid, schedule_uuid, date, quantity, first_name, last_name, email_address, phone_number, on_success) { const fire_event_purchase = function() { const value = 0.59 * quantity try { if (!window.gtag) { console.error('window.gtag undefined') } window.gtag && gtag('event', 'purchase', { event_category: 'COUPON', transaction_id: (new Date()).getTime() + '.' + Math.random().toString(), currency: 'NZD', value: value, items: [{ id: promotion_uuid, name: 'COUPON', brand: restaurant_uuid, category: 'COUPON', price: 0.59, quantity: quantity, }] }) } catch (e) { console.error(e) } try { if (!window.fbq) { console.error('window.fbq undefined') } window.fbq && fbq('track', 'Purchase', { currency: 'NZD', value: value, content_category: 'COUPON', contents: [{ id: promotion_uuid, quantity: quantity, }] }) } catch (e) { console.error(e) } } const postdata = { form_data: { restaurant_uuid: restaurant_uuid, promotion_uuid: promotion_uuid, schedule_uuid: schedule_uuid, coupon_date: date, quantity: quantity, first_name: first_name, last_name: last_name, email_address: email_address, phone_number: phone_number, //ref: page_ref, //http_referer: page_http_referer, } } const postdata_str = JSON.stringify(postdata) const url = '/rh2/service/promotion/coupon-claim-post/' const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const rt = e.target.responseText const resp = JSON.parse(rt) if (on_success) { fire_event_purchase() on_success(resp) } }.bind(this)) try { xhr.open('POST', url) xhr.send(postdata_str) } catch (e) { on_error() } } const build_form = function() { current_slide_idx = 0 current_slide = build_slide(current_slide_idx) form_el.appendChild(current_slide) transition_slides(next_slide_idx) } build_form() } Coupon.open_coupon_form = function(coupon, business, datestr, fragment) { if (fragment.fm.is_desktop()) { fragment.full_screen_overlay_translucent.innerHTML = '' fragment.full_screen_overlay_translucent.classList.add('rh2-full-screen-overlay-translucent-active') fragment.full_screen_overlay_translucent.addEventListener('click', function(e) { fragment.full_screen_overlay_translucent.classList.remove('rh2-full-screen-overlay-translucent-active') }.bind(fragment)) const overlay_close_button = document.createElement('div') overlay_close_button.classList.add('rh2-full-screen-overlay-translucent-close') fragment.full_screen_overlay_translucent.appendChild(overlay_close_button) overlay_close_button.addEventListener('click', function() { fragment.full_screen_overlay_translucent.classList.remove('rh2-full-screen-overlay-translucent-active') }.bind(fragment)) const form_container = document.createElement('div') form_container.classList.add('rh2-coupon-form-container') fragment.full_screen_overlay_translucent.appendChild(form_container) form_container.addEventListener('click', function(e) { e.stopPropagation() }) Coupon.render_coupon_form(coupon, business, datestr, form_container, 'DESKTOP') } if (fragment.fm.is_mobile()) { fragment.full_screen_overlay_translucent.innerHTML = '' fragment.full_screen_overlay_translucent.classList.add('rh2-full-screen-overlay-translucent-active') const form_container = document.createElement('div') form_container.classList.add('rh2-coupon-form-container-mobile') fragment.full_screen_overlay_translucent.appendChild(form_container) form_container.addEventListener('click', function(e) { e.stopPropagation() }) Coupon.render_coupon_form(coupon, business, datestr, form_container, 'MOBILE') } } Coupon.render_card_for_business_item_page = function(promotion, business, fragment) { const coupon = new this.CouponStruct() coupon.decode(promotion) const schedules = promotion.schedules let coupon_item_page_url = '' { const pairs = [] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') coupon_item_page_url = business.item_page_url + 'coupon/' + promotion.uuid + '/' if (querystring) { coupon_item_page_url += '?' + querystring } } const promotion_el = document.createElement('div') if (rh2.utils.is_desktop()) { promotion_el.classList.add('rh2-business-item-coupon-card-desktop') } else { promotion_el.classList.add('rh2-business-item-coupon-card-mobile') } const part_image = document.createElement('div') if (rh2.utils.is_desktop()) { part_image.classList.add('rh2-business-item-coupon-card-part-image-desktop') } else { part_image.classList.add('rh2-business-item-coupon-card-part-image-mobile') } promotion_el.appendChild(part_image) const part_image_image = document.createElement('a') part_image_image.classList.add('rh2-business-item-coupon-card-part-image-image') part_image_image.setAttribute('href', coupon_item_page_url) part_image.appendChild(part_image_image) const image_url = rh2.Promotion.get_promotion_image_url(promotion) part_image_image.style['background-image'] = "url('" + image_url + "')" const part_text = document.createElement('div') if (rh2.utils.is_desktop()) { part_text.classList.add('rh2-business-item-coupon-card-part-text-desktop') } else { part_text.classList.add('rh2-business-item-coupon-card-part-text-mobile') } promotion_el.appendChild(part_text) const row_title = document.createElement('a') row_title.classList.add('rh2-business-item-coupon-card-row-title') row_title.setAttribute('href', coupon_item_page_url) part_text.appendChild(row_title) const promotion_title = rh2.Promotion.get_promotion_title(promotion) row_title.innerText = promotion_title const section_schedule = document.createElement('div') section_schedule.classList.add('rh2-business-item-coupon-card-section-schedule') part_text.appendChild(section_schedule) const schedule_sentence_ar = [] for (let i in schedules) { const schedule = schedules[i] const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) schedule_sentence_ar.push(schedule_sentence) } schedule_sentence_ar.sort() for (let i in schedule_sentence_ar) { const schedule_el = document.createElement('div') let schedule_sentence = schedule_sentence_ar[i] schedule_sentence = schedule_sentence.replace('Sun,Mon,Tue,Wed,Thu,Fri,Sat', 'Daily') schedule_sentence = schedule_sentence.replace('Mon,Tue,Wed,Thu,Fri,Sat,Sun', 'Daily') schedule_el.innerText = schedule_sentence section_schedule.appendChild(schedule_el) } const row_condition_0 = document.createElement('div') row_condition_0.classList.add('rh2-business-item-coupon-card-row-condition-0') row_condition_0.innerText = '* Not to be used in conjunction with any other offer' part_text.appendChild(row_condition_0) const row_condition_1 = document.createElement('div') row_condition_1.classList.add('rh2-business-item-coupon-card-row-condition-1') row_condition_1.innerText = promotion.value_str_1 != '' ? '* ' + promotion.value_str_1 : '' part_text.appendChild(row_condition_1) const row_condition_2 = document.createElement('div') row_condition_2.classList.add('rh2-business-item-coupon-card-row-condition-2') row_condition_2.innerText = promotion.value_str_2 != '' ? '* ' + promotion.value_str_2 : '' part_text.appendChild(row_condition_2) //const section_description = document.createElement('div') //section_description.classList.add('rh2-business-item-coupon-card-section-description') //section_description.innerText = promotion.description //part_text.appendChild(section_description) const action_section = document.createElement('div') action_section.classList.add('rh2-business-item-coupon-card-section-action') part_text.appendChild(action_section) const action_row = rh2.Coupon.render_action_row(coupon, business, fragment) action_section.appendChild(action_row) return promotion_el } Coupon.render_card_for_business_list_page = function(promotion, business, fragment) { const coupon = new this.CouponStruct() coupon.decode(promotion) let coupon_item_page_url = '' { const pairs = [] const referrer = fragment.get_param_value('referrer') if (referrer) { pairs.push(['referrer', referrer]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') coupon_item_page_url = business.item_page_url + 'coupon/' + promotion.uuid + '/' if (querystring) { coupon_item_page_url += '?' + querystring } } const promotion_el = document.createElement('div') if (rh2.utils.is_desktop()) { promotion_el.classList.add('rh2-business-list-coupon-card-desktop') } else { promotion_el.classList.add('rh2-business-list-coupon-card-mobile') } const part_image = document.createElement('div') if (rh2.utils.is_desktop()) { part_image.classList.add('rh2-business-list-coupon-card-part-image-desktop') } else { part_image.classList.add('rh2-business-list-coupon-card-part-image-mobile') } promotion_el.appendChild(part_image) const part_image_image = document.createElement('a') part_image_image.classList.add('rh2-business-list-coupon-card-part-image-image') part_image_image.setAttribute('href', coupon_item_page_url) part_image_image.addEventListener('click', function(e) { e.preventDefault() document.location.href = coupon_item_page_url }.bind(this)) part_image.appendChild(part_image_image) let image_url = rh2.Promotion.get_promotion_image_url(promotion) if (image_url.match('/cloudfile-get/')) { image_url += '/imgproc-resizecrop=240,240/' } part_image_image.style['background-image'] = "url('" + image_url + "/imgproc-resizecrop=240,240/" + "')" const part_text = document.createElement('div') if (rh2.utils.is_desktop()) { part_text.classList.add('rh2-business-list-coupon-card-part-text-desktop') } else { part_text.classList.add('rh2-business-list-coupon-card-part-text-mobile') } promotion_el.appendChild(part_text) const row_title = document.createElement('a') row_title.classList.add('rh2-business-list-coupon-card-row-title') row_title.setAttribute('href', coupon_item_page_url) row_title.addEventListener('click', function(e) { e.preventDefault() document.location.href = coupon_item_page_url }.bind(this)) part_text.appendChild(row_title) const promotion_title = rh2.Promotion.get_promotion_title(promotion) row_title.innerText = promotion_title const section_schedule = document.createElement('div') section_schedule.classList.add('rh2-business-list-coupon-card-section-schedule') part_text.appendChild(section_schedule) const schedule_sentence_ar = [] for (let i in coupon.schedules) { const schedule = coupon.schedules[i] const schedule_sentence = rh2.Promotion.get_schedule_sentence(schedule) schedule_sentence_ar.push(schedule_sentence) } schedule_sentence_ar.sort() for (let i in schedule_sentence_ar) { const schedule_el = document.createElement('div') let schedule_sentence = schedule_sentence_ar[i] schedule_el.classList.add('rh2-business-list-coupon-card-section-schedule-item') schedule_sentence = schedule_sentence.replace('Sun,Mon,Tue,Wed,Thu,Fri,Sat', 'Daily') schedule_sentence = schedule_sentence.replace('Mon,Tue,Wed,Thu,Fri,Sat,Sun', 'Daily') schedule_el.innerText = schedule_sentence section_schedule.appendChild(schedule_el) } const action_section = document.createElement('div') action_section.classList.add('rh2-business-list-coupon-card-section-action') part_text.appendChild(action_section) const action_row = rh2.Coupon.render_action_row(coupon, business, fragment) action_section.appendChild(action_row) const section_business = document.createElement('div') section_business.classList.add('rh2-business-list-coupon-card-section-business') part_text.appendChild(section_business) const business_name_row = document.createElement('a') business_name_row.classList.add('rh2-business-list-coupon-card-section-business-name-row') business_name_row.setAttribute('href', business.item_page_url) business_name_row.addEventListener('click', function(e) { e.preventDefault() document.location.href = business.item_page_url }.bind(this)) business_name_row.innerText = business.name section_business.appendChild(business_name_row) const business_attr_row_0 = document.createElement('div') business_attr_row_0.classList.add('rh2-business-list-coupon-card-section-business-attr-row-0') section_business.appendChild(business_attr_row_0) const business_attr_row_1 = document.createElement('div') business_attr_row_1.classList.add('rh2-business-list-coupon-card-section-business-attr-row-1') section_business.appendChild(business_attr_row_1) if (business.ta_rating && business.ta_num_reviews) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-list-coupon-card-section-business-attr-row-0-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + business.ta_rating.toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") business_attr_row_0.appendChild(ta_image_el) } let cuisine_ar = [] for (let i = 0; i < 3; i++) { const cuisine_val = business.cuisine_vals[i] if (cuisine_val == undefined) { continue } cuisine_ar.push(cuisine_val) } const cuisine_text = cuisine_ar.join(' · ') const business_cuisine = document.createElement('div') business_cuisine.classList.add('rh2-business-list-coupon-card-section-business-attr-row-0-cuisine') business_cuisine.innerText = cuisine_text business_attr_row_0.appendChild(business_cuisine) if (business.special_count && business.special_count > 0) { const txt = business.special_count + ' ' + (business.special_count == 1 ? 'Special' : 'Specials') const span = document.createElement('div') span.classList.add('rh2-business-list-coupon-card-section-business-attr-row-1-special-count') span.innerText = txt business_attr_row_1.appendChild(span) } if (business.coupon_count && business.coupon_count > 0) { const txt = business.coupon_count + ' ' + (business.coupon_count == 1 ? 'Coupon' : 'Coupons') const span = document.createElement('div') span.classList.add('rh2-business-list-coupon-card-section-business-attr-row-1-coupon-count') span.innerText = txt business_attr_row_1.appendChild(span) } if (promotion.is_live && false) { const book_button = document.createElement('a') book_button.setAttribute('href', coupon_item_page_url) book_button.classList.add('rh2-business-list-coupon-card-book-button') book_button.innerText = 'See Details' promotion_el.appendChild(book_button) } return promotion_el } rh2.Coupon = Coupon })() </script> <script>// # site-0-booking-form ; (function() { const Booking = {} Booking.call_service_initial = function(vendor_slug, on_success) { const url = '/rh2/service/booking-form/initial-get/?vendor_slug=' + vendor_slug const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const s = e.target.responseText if (e.target.status == 200) { const resp = JSON.parse(s) if (on_success != undefined) { on_success(resp) } } }.bind(this)) xhr.open('GET', url) xhr.send() } Booking.call_service_dates = function(vendor_slug, pax, on_success) { const pairs = [ ['vendor_slug', vendor_slug], ['pax', pax] ] let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') const url = '/rh2/service/booking-form/dates-get/?' + querystring const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const rt = e.target.responseText const resp = JSON.parse(rt) var_promotions = resp.data.promotions var_dates = resp.data.dates if (on_success) { on_success(resp) } }.bind(this)) xhr.open('GET', url) xhr.send() } Booking.call_service_times = function(vendor_slug, pax, date, grid_el, force_refresh, on_success) { const pairs = [ ['vendor_slug', vendor_slug], ['pax', pax], ['force_refresh', force_refresh ? 'true' : 'false'] ] if (date != null) { pairs.push(['date', date]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') const url = '/rh2/service/booking-form/times-get/?' + querystring const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const rt = e.target.responseText let resp = null try { resp = JSON.parse(rt) } catch (e) { console.error(e) return } if (!resp.data) { // console.error(resp) return } if (resp.data.is_unavail_stale) { this.call_service_times(vendor_slug, pax, date, grid_el, true, on_success) return } const times = resp.data.times const slots = times.slots let has_av = false for (let i = 0; i < slots.length; i++) { const slot = slots[i] if (slot.av === true) { has_av = true } } resp.data.has_av = has_av if (times.is_closed) { var_promotions = [] } if (on_success) { on_success(resp) } }.bind(this)) xhr.open('GET', url) xhr.send() } Booking.call_service_reserve = function(vendor_slug, pax, date, time, first_name, last_name, email_address, phone_number, subscribe, promotions, book_option_matrix, guest_option_matrix, notes, ref, on_success, on_error) { const postdata = { form_data: { vendor_slug: vendor_slug, pax: pax, date: date, time: time, first_name: first_name, last_name: last_name, email_address: email_address, phone_number: phone_number, subscribe: subscribe, promotions: promotions, book_option_matrix: book_option_matrix, guest_option_matrix: guest_option_matrix, notes: notes, ref: ref, http_referer: '', } } const postdata_str = JSON.stringify(postdata) const url = '/rh2/service/booking-form/reserve-post/' const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const rt = e.target.responseText const resp = JSON.parse(rt) if (on_success) { on_success(resp) } }.bind(this)) try { xhr.open('POST', url) xhr.send(postdata_str) } catch (e) { on_error() } } Booking.call_service_stripe_token = function(br_rh_uuid, br_stripe_pubkey, card_number, card_exp_month, card_exp_year, card_cvc, on_success, on_error) { const postdata = { form_data: { br_rh_uuid: br_rh_uuid, br_stripe_pubkey: br_stripe_pubkey, card_number: card_number, card_exp_month: card_exp_month, card_exp_year: card_exp_year, card_cvc: card_cvc, } } const postdata_str = JSON.stringify(postdata) const url = '/rh2/service/booking-form/stripe-token-post/' const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const rt = e.target.responseText const resp = JSON.parse(rt) if (on_success) { on_success(resp) } }.bind(this)) try { xhr.open('POST', url) xhr.send(postdata_str) } catch (e) { on_error() } } Booking.call_service_post_reserve = function(br_rh_uuid, on_success, on_error) { const postdata = { form_data: { br_rh_uuid: br_rh_uuid, } } const postdata_str = JSON.stringify(postdata) const url = '/rh2/service/account/post-successful-booking-request-post/' const xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const rt = e.target.responseText const resp = JSON.parse(rt) if (on_success) { on_success(resp) } }.bind(this)) try { xhr.open('POST', url) xhr.send(postdata_str) } catch (e) { on_error() } } Booking.fire_event_purchase = function(pax, br_rh_uuid, vendor_slug, booking) { const price = booking.is_hotdeal ? 3 : 2.5 const value = price * pax let event_category = 'BOOKING' if (booking.is_special) { event_category = 'SPECIAL' } if (booking.is_hotdeal) { event_category = 'HOTDEAL' } try { window.gtag && gtag('event', 'purchase', { event_category: event_category, transaction_id: (new Date()).getTime() + '.' + Math.random().toString(), currency: 'NZD', value: value, items: [{ id: br_rh_uuid, name: 'RESERVATION', brand: vendor_slug, category: 'RESERVATION', price: price, quantity: pax, }] }) } catch (e) { console.error(e) } try { window.fbq && fbq('track', 'Purchase', { currency: 'NZD', value: value, content_category: event_category, contents: [{ id: br_rh_uuid, quantity: pax, }] }) } catch (e) { console.error(e) } } Booking.fire_event_add_to_cart = async function(pax) { // const value = 2.5 * pax const value = 0 // no value needed for this event, should be added on purchase let gtag_loaded = await rh2.utils.wait_objects(['gtag']) if (gtag_loaded) { try { window.gtag && gtag('event', 'add_to_cart', { currency: 'NZD', value: value, }) } catch (e) { console.error(e) } } else { console.error('window.gtag undefined') } let fbq_loaded = await rh2.utils.wait_objects(['fbq']) if (fbq_loaded) { try { window.fbq && fbq('track', 'AddToCart', { currency: 'NZD', value: value, }) } catch (e) { console.error(e) } } else { console.error('window.fbq undefined') } } Booking.render_calendar_view = function(cfg) { let today = rh2.utils.get_today_str() let fm = cfg.fm let layout = cfg.layout if (layout === undefined) { if (fm.is_desktop()) { layout = 'DESKTOP' } else { layout = 'MOBILE' } } // DEV let var_date = cfg.date || today let first_avail_date = today let var_pax = cfg.pax || '' let var_promotions = [] let var_slug = cfg.business_slug let var_special = cfg.special || null let var_time = '' let var_special_id_list = new Set() let var_special_type = 'specials_all' let var_render_specials = true let business_info = { name: '', logo_image_url: '', } let business_setup = { book_interval: 30, pax_options: [], book_options: [], guest_options: [], does_accept_notes: false, dates_closed: [], } const date_default = var_date || first_avail_date var_date = date_default const dialogue_container = document.createElement('div') dialogue_container.addEventListener('click', function(e) { e.stopPropagation() }) if (layout == 'DESKTOP') { dialogue_container.classList.add('rh2-booking-dialogue-container-desktop') //this.full_screen_overlay_translucent.appendChild(dialogue_container) } else { dialogue_container.classList.add('rh2-booking-dialogue-container-mobile') //this.full_screen_overlay_translucent.appendChild(dialogue_container) } const heading_row = document.createElement('div') heading_row.classList.add('rh2-booking-dialogue-heading') heading_row.innerText = 'Book a table' dialogue_container.appendChild(heading_row) const close_button = document.createElement('div') close_button.classList.add('rh2-booking-dialogue-close') dialogue_container.appendChild(close_button) close_button.addEventListener('click', function(e) { document.querySelector('.rh2-booking-full-screen-overlay-translucent').click() }) const dialogue_body_row = document.createElement('div') if (layout == 'DESKTOP') { dialogue_body_row.classList.add('rh2-booking-dialogue-body-desktop') } else { dialogue_body_row.classList.add('rh2-booking-dialogue-body-mobile') } dialogue_container.appendChild(dialogue_body_row) const dialogue_left_column = document.createElement('div') if (layout == 'DESKTOP') { dialogue_left_column.classList.add('rh2-booking-dialogue-left-column-desktop') } else { dialogue_left_column.classList.add('rh2-booking-dialogue-left-column-mobile') } dialogue_body_row.appendChild(dialogue_left_column) const dialogue_middle_column = document.createElement('div') if (layout == 'DESKTOP') { dialogue_middle_column.classList.add('rh2-booking-dialogue-middle-column-desktop') } else { dialogue_middle_column.classList.add('rh2-booking-dialogue-middle-column-mobile') } dialogue_body_row.appendChild(dialogue_middle_column) const dialogue_right_column = document.createElement('div') if (layout == 'DESKTOP') { dialogue_right_column.classList.add('rh2-booking-dialogue-right-column-desktop') } else { dialogue_right_column.classList.add('rh2-booking-dialogue-right-column-mobile') } dialogue_body_row.appendChild(dialogue_right_column) const pdt_overlay = document.createElement('div') pdt_overlay.classList.add('rh2-booking-dialogue-pax-overlay') pdt_overlay.addEventListener('click', function(e) { pdt_overlay.classList.remove('rh2-booking-dialogue-pax-overlay-active') }) dialogue_container.appendChild(pdt_overlay) const highlight_overlay = document.createElement('div') highlight_overlay.classList.add('rh2-booking-dialogue-highlight-overlay') highlight_overlay.addEventListener('click', function(e) { highlight_overlay.classList.remove('rh2-booking-dialogue-highlight-overlay-active') }) dialogue_container.appendChild(highlight_overlay) const pdt_area = document.createElement('div') pdt_area.classList.add('rh2-booking-dialogue-pdt-area') dialogue_left_column.appendChild(pdt_area) const pdt_bar = document.createElement('div') pdt_bar.classList.add('rh2-booking-dialogue-pdt-bar') pdt_area.appendChild(pdt_bar) const pdt_pax_col = document.createElement('div') pdt_pax_col.classList.add('rh2-booking-dialogue-pdt-pax-col') pdt_bar.appendChild(pdt_pax_col) const pdt_pax_icon = document.createElement('div') pdt_pax_icon.classList.add('rh2-booking-dialogue-pdt-pax-icon') pdt_pax_col.appendChild(pdt_pax_icon) const pdt_pax_span = document.createElement('div') pdt_pax_span.classList.add('rh2-booking-dialogue-pdt-pax-span') pdt_pax_span.innerText = var_pax pdt_pax_col.appendChild(pdt_pax_span) pdt_pax_col.addEventListener('click', function(e) { pdt_overlay.classList.add('rh2-booking-dialogue-pax-overlay-active') pdt_overlay.innerHTML = '' const pdt_overlay_content_area = document.createElement('div') pdt_overlay_content_area.classList.add('rh2-booking-dialogue-pax-overlay-content-area') pdt_overlay_content_area.addEventListener('click', function(e) { e.stopPropagation() }) pdt_overlay.appendChild(pdt_overlay_content_area) let selected_row = null const options = business_setup.pax_options for (let i = 0; i < options.length; i++) { const option = options[i] const value = option.value const pax_row = document.createElement('div') pax_row.classList.add('rh2-booking-dialogue-overlay-pax-row') if (var_pax != null && value == var_pax) { pax_row.classList.add('rh2-booking-dialogue-overlay-pax-row-selected') selected_row = pax_row } pax_row.innerText = value pax_row.addEventListener('click', function() { pdt_overlay.classList.remove('rh2-booking-dialogue-pax-overlay-active') var_pax = value pdt_pax_span.innerText = var_pax }) pdt_overlay_content_area.appendChild(pax_row) } if (selected_row != null) { const offset_top = selected_row.offsetTop const scroll_top = Math.max(offset_top - 96, 0) pdt_overlay_content_area.scrollTop = scroll_top } }.bind(this)) const pdt_date_col = document.createElement('div') pdt_date_col.classList.add('rh2-booking-dialogue-pdt-date-col') pdt_bar.appendChild(pdt_date_col) const pdt_date_icon = document.createElement('div') pdt_date_icon.classList.add('rh2-booking-dialogue-pdt-date-icon') pdt_date_col.appendChild(pdt_date_icon) const pdt_date_span = document.createElement('div') pdt_date_span.classList.add('rh2-booking-dialogue-pdt-date-span') pdt_date_span.innerText = rh2.utils.repr_date(date_default) pdt_date_col.appendChild(pdt_date_span) pdt_date_col.addEventListener('click', function(e) {}.bind(this)) const pdt_calendar = document.createElement('div') pdt_calendar.classList.add('rh2-booking-dialogue-pdt-calendar') const pdt_calendar_container = document.createElement('div') pdt_calendar_container.classList.add('rh2-booking-dialogue-pdt-calendar-container') pdt_calendar.appendChild(pdt_calendar_container) if (layout == 'DESKTOP') { pdt_area.appendChild(pdt_calendar) } else { pdt_area.appendChild(pdt_calendar) } const special_tabs_row = document.createElement('div') special_tabs_row.classList.add('rh2-booking-special-tabs-row') dialogue_right_column.appendChild(special_tabs_row) const special_tab_all = document.createElement('div') special_tab_all.classList.add('rh2-booking-special-tabs-item') special_tab_all.classList.add('rh2-booking-special-tabs-all') special_tab_all.classList.add('selected') special_tabs_row.appendChild(special_tab_all) const special_tab_all_label = document.createElement('div') special_tab_all_label.classList.add('rh2-booking-special-tabs-item-label') special_tab_all_label.innerText = 'All' special_tab_all.appendChild(special_tab_all_label) const special_tab_specials = document.createElement('div') special_tab_specials.classList.add('rh2-booking-special-tabs-item') special_tab_specials.classList.add('rh2-booking-special-tabs-specials') special_tabs_row.appendChild(special_tab_specials) const special_tab_specials_label = document.createElement('div') special_tab_specials_label.classList.add('rh2-booking-special-tabs-item-label') special_tab_specials_label.innerHTML = '<span class="rh2-booking-special-tabs-item-icon"></span> Specials' special_tab_specials.appendChild(special_tab_specials_label) const special_tab_hotdeal = document.createElement('div') special_tab_hotdeal.classList.add('rh2-booking-special-tabs-item') special_tab_hotdeal.classList.add('rh2-booking-special-tabs-hotdeal') special_tabs_row.appendChild(special_tab_hotdeal) const special_tab_hotdeal_label = document.createElement('div') special_tab_hotdeal_label.classList.add('rh2-booking-special-tabs-item-label') special_tab_hotdeal_label.innerHTML = '<span class="rh2-booking-special-tabs-item-icon"></span> Hot Deals' special_tab_hotdeal.appendChild(special_tab_hotdeal_label) const special_tabs_ar = [special_tab_all, special_tab_specials, special_tab_hotdeal] $(special_tabs_ar).on('click', function(e) { $(special_tabs_ar).removeClass('selected') $(this).addClass('selected') var_special_type = 'specials_all' if ($(this).is(special_tab_specials)) { var_special_type = 'specials_s' } if ($(this).is(special_tab_hotdeal)) { var_special_type = 'specials_hd' } highlight_specials(var_special_type) }) // update heading text on tab switch or times load const render_specials_heading = function(type, ct, times = null) { let stype_text = (type == 'specials_hd') ? 'Hot Deal' : 'Special' if (times && times.is_closed) { specials_heading.innerText = 'No availability on selected date.' } else if (ct > 1) { specials_heading.innerText = ct + ' ' + stype_text + 's available on the day' } else if (ct == 1) { specials_heading.innerText = ct + ' ' + stype_text + ' available on the day' } else { specials_heading.innerText = 'No ' + stype_text + 's available on the day' } } const highlight_specials = function(type) { specials_area.innerHTML = '' let ct = 0 for (let promotion of var_promotions) { if (!(var_special_id_list.has(promotion.uuid))) { continue } if (type == 'specials_s' && promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { continue } if (type == 'specials_hd' && promotion.structure !== 'TABLE_DISCOUNT_HOT_DEAL') { continue } if (!promotion.valid_for_date) { continue } render_promotion(promotion) ct++ } render_specials_heading(type, ct) } const specials_heading = this.dialogue_specials_heading = document.createElement('div') specials_heading.classList.add('rh2-booking-dialogue-specials-heading') dialogue_right_column.appendChild(specials_heading) const specials_area = this.dialogue_specials_area = document.createElement('div') specials_area.classList.add('rh2-booking-dialogue-specials-area') dialogue_right_column.appendChild(specials_area) const continue_button = document.createElement('div') continue_button.classList.add('rh2-booking-dialogue-continue-button') continue_button.innerText = 'Continue to book' dialogue_right_column.appendChild(continue_button) continue_button.addEventListener('click', function() { if (cfg.continue == null) { let url = [ '', 'rh2', 'eats', 'in-region', cfg.region_slug || 'null', 'in-city', cfg.city_slug || 'null', 'in-suburb', cfg.suburb_slug || 'null', cfg.slug, 'booking', '', ].join('/') let pairs = [ ['av_date', var_date], ['av_pax', var_pax] ] if (cfg.referrer) { pairs.push(['referrer', cfg.referrer]) } if (var_special) { pairs.push(['special', var_special]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { url = url + '?' + querystring } document.location.href = url } else { const data = { date: var_date, pax: var_pax, } cfg.continue(data) } }.bind(this)) const render_promotion = function(promotion) { const promotion_title = rh2.Promotion.get_promotion_title(promotion) const item = document.createElement('div') item.classList.add('rh2-booking-dialogue-specials-item') specials_area.appendChild(item) const star = document.createElement('div') const star_class = (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL' ? 'rh2-booking-dialogue-specials-item-star-hd' : 'rh2-booking-dialogue-specials-item-star') star.classList.add(star_class) item.appendChild(star) const title = document.createElement('div') title.classList.add('rh2-booking-dialogue-specials-item-title') title.innerText = promotion_title item.appendChild(title) const info = document.createElement('div') info.classList.add('rh2-booking-dialogue-specials-item-info') item.appendChild(info) if (promotion.uuid == var_special) { item.classList.add('selected') } $(item).click((e) => { // temporarily disable highlight event return let is_selected = $(item).hasClass('selected') $('.rh2-booking-dialogue-specials-item').removeClass('selected') if (is_selected) { var_special = null } else { $(item).addClass('selected') var_special = promotion.uuid } // render calendar to highlight selected special dates, skip re-render specials var_render_specials = false Booking.render_calendar(!is_selected) var_render_specials = true }) } const render_specials = function() { if (!var_render_specials) { return } if (var_promotions.length == 0) { let times = null if (var_date && var_dates) { for (let date_ar of var_dates) { if (date_ar[0] == var_date) { if (!date_ar[2]) { times = { is_closed: true } break } } else { times = null } } } render_specials_heading(var_special_type, 0, times) return } specials_heading.innerHTML = '' specials_area.innerHTML = '' const loader_gif = el('span') loader_gif.classList.add('rh2-booking-confirm-loader') loader_gif.style.display = 'block' loader_gif.style.margin = '20px auto' specials_area.appendChild(loader_gif) this.call_service_times(var_slug, var_pax, var_date, null, false, function(resp) { specials_area.innerHTML = '' times = resp.data.times slots = times.slots var_promotions = resp.data.promotions var_special_id_list = new Set() for (let i = 0; i < slots.length; i++) { const slot = slots[i] if (!slot.av) { continue } for (let promotion_uuid of slot.promotions) { var_special_id_list.add(promotion_uuid) } } let ct = 0 for (let promotion of var_promotions) { if (!(var_special_id_list.has(promotion.uuid))) { continue } if (var_special_type == 'specials_s' && promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { continue } if (var_special_type == 'specials_hd' && promotion.structure !== 'TABLE_DISCOUNT_HOT_DEAL') { continue } if (!promotion.valid_for_date) { continue } render_promotion(promotion) ct++ } render_specials_heading(var_special_type, ct, times) }.bind(this)) }.bind(this) // fetching and rendering specials should occur only on date change // selecting highlight special should not re-render the whole list // only filter list by selected type and switch classes this.render_calendar = function(highlight_special = false) { pdt_calendar_container.innerHTML = '' pdt_date_span.innerText = rh2.utils.repr_date(var_date) const calendar = new rh2.Calendar({ date: var_date || first_avail_date, min_date: first_avail_date, num_months: 1, promotions: var_promotions, dates: var_dates, special_uuid: highlight_special ? var_special : null, dates_closed: business_setup.dates_closed, onselect: function(value) { var_date = value pdt_date_span.innerText = rh2.utils.repr_date(var_date) render_specials() }.bind(this) }) calendar.render(pdt_calendar_container) calendar.render_date() render_specials() } this.call_service_initial(var_slug, function(resp) { const data = resp.data today = data.today business_setup = data.setup const info = data.info business_info.name = info.name business_info.logo_image_url = info.logo_image_url if (var_pax != '') { let is_pax_valid = false for (let pax_option of business_setup.pax_options) { if (pax_option.value == var_pax) { is_pax_valid = true } } if (is_pax_valid == false) { var_pax = '' } } if (var_pax == '') { for (let pax_option of business_setup.pax_options) { if (pax_option.is_selected) { var_pax = pax_option.value pdt_pax_span.innerText = var_pax } } } this.call_service_dates(var_slug, var_pax, function(resp) { var_promotions = [] for (let promotion of resp.data.promotions) { if (promotion.ppf == 'PRESENT' || promotion.ppf == 'FUTURE') { var_promotions.push(promotion) } } var_dates = resp.data.dates for (let date_ar of var_dates) { if (date_ar[2]) { var_date = date_ar[0] first_avail_date = date_ar[0] break } } this.render_calendar() }.bind(this)) }.bind(this)) return dialogue_container } rh2.Booking = Booking })()</script> <script>// Home ; (function() { const Fragment = function() { rh2.Fragment.call(this) } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'Home' } fragment.render_discover_locations = function(container) { const discover_locations_el = container if (this.fm.is_desktop()) { discover_locations_el.classList.add('rh2-home-discover-locations-desktop') } else { discover_locations_el.classList.add('rh2-home-discover-locations-mobile') } discover_locations_el.innerHTML = '' { const title = document.createElement('div') title.classList.add('rh2-home-discover-locations-title') title.innerText = "Discover Locations" discover_locations_el.appendChild(title) } { const grid = document.createElement('grid_ni') grid.classList.add('rh2-home-discover-locations-grid') discover_locations_el.appendChild(grid) { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Auckland' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['auckland-region'], 'loc_text': ['Auckland Region'], 'loc_code': ['(Region) Auckland Region'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Hamilton' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['waikato-region'], 'city': ['hamilton-city'], 'loc_text': ['Hamilton City'], 'loc_code': ['(City) Hamilton City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Tauranga' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ["bay-of-plenty-region"], 'city': ['tauranga-city'], 'loc_text': ['Tauranga City'], 'loc_code': ['(City) Tauranga City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Wellington' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ["wellington-region"], 'loc_text': ['Wellington Region'], 'loc_code': ['(Region) Wellington Region'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Christchurch' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['canterbury-region'], 'city': ['christchurch-city'], 'loc_text': ['Christchurch City'], 'loc_code': ['(City) Christchurch City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Queenstown' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['otago-region'], 'city': ['queenstown-lakes-district'], 'suburb': ['queenstown'], 'loc_text': ['Queenstown'], 'loc_code': ['(Suburb) Queenstown'] }) }.bind(this)) } if (discover_locations_el.getAttribute('rh2-home-discover-locations-seeing-all') != 'true') { { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.classList.add('rh2-home-discover-locations-grid-item-see-all') item_el.innerText = 'See all' grid.appendChild(item_el) item_el.addEventListener('click', function() { discover_locations_el.setAttribute('rh2-home-discover-locations-seeing-all', 'true') this.render_discover_locations(discover_locations_el) }.bind(this)) } } else { { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Whangarei' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['northland-region'], 'city': ['whangarei-district'], 'loc_text': ['Whangarei District'], 'loc_code': ['(City) Whangarei District'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Napier' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ["hawkes-bay-region"], 'city': ['napier-city'], 'loc_text': ['Napier City'], 'loc_code': ['(City) Napier City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'New Plymouth' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ["taranaki-region"], 'city': ['new-plymouth-district'], 'loc_text': ['New Plymouth District'], 'loc_code': ['(City) New Plymouth District'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Rotorua' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ["bay-of-plenty-region"], 'city': ['rotorua-district'], 'loc_text': ['Rotorua District'], 'loc_code': ['(City) Rotorua District'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Palmerston North' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ["manawatu-wanganui-region"], 'city': ['palmerston-north-city'], 'loc_text': ['Palmerston North City'], 'loc_code': ['(City) Palmerston North City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Dunedin' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['otago-region'], 'city': ['dunedin-city'], 'loc_text': ['Dunedin City'], 'loc_code': ['(City) Dunedin City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Nelson' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['nelson-region'], 'city': ['nelson-city'], 'loc_text': ['Nelson City'], 'loc_code': ['(City) Nelson City'] }) }.bind(this)) } { const item_el = document.createElement('td') item_el.classList.add('rh2-home-discover-locations-grid-item') item_el.innerText = 'Oamaru' grid.appendChild(item_el) item_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', { __CLEAR__: true, 'region': ['otago-region'], 'city': ['waitaki-district'], 'suburb': ['Oamaru'], 'loc_text': ['Oamaru'], 'loc_code': ['(Suburb) Oamaru'] }) }.bind(this)) } } } } fragment._render = function() { const is_desktop = this.fm.is_desktop() this.el.innerHTML = '' this.el.classList.add('rh2-fragment-home') if (is_desktop) { this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') } //this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const blfm = this.fm.fragments_m.get('BusinessList') const row_fw_el = document.createElement('div') row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(row_fw_el) if (this.fm.is_mobile()) { const row_mobile_header_el = document.createElement('div') row_mobile_header_el.classList.add('rh2-row-pw') row_mobile_header_el.classList.add('rh2-home-row-mobile-header') row_fw_el.appendChild(row_mobile_header_el) const bg_row = document.createElement('div') bg_row.classList.add('rh2-home-row-mobile-header-bg-row') row_mobile_header_el.appendChild(bg_row) const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, layout: 'HOME', }) const appbar_el = appbar.render() bg_row.appendChild(appbar_el) const tabs_el = document.createElement('div') tabs_el.classList.add('rh2-home-tabs') bg_row.appendChild(tabs_el) const loc = appbar.get_current_location() { const tab_item_el = document.createElement('a') let params = { category: 'ALL' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = loc.loc_code params.loc_text = loc.loc_text } let url = rh2.utils.modify_href('/rh2/eats/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-bookable') tab_item_el.innerText = 'Restaurants' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-book-icon') $(tab_item_el).prepend(icon_el) } { const tab_item_el = document.createElement('a') let params = { category: 'ALL' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats-mobile-map/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-map') tab_item_el.innerText = 'Map' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-map-icon') $(tab_item_el).prepend(icon_el) } { const tab_item_el = document.createElement('a') let params = { category: 'SPECIAL' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-special') tab_item_el.innerText = 'Specials' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-special-icon') $(tab_item_el).prepend(icon_el) } { const tab_item_el = document.createElement('a') let params = { category: 'SPECIAL_HD' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-special-hd') tab_item_el.innerText = 'Hot Deals!' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-special-hd-icon') $(tab_item_el).prepend(icon_el) } const discover_locations_el = document.createElement('div') discover_locations_el.classList.add('rh2-row-pw') row_mobile_header_el.appendChild(discover_locations_el) this.render_discover_locations(discover_locations_el) } else { // appbar-desktop const top_bar = new rh2.AppBar({ f: this, fm: this.fm, layout: 'HOME', variant: 'HOME_TOP', }) const top_bar_el = top_bar.render() row_fw_el.appendChild(top_bar_el) const row_desktop_header_el = document.createElement('div') row_desktop_header_el.classList.add('rh2-row-pw') row_desktop_header_el.classList.add('rh2-home-row-desktop-header') row_fw_el.appendChild(row_desktop_header_el) const bg_row = document.createElement('div') bg_row.classList.add('rh2-home-row-desktop-header-bg-row') row_fw_el.appendChild(bg_row) const row_pw_el = document.createElement('div') row_pw_el.classList.add('rh2-row-pw') bg_row.appendChild(row_pw_el) const header_wrapper = document.createElement('div') header_wrapper.classList.add('rh2-home-row-desktop-header-wrapper') row_pw_el.appendChild(header_wrapper) const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, layout: 'HOME', variant: 'HOME_HEADER', }) const appbar_el = appbar.render() header_wrapper.appendChild(appbar_el) const tabs_el = document.createElement('div') tabs_el.classList.add('rh2-home-tabs') header_wrapper.appendChild(tabs_el) let loc = appbar.get_current_location() { const tab_item_el = document.createElement('a') let params = { category: 'ALL' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-bookable') tab_item_el.innerText = 'Restaurants' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-book-icon') $(tab_item_el).prepend(icon_el) } { const tab_item_el = document.createElement('a') let params = { category: 'SPECIAL' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-special') tab_item_el.innerText = 'Specials' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-special-icon') $(tab_item_el).prepend(icon_el) } { const tab_item_el = document.createElement('a') let params = { category: 'SPECIAL_HD' } if (loc && loc.loc_code && loc.loc_text) { params.loc_code = [loc.loc_code] params.loc_text = [loc.loc_text] } let url = rh2.utils.modify_href('/rh2/eats/', params) tab_item_el.href = url.url_rel tab_item_el.classList.add('rh2-home-tab-item') tab_item_el.classList.add('rh2-home-tab-special-hd') tab_item_el.innerText = 'Hot Deals!' tabs_el.appendChild(tab_item_el) const icon_el = document.createElement('div') icon_el.classList.add('rh2-business-card-mobile-action-icon') icon_el.classList.add('rh2-business-card-mobile-action-special-hd-icon') $(tab_item_el).prepend(icon_el) } const full_screen_overlay_translucent = this.full_screen_overlay_translucent = document.createElement('div') full_screen_overlay_translucent.classList.add('rh2-full-screen-overlay-translucent') this.el.appendChild(full_screen_overlay_translucent) const discover_locations_el = document.createElement('div') discover_locations_el.classList.add('rh2-row-pw') header_wrapper.appendChild(discover_locations_el) this.render_discover_locations(discover_locations_el) } const calc_homepage_specials_height = function(num_items) { let height = 0 if (is_desktop) { let num_rows = Math.ceil(num_items / 2) height = num_rows * 280 } else { height = 434 * num_items } return height } const calc_homepage_restaurants_height = function(num_items) { let height = 0 if (is_desktop) { let num_rows = Math.ceil(num_items / 2) height = num_rows * 196 } else { height = 262 * num_items } return height } if (rh2.config.homepage_restaurants !== undefined && rh2.config.homepage_restaurants.length) { const section_restaurants = document.createElement('div') section_restaurants.classList.add('rh2-row-pw') section_restaurants.classList.add('rh2-home-section') section_restaurants.classList.add('rh2-home-section-restaurants') row_fw_el.appendChild(section_restaurants) const section_restaurants_heading = document.createElement('div') section_restaurants_heading.classList.add('rh2-row-pw') section_restaurants_heading.classList.add('rh2-home-section-restaurants-heading') section_restaurants.appendChild(section_restaurants_heading) const section_restaurants_heading_text = document.createElement('div') section_restaurants_heading_text.classList.add('rh2-home-section-restaurants-heading-text') section_restaurants_heading_text.innerText = rh2.config.homepage_restaurants_title || 'Promoted restaurants' section_restaurants_heading.appendChild(section_restaurants_heading_text) const section_restaurants_body = document.createElement('div') section_restaurants_body.classList.add('rh2-row-pw') section_restaurants_body.classList.add('rh2-home-section-restaurants-body') section_restaurants_body.style.minHeight = calc_homepage_restaurants_height(rh2.config.homepage_restaurants.length) + 'px' section_restaurants.appendChild(section_restaurants_body) } const section_articles = document.createElement('div') section_articles.classList.add('rh2-row-pw') section_articles.classList.add('rh2-home-section') section_articles.classList.add('rh2-home-section-articles') row_fw_el.appendChild(section_articles) const section_articles_heading = document.createElement('div') section_articles_heading.classList.add('rh2-home-section-articles-heading') section_articles_heading.innerText = 'News and Discoveries' section_articles.appendChild(section_articles_heading) const section_articles_body = document.createElement('div') section_articles_body.classList.add('rh2-home-section-articles-body') section_articles.appendChild(section_articles_body) const section_articles_wrapper = document.createElement('div') section_articles_wrapper.classList.add('rh2-home-section-articles-wrapper') section_articles_body.appendChild(section_articles_wrapper) const section_articles_container = document.createElement('div') section_articles_container.classList.add('rh2-home-section-articles-container') section_articles_wrapper.appendChild(section_articles_container) const section_special = document.createElement('div') section_special.classList.add('rh2-row-pw') section_special.classList.add('rh2-home-section') section_special.classList.add('rh2-home-section-special') row_fw_el.appendChild(section_special) const section_special_heading = document.createElement('div') section_special_heading.classList.add('rh2-row-pw') section_special_heading.classList.add('rh2-home-section-special-heading') section_special.appendChild(section_special_heading) const section_special_heading_text = document.createElement('div') section_special_heading_text.classList.add('rh2-home-section-special-heading-text') section_special_heading_text.innerText = 'Bookable Upgrades & Specials' section_special_heading.appendChild(section_special_heading_text) const section_special_heading_link = document.createElement('a') section_special_heading_link.classList.add('rh2-home-section-special-heading-link') section_special_heading_link.setAttribute('href', '/rh2/eats/?category=SPECIAL') section_special_heading_link.innerText = 'BROWSE ALL >' section_special_heading.appendChild(section_special_heading_link) const section_special_body = document.createElement('div') section_special_body.classList.add('rh2-row-pw') section_special_body.classList.add('rh2-home-section-special-body') // section_special_body.style.minHeight = calc_homepage_specials_height(rh2.config.homepage_specials.length) + 'px' section_special.appendChild(section_special_body) if (rh2.config.homepage_coupons_status == 'enabled') { const section_coupon = document.createElement('div') section_coupon.classList.add('rh2-row-pw') section_coupon.classList.add('rh2-home-section') section_coupon.classList.add('rh2-home-section-coupon') row_fw_el.appendChild(section_coupon) const section_coupon_heading = document.createElement('div') section_coupon_heading.classList.add('rh2-row-pw') section_coupon_heading.classList.add('rh2-home-section-coupon-heading') section_coupon.appendChild(section_coupon_heading) const section_coupon_heading_text = document.createElement('div') section_coupon_heading_text.classList.add('rh2-home-section-coupon-heading-text') section_coupon_heading_text.innerText = 'Takeaway Upgrades & Offers' section_coupon_heading.appendChild(section_coupon_heading_text) const section_coupon_heading_link = document.createElement('a') section_coupon_heading_link.classList.add('rh2-home-section-coupon-heading-link') section_coupon_heading_link.setAttribute('href', '/rh2/eats/?category=COUPON') section_coupon_heading_link.innerText = 'BROWSE ALL >' section_coupon_heading.appendChild(section_coupon_heading_link) const section_coupon_body = document.createElement('div') section_coupon_body.classList.add('rh2-row-pw') section_coupon_body.classList.add('rh2-home-section-coupon-body') section_coupon.appendChild(section_coupon_body) } const row_5_el = document.createElement('div') row_5_el.classList.add('rh2-row-pw') row_5_el.classList.add('rh2-home-row-5') row_5_el.classList.add('rh2-home-section') row_fw_el.appendChild(row_5_el) const row_6_el = document.createElement('div') row_6_el.classList.add('rh2-row-pw') row_6_el.classList.add('rh2-home-row-6') row_6_el.classList.add('rh2-home-section') row_fw_el.appendChild(row_6_el) const section_restaurateurs_body_el = document.createElement('div') section_restaurateurs_body_el.classList.add('rh2-row') section_restaurateurs_body_el.classList.add('rh2-home-section-body') section_restaurateurs_body_el.classList.add('rh2-home-section-body-restaurateurs') row_6_el.appendChild(section_restaurateurs_body_el) const section_restaurateurs_heading_el = document.createElement('div') section_restaurateurs_heading_el.classList.add('rh2-row') section_restaurateurs_heading_el.classList.add('rh2-home-section-restaurateurs-heading') section_restaurateurs_heading_el.innerText = 'Restaurateurs, Join Us' section_restaurateurs_body_el.appendChild(section_restaurateurs_heading_el) const section_restaurateurs_description_el = document.createElement('div') section_restaurateurs_description_el.classList.add('rh2-row') section_restaurateurs_description_el.classList.add('rh2-home-section-restaurateurs-description') section_restaurateurs_description_el.innerText = "Restaurant Hub is New Zealand's largest online booking network. Join now for us to help you connect customers to your restaurant." section_restaurateurs_body_el.appendChild(section_restaurateurs_description_el) const section_restaurateurs_action_row_el = document.createElement('div') section_restaurateurs_action_row_el.classList.add('rh2-row') section_restaurateurs_action_row_el.classList.add('rh2-home-section-restaurateurs-action-row') section_restaurateurs_body_el.appendChild(section_restaurateurs_action_row_el) const section_restaurateurs_action_button_el = document.createElement('a') section_restaurateurs_action_button_el.classList.add('rh2-home-section-restaurateurs-action-button') section_restaurateurs_action_button_el.innerText = 'LEARN MORE >' section_restaurateurs_action_button_el.setAttribute('href', 'https://www.restauranthub.co.nz/for-restaurants/joining-restaurant-hub/') section_restaurateurs_action_row_el.appendChild(section_restaurateurs_action_button_el) const footer = rh2.Footer.build() this.el.appendChild(footer) this.load_articles() //load_content_tiles() this.load_promotions() this.appbar.location_dialog() } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2\\/?$') ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/' } rh2.fragment_manager.register(fragment) const render_articles_section = function(cfg, object_list) { const section_articles = document.getElementsByClassName('rh2-home-section-articles')[0] const section_articles_container = document.getElementsByClassName('rh2-home-section-articles-container')[0] const section_articles_heading = document.getElementsByClassName('rh2-home-section-articles-heading')[0] const section_articles_body = document.getElementsByClassName('rh2-home-section-articles-body')[0] const section_articles_wrapper = document.getElementsByClassName('rh2-home-section-articles-wrapper')[0] //const _object_list = object_list.slice(0, Math.min(16, object_list.length)) const _object_list = object_list const body_width = parseFloat(window.getComputedStyle(section_articles_body).getPropertyValue('width')) let section_container_width = 0 let item_width = 0 for (let i = 0; i < _object_list.length; i++) { const obj_data = _object_list[i] const el = document.createElement('div') el.classList.add('rh2-home-section-articles-item') el.style.maxWidth = body_width + 'px' section_articles_container.appendChild(el) el.addEventListener('click', function() { const url = '/rh2/article/' + obj_data.slug + '/' window.location.href = url }.bind(this)) const image_wrap = document.createElement('div') image_wrap.classList.add('rh2-home-section-articles-item-image') const image_el = document.createElement('img') image_el.src = obj_data.list_image_url image_el.alt = obj_data.title image_el.setAttribute('loading', 'lazy') image_wrap.appendChild(image_el) el.appendChild(image_wrap) const footer_el = document.createElement('div') footer_el.classList.add('rh2-home-section-articles-item-footer') el.appendChild(footer_el) const title_row_el = document.createElement('div') title_row_el.innerText = obj_data.title title_row_el.classList.add('rh2-home-section-articles-item-title-row') footer_el.appendChild(title_row_el) const author_row_el = document.createElement('div') author_row_el.classList.add('rh2-home-section-articles-item-author-row') footer_el.appendChild(author_row_el) const author_el = document.createElement('div') author_el.innerText = obj_data.author && ('by ' + obj_data.author + ',') || '' author_el.classList.add('rh2-home-section-articles-item-author') author_row_el.appendChild(author_el) if (obj_data.published_at) { const _published_at_str = obj_data.published_at.substring(0, 10) const _published_at_str_repr = rh2.utils.repr_date(_published_at_str) const d = new Date(obj_data.published_at) const published_at_el = document.createElement('div') published_at_el.innerText = _published_at_str_repr published_at_el.classList.add('rh2-home-section-articles-item-published-at') author_row_el.appendChild(published_at_el) } item_width = parseFloat(window.getComputedStyle(el).getPropertyValue('width')) + 16 section_container_width += item_width } section_articles_container.style.width = section_container_width + 'px' const nav_button_click = function(direction) { return function(e) { const body_width = parseFloat(window.getComputedStyle(section_articles_body).getPropertyValue('width')) const container_width = parseFloat(window.getComputedStyle(section_articles_container).getPropertyValue('width')) const current_scroll_left = section_articles_wrapper.scrollLeft //const current_idx = parseInt(current_scroll_left / (body_width - 1)) const current_idx = parseInt(current_scroll_left / (item_width - 1)) let num_items_per_screen = 1 if (item_width > 400) { num_items_per_screen = 2 } let new_idx = current_idx + num_items_per_screen * (direction === 'prev' ? -1 : 1) new_idx = Math.min(Math.max(new_idx, 0), _object_list.length) const new_scroll_left = new_idx * item_width section_articles_wrapper.scrollLeft = new_scroll_left } } const prev_el = document.createElement('div') prev_el.classList.add('rh2-home-section-articles-nav') prev_el.classList.add('rh2-home-section-articles-prev') prev_el.innerHTML = '<' prev_el.addEventListener('click', nav_button_click('prev')) section_articles.appendChild(prev_el) const next_el = document.createElement('div') next_el.classList.add('rh2-home-section-articles-nav') next_el.classList.add('rh2-home-section-articles-next') next_el.innerHTML = '>' next_el.addEventListener('click', nav_button_click('next')) section_articles.appendChild(next_el) } fragment.load_articles = function(cfg) { let url = '/rh2/service/article/article-list-get/' let xhr = new XMLHttpRequest() xhr.addEventListener("load", function() { const s = this.responseText const rtn = JSON.parse(s) const data = rtn.data render_articles_section(cfg, data.object_list) }) xhr.open("GET", url); xhr.send(); } fragment.load_promotions = function(cfg) { if (rh2.config.homepage_restaurants !== undefined && rh2.config.homepage_restaurants.length) { for (let i in rh2.config.homepage_restaurants) { let restaurant = rh2.config.homepage_restaurants[i] if (!restaurant) { continue } // create container first to keep items order const restaurant_item_el = document.createElement('div') restaurant_item_el.classList.add('rh2-home-section-restaurants-body-item') document.getElementsByClassName('rh2-home-section-restaurants-body')[0].appendChild(restaurant_item_el) let url = '/rh2/service/business/business_item_get/' + restaurant.slug let xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const business = rtn.data const card = new rh2.BusinessCard(business, {}, fragment).render() restaurant_item_el.appendChild(card) }.bind(fragment)) xhr.open('GET', url) xhr.send() } } for (let i in rh2.config.homepage_specials) { let special = rh2.config.homepage_specials[i] if (!special) { continue } // create container first to keep items order const special_item_el = document.createElement('div') special_item_el.classList.add('rh2-home-section-special-body-item') document.getElementsByClassName('rh2-home-section-special-body')[0].appendChild(special_item_el) let url = '/rh2/service/promotion/promotion_item_get/' + special.uuid let xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const promotion = rtn.data.promotion const business = rtn.data.business let card if (rh2.utils.is_mobile()) { card = rh2.Special.render_card_for_mobile(promotion, business, fragment) } else { card = rh2.Special.render_card_for_business_list_page(promotion, business, fragment) } special_item_el.appendChild(card) }.bind(fragment)) xhr.open('GET', url) xhr.send() } } })()</script> <script> // Home ;(function() { const Fragment = function() { rh2.Fragment.call(this) } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'Article' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/article/([\\w-_]+)/?$'), ] for (let i = 0; i < path_re_list.length; i++) { const mo = path_re_list[i].exec(href_path) if (mo) { return mo } } return false } fragment.get_current_url = function() { return this.params.url } rh2.fragment_manager.register(fragment) fragment._render = function() { if (!this.params) { this.params = {} } if (!this.params.slug) { this.params.url = rh2.utils.get_href_parts(window.location.href)[2] const frags = this.params.url.split('/') this.params.slug = frags[frags.length - 2] } this.el.innerHTML = '' this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) this.el.classList.add('rh2-fragment-article-item') const row_fw_el = document.createElement('div') row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(row_fw_el) const row_0_el = document.createElement('div') row_0_el.classList.add('rh2-row-pw') row_0_el.classList.add('rh2-home-row-0') row_fw_el.appendChild(row_0_el) const row_0_col_left_el = this.row_0_col_left_el = document.createElement('div') row_0_col_left_el.classList.add('rh2-w-F') row_0_col_left_el.classList.add('rh2-w-O-s') row_0_col_left_el.classList.add('rh2-home-row-0-col-left') row_0_el.appendChild(row_0_col_left_el) const row_0_col_right_el = document.createElement('div') row_0_col_right_el.classList.add('rh2-w-9') row_0_col_right_el.classList.add('rh2-w-O-s') row_0_col_right_el.classList.add('rh2-home-row-0-col-right') row_0_col_right_el.classList.add('rh2-article-list') row_0_el.appendChild(row_0_col_right_el) const article_list_heading_el = document.createElement('div') article_list_heading_el.innerText = 'More News and Discoveries' article_list_heading_el.classList.add('rh2-article-list-heading') row_0_col_right_el.appendChild(article_list_heading_el) const article_list_body_el = document.createElement('div') row_0_col_right_el.appendChild(article_list_body_el) this.article_list_body_el = article_list_body_el const footer = rh2.Footer.build() this.el.appendChild(footer) } fragment.load = function() { let slug = this.params.slug if (this.params) { if (this.params.__LANDING__) { const parts = rh2.utils.get_href_parts() const mo = this.match_current_url(parts) slug = mo[1] } } if (slug === undefined) { return } const url = '/rh2/service/article/article-item-get/' + slug + '/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn['errcode'] != 0) { return } const data = rtn['data'] // console.log(data) this._render() fragment.render_article_body(data) load_article_list({}) }.bind(this)) xhr.open("GET", url) xhr.send() } fragment.render_article_body = function(data) { const header_el = document.createElement('div') header_el.classList.add('rh2-article-header') this.row_0_col_left_el.appendChild(header_el) const title_el = document.createElement('div') title_el.classList.add('rh2-article-title') title_el.innerText = data['title'] || '' header_el.appendChild(title_el) const author_el = document.createElement('div') author_el.classList.add('rh2-article-author') author_el.innerText = data['author'] && ('by ' + data['author']) || '' header_el.appendChild(author_el) if (data['published_at']) { const d = new Date(data['published_at']) const published_at_el = document.createElement('div') published_at_el.classList.add('rh2-article-published-at') published_at_el.innerText = d.toLocaleDateString() header_el.appendChild(published_at_el) } const content_container_el = document.createElement('div') content_container_el.classList.add('rh2-article-content-container') this.row_0_col_left_el.appendChild(content_container_el) for (let i = 0; i < data['body']['paragraphs'].length; i++) { const p_data = data['body']['paragraphs'][i] const p_type = p_data['type'] if (p_type === 'text') { const p_text_el = document.createElement('div') p_text_el.classList.add('rh2-article-p-text') p_text_el.innerText = p_data['content'] content_container_el.appendChild(p_text_el) } if (p_type === 'heading') { const p_heading_el = document.createElement('div') p_heading_el.classList.add('rh2-article-p-heading') p_heading_el.innerText = p_data['content'] content_container_el.appendChild(p_heading_el) } if (p_type === 'link') { const p_link_el = document.createElement('a') p_link_el.classList.add('rh2-article-p-link') p_link_el.innerText = p_data['content'] p_link_el.setAttribute('href', p_data['href']) if (p_data['href'] && p_data['href'].indexOf('/') != 0) { p_link_el.setAttribute('target', '_blank') } content_container_el.appendChild(p_link_el) } if (p_type === 'restaurant') { const p_restaurant_el = document.createElement('div') p_restaurant_el.classList.add('rh2-article-p-restaurant') content_container_el.appendChild(p_restaurant_el) const slug = p_data['slug'] const restaurant_obj_data = data['businesses'][slug] if (restaurant_obj_data) { const card = new rh2.BusinessCard(restaurant_obj_data, {}, this.fragment) card_el = card.render(null) const wrapper_el = document.createElement('div') wrapper_el.style['border'] = '1px solid hsla(0, 0%, 90%, 1)' wrapper_el.style['border-radius'] = '8px' wrapper_el.style['padding'] = '16px' wrapper_el.appendChild(card_el) p_restaurant_el.appendChild(wrapper_el) //const el = rh2.components.render_restaurants_list_item(restaurant_obj_data, i) //el.classList.add('rh2-home-section-restaurants-item') //p_restaurant_el.appendChild(el) } } if (p_type === 'image') { const p_image_el = document.createElement('div') p_image_el.classList.add('rh2-article-p-image') content_container_el.appendChild(p_image_el) const id = p_data['id'] const image_data = data['images'][id] if (image_data) { const p_image_body_el = document.createElement('div') p_image_body_el.classList.add('rh2-article-p-image-body') const img_url = image_data['url'] p_image_body_el.style['background-image'] = 'url("' + img_url + '")' p_image_el.appendChild(p_image_body_el) let caption = undefined caption = image_data['caption'] if (caption) { const p_image_caption_el = document.createElement('div') p_image_caption_el.classList.add('rh2-article-p-image-caption') p_image_caption_el.innerText = caption p_image_el.appendChild(p_image_caption_el) } } } } } const load_article_list = function(cfg) { let url = '/rh2/service/article/article-list-get/' const query_params = cfg.query_params || {} const pairs = [] for (let k in query_params) { const v = query_params[k] pairs.push([k, v]) } const querystring = pairs.map(function(pair) { return (Array.isArray(pair[1]) ? pair[1] : [pair[1]]).map(function(v) { return pair[0] + '=' + encodeURIComponent(v) }).join('&') }).join('&') if (querystring) { url += '?' + querystring } let xhr = new XMLHttpRequest() xhr.addEventListener("load", function() { const s = this.responseText const rtn = JSON.parse(s) const data = rtn.data render_article_list_body(data) }) xhr.open("GET", url); xhr.send(); } const render_article_list_body = function(data) { for (let i = 0; i < data.object_list.length; i++) { const obj = data.object_list[i] const slug = obj['slug'] if (slug === fragment.params['slug']) { continue } const item_el = document.createElement('div') item_el.classList.add('rh2-article-list-item') item_el.setAttribute('data-rh2-slug', slug) item_el.addEventListener('click', function(e) { const slug = e.currentTarget.getAttribute('data-rh2-slug') fragment.fm.enter_fragment('Article', { 'url': '/rh2/article/' + slug + '/', 'slug': slug, '__CLEAR__': true, }) }) fragment.article_list_body_el.appendChild(item_el) const image_el = document.createElement('div') image_el.classList.add('rh2-article-list-item-image') image_url = obj['list_image_url'] if (image_url) { rh2.utils.schedule_bgi(image_el, image_url, 0) } item_el.appendChild(image_el) const footer_el = document.createElement('div') footer_el.classList.add('rh2-article-list-item-footer') item_el.appendChild(footer_el) const title_row_el = document.createElement('div') title_row_el.classList.add('rh2-article-list-item-title-row') title_row_el.innerText = obj['title'] footer_el.appendChild(title_row_el) const author_row_el = document.createElement('div') author_row_el.classList.add('rh2-article-list-item-author-row') footer_el.appendChild(author_row_el) const author_el = document.createElement('div') author_el.classList.add('rh2-article-list-item-author') author_el.innerText = obj['author'] && ('by ' + obj['author'] + ',') || '' author_row_el.appendChild(author_el) const published_at_el = document.createElement('div') published_at_el.classList.add('rh2-article-list-item-published-at') published_at_el.innerText = (new Date(obj['published_at'])).toLocaleDateString() author_row_el.appendChild(published_at_el) } } })() </script> <script>// #EventfindaEvents ;(function() { const Fragment = function() { rh2.Fragment.call(this) } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'EventfindaEvents' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eventfinda-events\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/eventfinda-events/' } rh2.fragment_manager.register(fragment) fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-eventfinda-events') this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const row1_fw_el = document.createElement('div') row1_fw_el.classList.add('rh2-row-fw') this.el.appendChild(row1_fw_el) const row1_el = document.createElement('div') row1_el.classList.add('rh2-row-pw') row1_fw_el.appendChild(row1_el) const row1_heading_el = document.createElement('div') row1_heading_el.classList.add('rh2-eventfinda-events-section-heading') row1_heading_el.innerText = 'Foodie Events' row1_el.appendChild(row1_heading_el) const area_select_el = document.createElement('select') area_select_el.classList.add('rh2-eventfinda-events-area-select') row1_heading_el.appendChild(area_select_el) const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') body_row_fw_el.classList.add('rh2-body-row') body_row_fw_el.classList.add('rh2-eventfinda-events-body-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_el.classList.add('rh2-eventfinda-events-body-row') body_row_fw_el.appendChild(body_row_el) const items_row_el = this.items_row_el = document.createElement('div') items_row_el.classList.add('rh2-row') body_row_el.appendChild(items_row_el) const footer = rh2.Footer.build() this.el.appendChild(footer) this.load_events() this.bind_select() } fragment.render_events_item = function(obj_data, idx) { const item_el = document.createElement('div') item_el.classList.add('rh2-row') item_el.classList.add('rh2-events-list-item') const photo_el = document.createElement('div') photo_el.classList.add('rh2-events-list-item-photo') item_el.appendChild(photo_el) //const image_identifier = obj_data['primary_image_url'] const photo_url = obj_data['eventfinda_image'] rh2.utils.schedule_bgi(photo_el, photo_url, 0) const details_el = document.createElement('div') details_el.classList.add('rh2-events-list-item-details') item_el.appendChild(details_el) const details_body_el = document.createElement('div') details_body_el.classList.add('rh2-row') details_body_el.classList.add('rh2-events-list-item-details-body') details_el.appendChild(details_body_el) const details_row0_el = document.createElement('div') details_row0_el.classList.add('rh2-row') details_row0_el.classList.add('rh2-events-list-item-details-row0') details_body_el.appendChild(details_row0_el) const name_el = document.createElement('div') name_el.classList.add('rh2-events-list-item-name') name_el.innerText = obj_data['name'] details_row0_el.appendChild(name_el) const details_row1_el = document.createElement('div') details_row1_el.classList.add('rh2-row') details_row1_el.classList.add('rh2-events-list-item-details-row1') details_body_el.appendChild(details_row1_el) const active_row_el = document.createElement('div') active_row_el.classList.add('rh2-events-list-item-active-row') details_row1_el.appendChild(active_row_el) const active_from_el = document.createElement('span') active_from_el.classList.add('rh2-events-list-item-active-from') active_from_el.innerText = obj_data['active_from_date_str'] active_row_el.appendChild(active_from_el) const active_sep_el = document.createElement('span') active_sep_el.classList.add('rh2-events-list-item-active-sep') active_sep_el.innerText = ' - ' active_row_el.appendChild(active_sep_el) const active_to_el = document.createElement('span') active_to_el.classList.add('rh2-events-list-item-active-to') active_to_el.innerText = obj_data['active_to_date_str'] active_row_el.appendChild(active_to_el) const place_and_area_el = document.createElement('div') place_and_area_el.classList.add('rh2-events-list-item-place-and-area') place_and_area_el.innerText = obj_data['place_and_area'] details_row1_el.appendChild(place_and_area_el) const details_footer_el = document.createElement('div') details_footer_el.classList.add('rh2-row') details_footer_el.classList.add('rh2-events-list-item-details-footer') details_el.appendChild(details_footer_el) const details_row2_el = document.createElement('div') details_row2_el.classList.add('rh2-row') details_row2_el.classList.add('rh2-events-list-item-details-row2') details_footer_el.appendChild(details_row2_el) const action_el = document.createElement('div') action_el.classList.add('rh2-events-list-item-action') details_row2_el.appendChild(action_el) const action_button_el = document.createElement('a') action_button_el.setAttribute('href', obj_data['primary_url']) action_button_el.setAttribute('target', '_blank') action_button_el.classList.add('rh2-events-list-item-action-button') action_button_el.innerText = 'see more' action_el.appendChild(action_button_el) return item_el } fragment.load_events = function(area_value, area_name) { let url = '/rh2/service/eventfinda_events_list_get/' if (area_value) { url += '?area=' + area_value } const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) this.items_row_el.innerHTML = '' const object_list = rtn['data']['object_list'] for (let i = 0; i < object_list.length; i++) { const obj_data = object_list[i] const el = this.render_events_item(obj_data, i) this.items_row_el.appendChild(el) } //events_list_summary_el.innerText = 'events found' }.bind(this)) xhr.open("GET", url); xhr.send(); } fragment.bind_select = function() { const els = this.el.getElementsByClassName('rh2-eventfinda-events-area-select') const option_pairs = [ ['new-zealand', 'New Zealand'], ['auckland-region', 'Auckland Region'], ['bay-of-plenty-region', 'Bay of Plenty Region'], ['canterbury-region', 'Canterbury Region'], ['gisborne-region', 'Gisborne Region'], ['hawkes-bay-region', 'Hawke\'s Bay Region'], ['manawatu-wanganui-region', 'Manawatu-Wanganui Region'], ['marlborough-region', 'Marlborough Region'], ['nelson-region', 'Nelson Region'], ['northland-region', 'Northland Region'], ['otago-region', 'Otago Region'], ['southland-region', 'Southland Region'], ['taranaki-region', 'Taranaki Region'], ['tasman-region', 'Tasman Region'], ['waikato-region', 'Waikato Region'], ['wellington-region', 'Wellington Region'], ['west-coast-region', 'West Coast Region'], ] for (let i = 0; i < els.length; i++) { const el = els[i] for (let j = 0; j < option_pairs.length; j++) { const option_pair = option_pairs[j] const option_el = document.createElement('option') option_el.setAttribute('value', option_pair[0]) option_el.innerText = option_pair[1] el.appendChild(option_el) } el.addEventListener('change', function(e) { const option_els = e.target.getElementsByTagName('option') const option = option_els[e.target.selectedIndex] const value = option.value const name = option.innerText this.load_events(value, name) }.bind(this)) } } })() </script> <script>// #AccountLogin ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountLogin' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/' } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') this.el.classList.add('rh2-account-page') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Account Sign In' col_1_el.appendChild(page_header_el) const section_el = rh2.components.build_sign_in_options(this) col_1_el.appendChild(section_el) const footer = rh2.Footer.build() this.el.appendChild(footer) } fragment.load = function() { const parts = rh2.utils.get_href_parts() this.params.qd = rh2.utils.get_query_dict(parts[3]) } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountEmailLogin ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountEmailLogin' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account/email-login\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/email-login/' } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') this.el.classList.add('rh2-account-page') const appbar = this.appbar = new rh2.AppBar({ fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Sign in with Email' col_1_el.appendChild(page_header_el) const form_el = document.createElement('form') form_el.classList.add('rh2-account-page-form') col_1_el.appendChild(form_el) const form_row0_el = document.createElement('div') form_row0_el.classList.add('rh2-row') form_el.appendChild(form_row0_el) const form_row0_label_el = document.createElement('div') form_row0_label_el.classList.add('rh2-account-page-form-label') form_row0_label_el.classList.add('rh2-account-email-login-email-address-label') form_row0_label_el.innerText = 'Email' form_row0_el.appendChild(form_row0_label_el) const form_row0_input_el = this.email_address_el = document.createElement('input') form_row0_input_el.setAttribute('type', 'email') form_row0_input_el.setAttribute('name', 'email') form_row0_input_el.classList.add('rh2-account-page-form-input') form_row0_input_el.classList.add('rh2-account-email-login-email-address-input') form_row0_el.appendChild(form_row0_input_el) const form_row1_el = document.createElement('div') form_row1_el.classList.add('rh2-row') form_el.appendChild(form_row1_el) const form_row1_label_el = document.createElement('div') form_row1_label_el.classList.add('rh2-account-page-form-label') form_row1_label_el.classList.add('rh2-account-email-login-password-label') form_row1_label_el.innerText = 'Password' form_row1_el.appendChild(form_row1_label_el) const form_row1_input_el = this.password_el = document.createElement('input') form_row1_input_el.setAttribute('type', 'password') form_row1_input_el.setAttribute('name', 'password') form_row1_input_el.classList.add('rh2-account-page-form-input') form_row1_input_el.classList.add('rh2-account-email-login-password-input') form_row1_el.appendChild(form_row1_input_el) const form_row2_el = this.validation_row_el = document.createElement('div') form_row2_el.classList.add('rh2-account-form-validation-row') form_el.appendChild(form_row2_el) const form_row3_el = document.createElement('div') form_row3_el.classList.add('rh2-row') form_row3_el.classList.add('rh2-account-email-login-login-row') form_el.appendChild(form_row3_el) const form_row3_input_el = this.submit_el = document.createElement('input') form_row3_input_el.setAttribute('type', 'submit') form_row3_input_el.setAttribute('value', 'Sign In') form_row3_input_el.classList.add('rh2-account-email-login-login') form_row3_el.appendChild(form_row3_input_el) const form_row4_el = document.createElement('div') form_row4_el.classList.add('rh2-row') form_row4_el.classList.add('rh2-account-email-login-recover-password-row') form_el.appendChild(form_row4_el) const form_row4_label_el = document.createElement('span') form_row4_label_el.classList.add('rh2-account-email-login-recover-password-label') form_row4_label_el.innerText = 'Forgot password?' form_row4_el.appendChild(form_row4_label_el) const form_row4_input_el = document.createElement('a') form_row4_input_el.classList.add('rh2-account-email-login-recover-password') form_row4_input_el.addEventListener('click', function() { const params = {} if (this.params['post_login']) { const post_login = this.params['post_login'] params['post_login'] = post_login } this.fm.enter_fragment('AccountRecoverPassword', params) }.bind(this)) form_row4_input_el.innerText = 'recover password' form_row4_el.appendChild(form_row4_input_el) const form_row5_el = document.createElement('div') form_row5_el.classList.add('rh2-row') form_row5_el.classList.add('rh2-account-email-login-signup-row') form_el.appendChild(form_row5_el) const form_row5_label_el = document.createElement('span') form_row5_label_el.classList.add('rh2-account-email-login-signup-label') form_row5_label_el.innerText = "Don't have an account?" form_row5_el.appendChild(form_row5_label_el) const form_row5_input_el = document.createElement('a') form_row5_input_el.classList.add('rh2-account-email-login-signup') form_row5_input_el.addEventListener('click', function() { const params = {} if (this.params['post_login']) { const post_login = this.params['post_login'] params['post_login'] = post_login } this.fm.enter_fragment('AccountEmailSignup', params) }.bind(this)) form_row5_input_el.innerText = 'Sign Up' form_row5_el.appendChild(form_row5_input_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-8') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) this.bind_login_click() const footer = rh2.Footer.build() this.el.appendChild(footer) } fragment.bind_login_click = function() { this.submit_el.addEventListener('click', function(e) { e.preventDefault() const validated_form_data = this.validate_form_data() if (!validated_form_data._is_valid) { return } const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('logging in...') const url = '/rh2/service/account/email-login/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('Successfully signed in!') dialogue.close(0, 1500, function() { // console.log(this.params) if (this.params['post_login']) { const post_login = this.params['post_login'] if (post_login.toLowerCase() === '_close_') { window.close() } if (post_login.toLowerCase() === 'merchant') { window.location.href = '/rh2/merchant' } } else { this.fm.enter_fragment('AccountHome') } }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Incorrect credentials. Please try again.') dialogue.close(1000, 1500) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) }.bind(this)) } fragment.validate_form_data = function() { const form_data = { _is_valid: true } const validation_row_el = this.validation_row_el validation_row_el.innerHTML = '' const email_address_el = this.email_address_el form_data.email_address = email_address_el.value const password_el = this.password_el form_data.password = password_el.value return form_data } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountEmailSignup ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountEmailSignup' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account/email-signup\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/email-signup/' } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) this.el.classList.add('rh2-account-page') const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Sign up with Email' col_1_el.appendChild(page_header_el) const form_el = document.createElement('form') form_el.classList.add('rh2-account-page-form') col_1_el.appendChild(form_el) const form_row0_el = document.createElement('div') form_row0_el.classList.add('rh2-row') form_el.appendChild(form_row0_el) const form_row0_label_el = document.createElement('div') form_row0_label_el.classList.add('rh2-account-page-form-label') form_row0_label_el.classList.add('rh2-account-signup-email-address-label') form_row0_label_el.innerText = 'Email' form_row0_el.appendChild(form_row0_label_el) const form_row0_input_el = this.email_address_el = document.createElement('input') form_row0_input_el.setAttribute('type', 'email') form_row0_input_el.setAttribute('name', 'email') form_row0_input_el.classList.add('rh2-account-page-form-input') form_row0_input_el.classList.add('rh2-account-signup-email-address-input') form_row0_el.appendChild(form_row0_input_el) const form_row1_el = document.createElement('div') form_row1_el.classList.add('rh2-row') form_el.appendChild(form_row1_el) const form_row1_label_el = document.createElement('div') form_row1_label_el.classList.add('rh2-account-page-form-label') form_row1_label_el.classList.add('rh2-account-signup-password-label') form_row1_label_el.innerText = 'Password' form_row1_el.appendChild(form_row1_label_el) const form_row1_input_el = this.password_el = document.createElement('input') form_row1_input_el.setAttribute('type', 'password') form_row1_input_el.setAttribute('name', 'password') form_row1_input_el.classList.add('rh2-account-page-form-input') form_row1_input_el.classList.add('rh2-account-signup-password-input') form_row1_el.appendChild(form_row1_input_el) const form_row2_el = document.createElement('div') form_row2_el.classList.add('rh2-row') form_el.appendChild(form_row2_el) const form_row2_label_el = document.createElement('div') form_row2_label_el.classList.add('rh2-account-page-form-label') form_row2_label_el.classList.add('rh2-account-signup-repeat-password-label') form_row2_label_el.innerText = 'Confirm Password' form_row2_el.appendChild(form_row2_label_el) const form_row2_input_el = this.repeat_password_el = document.createElement('input') form_row2_input_el.setAttribute('type', 'password') form_row2_input_el.setAttribute('name', 'repeat_password') form_row2_input_el.classList.add('rh2-account-page-form-input') form_row2_input_el.classList.add('rh2-account-signup-repeat-password-input') form_row2_el.appendChild(form_row2_input_el) const form_row3_el = this.validation_row_el = document.createElement('div') form_row3_el.classList.add('rh2-account-form-validation-row') form_el.appendChild(form_row3_el) const form_row4_el = document.createElement('div') form_row4_el.classList.add('rh2-row') form_row4_el.classList.add('rh2-account-signup-signup-row') form_el.appendChild(form_row4_el) const form_row4_input_el = this.submit_el = document.createElement('input') form_row4_input_el.setAttribute('type', 'submit') form_row4_input_el.setAttribute('value', 'Sign Up') form_row4_input_el.classList.add('rh2-account-signup-submit') form_row4_el.appendChild(form_row4_input_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-8') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) this.bind_signup_click() const footer = rh2.Footer.build() this.el.appendChild(footer) } fragment.bind_signup_click = function() { this.submit_el.addEventListener('click', function(e) { e.preventDefault() const validated_form_data = this.validate_form_data() if (!validated_form_data._is_valid) return const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const url = '/rh2/service/account/email-signup/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('An account has been successfully created for you.') dialogue.add_body_text('To activate your account, follow the link in the activation email, which should arrive at your email address shortly.') dialogue.add_button('OK', undefined, function(d) { d.close(0, 0, function(d) { const params = {} if (this.params['post_login']) { const post_login = this.params['post_login'] params['post_login'] = post_login } this.fm.enter_fragment('AccountEmailLogin', params) }.bind(this)) }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + rtn.errcode + ' ErrMsg: ' + rtn.errmsg) dialogue.add_button('close', undefined, function(d) { d.close(0, 0, function(d) {}) }) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) }.bind(this)) } fragment.validate_form_data = function() { const form_data = { _is_valid: true } this.validation_row_el.innerHTML = '' const email_address_el = this.email_address_el if (rh2.utils.is_email_address_valid(email_address_el.value)) { email_address_el.classList.remove('rh2-form-input-invalid') form_data.email_address = email_address_el.value } else { email_address_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'email looks invalid' this.validation_row_el.appendChild(err_el) } const password_el = this.password_el if (rh2.utils.is_password_valid(password_el.value)) { password_el.classList.remove('rh2-form-input-invalid') form_data.password = password_el.value } else { password_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'password should be at least 8 characters long' this.validation_row_el.appendChild(err_el) } const repeat_password_el = this.repeat_password_el if (repeat_password_el.value === password_el.value) { repeat_password_el.classList.remove('rh2-form-input-invalid') } else { repeat_password_el.classList.add('rh2-form-input-invalid') is_valid = false const err_el = document.createElement('div') err_el.innerText = 'passwords should match' this.validation_row_el.appendChild(err_el) } return form_data } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountHome ; (function() { const Fragment = function() { rh2.Fragment.call(this) } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountHome' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/' } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') this.el.classList.add('rh2-account-page') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-4') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = this.col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-G') col_1_el.classList.add('rh2-w-O-s') col_1_el.classList.add('hidden') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Account Home' col_1_el.appendChild(page_header_el) const settings_header_el = document.createElement('div') settings_header_el.classList.add('rh2-account-home-section-header') settings_header_el.innerText = 'Settings' col_1_el.appendChild(settings_header_el) const settings_section_el = document.createElement('div') settings_section_el.classList.add('rh2-row') col_1_el.appendChild(settings_section_el) const settings_section_col_0_el = document.createElement('div') settings_section_col_0_el.classList.add('rh2-col') settings_section_col_0_el.classList.add('rh2-w-8') settings_section_col_0_el.classList.add('rh2-w-0-m') settings_section_el.appendChild(settings_section_col_0_el) const settings_section_col_1_el = this.settings_section_col_1_el = document.createElement('div') settings_section_col_1_el.classList.add('rh2-col') settings_section_col_1_el.classList.add('rh2-w-8') settings_section_col_1_el.classList.add('rh2-w-O-m') settings_section_el.appendChild(settings_section_col_1_el) const update_details_el = this.update_details_el = document.createElement('a') update_details_el.classList.add('rh2-account-home-update-details') update_details_el.innerText = 'Update Details' update_details_el.addEventListener('click', function() { this.fm.enter_fragment('AccountUpdateDetails') }.bind(this)) settings_section_col_1_el.appendChild(update_details_el) const change_password_el = this.change_password_el = document.createElement('a') change_password_el.classList.add('rh2-account-home-change-password') change_password_el.innerText = 'Change Password' change_password_el.addEventListener('click', function() { this.fm.enter_fragment('AccountChangePassword') }.bind(this)) settings_section_col_1_el.appendChild(change_password_el) const logout_el = this.logout_el = document.createElement('a') logout_el.classList.add('rh2-account-home-logout') logout_el.innerText = 'Sign Out' settings_section_col_1_el.appendChild(logout_el) const settings_section_col_2_el = document.createElement('div') settings_section_col_2_el.classList.add('rh2-col') settings_section_col_2_el.classList.add('rh2-w-8') settings_section_col_2_el.classList.add('rh2-w-0-m') settings_section_el.appendChild(settings_section_col_2_el) const mc_header_el = document.createElement('div') mc_header_el.classList.add('rh2-account-home-section-header') mc_header_el.innerText = 'Merchant Center' col_1_el.appendChild(mc_header_el) const mc_section_el = document.createElement('div') mc_section_el.classList.add('rh2-row') col_1_el.appendChild(mc_section_el) const mc_section_col_0_el = document.createElement('div') mc_section_col_0_el.classList.add('rh2-col') mc_section_col_0_el.classList.add('rh2-w-8') mc_section_col_0_el.classList.add('rh2-w-0-m') mc_section_el.appendChild(mc_section_col_0_el) const mc_section_col_1_el = document.createElement('div') mc_section_col_1_el.classList.add('rh2-col') mc_section_col_1_el.classList.add('rh2-w-8') mc_section_col_1_el.classList.add('rh2-w-O-m') mc_section_el.appendChild(mc_section_col_1_el) const mc_enter_el = document.createElement('a') mc_enter_el.innerText = 'Enter Merchant Center' mc_enter_el.href = '/rh2/merchant/' mc_enter_el.classList.add('rh2-account-home-mc') mc_section_col_1_el.appendChild(mc_enter_el) const mc_section_col_2_el = document.createElement('div') mc_section_col_2_el.classList.add('rh2-col') mc_section_col_2_el.classList.add('rh2-w-8') mc_section_col_2_el.classList.add('rh2-w-0-m') mc_section_el.appendChild(mc_section_col_2_el) const reservations_header_el = document.createElement('div') //reservations_header_el.classList.add('rh2-hide-on-mobile') reservations_header_el.classList.add('rh2-account-home-section-header') reservations_header_el.innerText = 'Reservations' col_1_el.appendChild(reservations_header_el) const reservations_section_el = document.createElement('div') //reservations_section_el.classList.add('rh2-hide-on-mobile') reservations_section_el.classList.add('rh2-row') reservations_section_el.classList.add('rh2-account-home-section-body-reservations') col_1_el.appendChild(reservations_section_el) const reservations_section_col_0_el = document.createElement('div') reservations_section_col_0_el.classList.add('rh2-col') reservations_section_col_0_el.classList.add('rh2-w-0') reservations_section_col_0_el.classList.add('rh2-w-0-m') reservations_section_el.appendChild(reservations_section_col_0_el) const reservations_section_col_1_el = this.reservations_container_el = document.createElement('div') reservations_section_col_1_el.classList.add('rh2-col') reservations_section_col_1_el.classList.add('rh2-w-O') reservations_section_col_1_el.classList.add('rh2-w-O-m') reservations_section_el.appendChild(reservations_section_col_1_el) const reservations_section_col_2_el = document.createElement('div') reservations_section_col_2_el.classList.add('rh2-col') reservations_section_col_2_el.classList.add('rh2-w-0') reservations_section_col_2_el.classList.add('rh2-w-0-m') reservations_section_el.appendChild(reservations_section_col_2_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-4') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) this.bind_logout_click() } fragment.load = function() { rh2.utils.load_account_details(function(rtn) { if (rtn.errcode === 0 && rtn.data['email_address']) { this.params.account_details = rtn.data this.col_1_el.classList.remove('hidden') rh2.components.load_and_render_reservations(this.reservations_container_el, this.fm) } else { this.fm.enter_fragment('AccountLogin') } }.bind(this)) } fragment.bind_logout_click = function() { this.logout_el.addEventListener('click', function(e) { const auth_method = e.target.getAttribute('data-rh2-auth-method') if (auth_method === 'FACEBOOK') { this.logout_session() } else if (auth_method === 'GOOGLE') { this.logout_session() } else { this.logout_session() } }.bind(this)) } fragment.logout_session = function() { const url = '/rh2/service/account/logout/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) window.location.assign('/rh2/account/') }.bind(this)) xhr.open("POST", url) xhr.send('{}') } fragment.load_reservation_status = function(status_value_el) { const br_rh_uuid = status_value_el.getAttribute('data-rh2-br-rh-uuid') const url = '/rh2/service/account/reservation-status/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { if (rtn.data.e_result_code !== 0) { status_value_el.innerText = 'UNKNOWN' status_value_el.classList.add('rh2-account-home-section-reservation-item-reservation-status-value-unknown') } else if (rtn.data.br_state.indexOf('RESERVATION_ACCEPTED') === 0) { status_value_el.innerText = 'CONFIRMED' status_value_el.classList.add('rh2-account-home-section-reservation-item-reservation-status-value-confirmed') } else if (rtn.data.e_status === 0) { status_value_el.innerText = 'CANCELLED' status_value_el.classList.add('rh2-account-home-section-reservation-item-reservation-status-value-cancelled') } else { status_value_el.innerText = 'UNKNOWN' status_value_el.classList.add('rh2-account-home-section-reservation-item-reservation-status-value-unknown') } } else { status_value_el.innerText = 'UNKNOWN' status_value_el.classList.add('rh2-account-home-section-reservation-item-reservation-status-value-unknown') } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: { br_rh_uuid: br_rh_uuid, } })) } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountUpdateDetails ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountUpdateDetails' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account/update-details\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/update-details/' } fragment._render = function() { this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) this.el.classList.add('rh2-account-page') const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Update Details' col_1_el.appendChild(page_header_el) const form_el = document.createElement('form') form_el.classList.add('rh2-account-page-form') col_1_el.appendChild(form_el) const form_row0_el = document.createElement('div') form_row0_el.classList.add('rh2-row') form_el.appendChild(form_row0_el) const form_row0_label_el = document.createElement('div') form_row0_label_el.classList.add('rh2-account-page-form-label') form_row0_label_el.classList.add('rh2-account-update-details-email-address-label') form_row0_label_el.innerText = 'Email' form_row0_el.appendChild(form_row0_label_el) const form_row0_input_el = this.email_address_el = document.createElement('input') form_row0_input_el.setAttribute('type', 'email') form_row0_input_el.setAttribute('name', 'email') form_row0_input_el.setAttribute('disabled', 'true') form_row0_input_el.classList.add('rh2-account-page-form-input') form_row0_input_el.classList.add('rh2-account-update-details-email-address-input') form_row0_el.appendChild(form_row0_input_el) const form_row1_el = document.createElement('div') form_row1_el.classList.add('rh2-row') form_el.appendChild(form_row1_el) const form_row1_label_el = document.createElement('div') form_row1_label_el.classList.add('rh2-account-page-form-label') form_row1_label_el.classList.add('rh2-account-update-details-first-name-label') form_row1_label_el.innerText = 'First Name' form_row1_el.appendChild(form_row1_label_el) const form_row1_input_el = this.first_name_el = document.createElement('input') form_row1_input_el.setAttribute('type', 'text') form_row1_input_el.setAttribute('name', 'first-name') form_row1_input_el.classList.add('rh2-account-page-form-input') form_row1_input_el.classList.add('rh2-account-update-details-first-name-input') form_row1_el.appendChild(form_row1_input_el) const form_row2_el = document.createElement('div') form_row2_el.classList.add('rh2-row') form_el.appendChild(form_row2_el) const form_row2_label_el = document.createElement('div') form_row2_label_el.classList.add('rh2-account-page-form-label') form_row2_label_el.classList.add('rh2-account-update-details-last-name-label') form_row2_label_el.innerText = 'Last Name' form_row2_el.appendChild(form_row2_label_el) const form_row2_input_el = this.last_name_el = document.createElement('input') form_row2_input_el.setAttribute('type', 'text') form_row2_input_el.setAttribute('name', 'last-name') form_row2_input_el.classList.add('rh2-account-page-form-input') form_row2_input_el.classList.add('rh2-account-update-details-last-name-input') form_row2_el.appendChild(form_row2_input_el) const form_row3_el = document.createElement('div') form_row3_el.classList.add('rh2-row') form_el.appendChild(form_row3_el) const form_row3_label_el = document.createElement('div') form_row3_label_el.classList.add('rh2-account-page-form-label') form_row3_label_el.classList.add('rh2-account-update-details-phone-number-label') form_row3_label_el.innerText = 'Phone Number' form_row3_el.appendChild(form_row3_label_el) const form_row3_input_el = this.phone_number_el = document.createElement('input') form_row3_input_el.setAttribute('type', 'text') form_row3_input_el.setAttribute('name', 'phone-number') form_row3_input_el.classList.add('rh2-account-page-form-input') form_row3_input_el.classList.add('rh2-account-update-details-phone-number-input') form_row3_el.appendChild(form_row3_input_el) const loc_title = document.createElement('p') loc_title.classList.add('center', 'bold') loc_title.innerText = 'Area preference' form_el.appendChild(loc_title) const form_loc_el = this.form_loc_el = document.createElement('div') form_el.appendChild(form_loc_el) const form_row4_el = this.validation_row_el = document.createElement('div') form_row4_el.classList.add('rh2-account-form-validation-row') form_el.appendChild(form_row4_el) const form_row5_el = document.createElement('div') form_row5_el.classList.add('rh2-row') form_row5_el.classList.add('rh2-account-update-details-submit-row') form_el.appendChild(form_row5_el) const form_row5_input_el = this.submit_el = document.createElement('input') form_row5_input_el.setAttribute('type', 'submit') form_row5_input_el.setAttribute('value', 'Save Changes') form_row5_input_el.classList.add('rh2-account-update-details-submit') form_row5_el.appendChild(form_row5_input_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-8') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) rh2.utils.load_account_details(this.render_details.bind(this)) this.bind_submit_click() } fragment.render_details = async function(rtn) { if (rtn.errcode !== 0) return const data = rtn.data this.email_address_el.value = data['email_address'] this.first_name_el.value = data['first_name'] this.last_name_el.value = data['last_name'] this.phone_number_el.value = data['phone_number'] // render area selectors const areas_response = await fetch('/rh2/service/area/bookable-list/') const areas = await areas_response.json() const form_loc_region_el = document.createElement('div') form_loc_region_el.classList.add('rh2-row') this.form_loc_el.appendChild(form_loc_region_el) const form_loc_region_label_el = document.createElement('div') form_loc_region_label_el.classList.add('rh2-account-page-form-label') form_loc_region_label_el.innerText = 'Region' form_loc_region_el.appendChild(form_loc_region_label_el) const form_loc_region_input_el = this.region_el = document.createElement('select') form_loc_region_input_el.setAttribute('name', 'preference-region-name') form_loc_region_input_el.classList.add('rh2-account-page-form-input') form_loc_region_el.appendChild(form_loc_region_input_el) const form_loc_city_el = document.createElement('div') form_loc_city_el.classList.add('rh2-row') this.form_loc_el.appendChild(form_loc_city_el) const form_loc_city_label_el = document.createElement('div') form_loc_city_label_el.classList.add('rh2-account-page-form-label') form_loc_city_label_el.innerText = 'City' form_loc_city_el.appendChild(form_loc_city_label_el) const form_loc_city_input_el = this.city_el = document.createElement('select') form_loc_city_input_el.setAttribute('name', 'preference-city-name') form_loc_city_input_el.classList.add('rh2-account-page-form-input') form_loc_city_el.appendChild(form_loc_city_input_el) const form_loc_suburb_el = document.createElement('div') form_loc_suburb_el.classList.add('rh2-row') this.form_loc_el.appendChild(form_loc_suburb_el) const form_loc_suburb_label_el = document.createElement('div') form_loc_suburb_label_el.classList.add('rh2-account-page-form-label') form_loc_suburb_label_el.innerText = 'Suburb' form_loc_suburb_el.appendChild(form_loc_suburb_label_el) const form_loc_suburb_input_el = this.suburb_el = document.createElement('select') form_loc_suburb_input_el.setAttribute('name', 'preference-suburb-name') form_loc_suburb_input_el.classList.add('rh2-account-page-form-input') form_loc_suburb_el.appendChild(form_loc_suburb_input_el) const render_area_inputs = function(current_region, current_city, current_suburb) { let $region_sel = $(form_loc_region_input_el).html('') $('<option value="">Region (optional)</option>').appendTo($region_sel) let $city_sel = $(form_loc_city_input_el).html('') $('<option value="">City (optional)</option>').appendTo($city_sel) let $suburb_sel = $(form_loc_suburb_input_el).html('') $('<option value ="">Suburb (optional)</option>').appendTo($suburb_sel) for (let region_slug in areas) { let region_name = areas[region_slug].name let $option_region = $('<option>').text(region_name).attr('value', region_slug).appendTo($region_sel) if (region_slug == current_region) { $option_region.attr('selected', '') let cities = areas[region_slug].cities for (let city_slug in cities) { let city_name = cities[city_slug].name let $option_city = $('<option>').text(city_name).attr('value', city_slug).appendTo($city_sel) if (city_slug == current_city) { $option_city.attr('selected', '') let suburbs = cities[city_slug].suburbs for (let suburb_slug in suburbs) { let suburb_name = suburbs[suburb_slug].name let $option_suburb = $('<option>').text(suburb_name).attr('value', suburb_slug).appendTo($suburb_sel) if (suburb_slug == current_suburb) { $option_suburb.attr('selected', '') } } } } } } $region_sel.on('change', () => { current_region = $region_sel.val() render_area_inputs(current_region) }) $city_sel.on('change', () => { current_city = $city_sel.val() render_area_inputs(current_region, current_city) }) $suburb_sel.on('change', () => { current_suburb = $suburb_sel.val() render_area_inputs(current_region, current_city, current_suburb) }) } render_area_inputs(data.preference_region_slug, data.preference_city_slug, data.preference_suburb_slug) } fragment.bind_submit_click = function() { this.submit_el.addEventListener('click', function(e) { e.preventDefault() const validated_form_data = this.validate_form_data() if (!validated_form_data._is_valid) return const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const url = '/rh2/service/account/update-details/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('Successfully updated details!') dialogue.close(1000, 2000, function() { this.fm.enter_fragment('AccountHome') }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + rtn.errcode + ' ErrMsg: ' + rtn.errmsg) dialogue.close(1000, 2000, function() {}) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) }.bind(this)) } fragment.validate_form_data = function() { const form_data = { _is_valid: true } const validation_row_el = this.validation_row_el validation_row_el.innerHTML = '' const first_name_el = this.first_name_el if (first_name_el.value) { first_name_el.classList.remove('rh2-form-input-invalid') form_data.first_name = first_name_el.value } else { first_name_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'First name shall not be blank' validation_row_el.appendChild(err_el) } const last_name_el = this.last_name_el if (last_name_el.value) { last_name_el.classList.remove('rh2-form-input-invalid') form_data.last_name = last_name_el.value } else { last_name_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'Last name shall not be blank' validation_row_el.appendChild(err_el) } const phone_number_el = this.phone_number_el const phone_number = phone_number_el.value.replace(/\s/g, '') if (rh2.utils.is_phone_number_valid(phone_number)) { phone_number_el.classList.remove('rh2-form-input-invalid') form_data.phone_number = phone_number } else { phone_number_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'Phone number should be 6 or more digits' validation_row_el.appendChild(err_el) } form_data.preference_region_slug = this.region_el.value form_data.preference_region_name = this.region_el.selectedOptions[0].innerText form_data.preference_city_slug = this.city_el.value form_data.preference_city_name = this.city_el.selectedOptions[0].innerText form_data.preference_suburb_slug = this.suburb_el.value form_data.preference_suburb_name = this.suburb_el.selectedOptions[0].innerText // console.log(form_data) return form_data } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountChangePassword ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountChangePassword' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account/change-password\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/change-password/' } fragment._render = function() { this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) this.el.classList.add('rh2-account-page') const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Change Password' col_1_el.appendChild(page_header_el) const form_el = document.createElement('form') form_el.classList.add('rh2-account-page-form') col_1_el.appendChild(form_el) const current_header_el = document.createElement('div') current_header_el.classList.add('rh2-account-page-form-section-header') current_header_el.innerText = '- current password -' form_el.appendChild(current_header_el) const form_row0_el = document.createElement('div') form_row0_el.classList.add('rh2-row') form_el.appendChild(form_row0_el) const form_row0_label_el = document.createElement('div') form_row0_label_el.classList.add('rh2-account-page-form-label') form_row0_label_el.classList.add('rh2-account-change-password-current-password-label') form_row0_label_el.innerText = 'Current Password' form_row0_el.appendChild(form_row0_label_el) const form_row0_input_el = this.current_password_el = document.createElement('input') form_row0_input_el.setAttribute('type', 'password') form_row0_input_el.setAttribute('name', 'current-password') form_row0_input_el.classList.add('rh2-account-page-form-input') form_row0_input_el.classList.add('rh2-account-change-password-current-password-input') form_row0_el.appendChild(form_row0_input_el) const new_header_el = document.createElement('div') new_header_el.classList.add('rh2-account-page-form-section-header') new_header_el.innerText = '- new password -' form_el.appendChild(new_header_el) const form_row1_el = document.createElement('div') form_row1_el.classList.add('rh2-row') form_el.appendChild(form_row1_el) const form_row1_label_el = document.createElement('div') form_row1_label_el.classList.add('rh2-account-page-form-label') form_row1_label_el.classList.add('rh2-account-change-password-new-password-label') form_row1_label_el.innerText = 'New Password' form_row1_el.appendChild(form_row1_label_el) const form_row1_input_el = this.new_password_el = document.createElement('input') form_row1_input_el.setAttribute('type', 'password') form_row1_input_el.setAttribute('name', 'new-password') form_row1_input_el.classList.add('rh2-account-page-form-input') form_row1_input_el.classList.add('rh2-account-change-password-new-password-input') form_row1_el.appendChild(form_row1_input_el) const form_row2_el = document.createElement('div') form_row2_el.classList.add('rh2-row') form_el.appendChild(form_row2_el) const form_row2_label_el = document.createElement('div') form_row2_label_el.classList.add('rh2-account-page-form-label') form_row2_label_el.classList.add('rh2-account-change-password-repeat-password-label') form_row2_label_el.innerText = 'Confirm Password' form_row2_el.appendChild(form_row2_label_el) const form_row2_input_el = this.repeat_password_el = document.createElement('input') form_row2_input_el.setAttribute('type', 'password') form_row2_input_el.setAttribute('name', 'repeat-password') form_row2_input_el.classList.add('rh2-account-page-form-input') form_row2_input_el.classList.add('rh2-account-change-password-repeat-password-input') form_row2_el.appendChild(form_row2_input_el) const form_row3_el = this.validation_row_el = document.createElement('div') form_row3_el.classList.add('rh2-account-form-validation-row') form_el.appendChild(form_row3_el) const form_row4_el = document.createElement('div') form_row4_el.classList.add('rh2-row') form_row4_el.classList.add('rh2-account-change-password-submit-row') form_el.appendChild(form_row4_el) const form_row4_input_el = this.submit_el = document.createElement('input') form_row4_input_el.setAttribute('type', 'submit') form_row4_input_el.setAttribute('value', 'Save Changes') form_row4_input_el.classList.add('rh2-account-change-password-submit') form_row4_el.appendChild(form_row4_input_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-8') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) this.bind_submit_click() } fragment.bind_submit_click = function() { this.submit_el.addEventListener('click', function(e) { e.preventDefault() const validated_form_data = this.validate_form_data() if (!validated_form_data._is_valid) return const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const url = '/rh2/service/account/change-password/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('Password has been changed.') dialogue.add_body_text('Please use the new password when signing in the next time.') dialogue.add_body_text('All devices that were previously signed in with the old password, including this window, have been signed out.') dialogue.add_button('OK', undefined, function(d) { d.close(0, 0, function(x) { this.fm.enter_fragment('AccountHome') }.bind(this)) }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + rtn.errcode + ' ErrMsg: ' + rtn.errmsg) dialogue.close(1000, 2000, function() {}) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) }.bind(this)) } fragment.validate_form_data = function() { const form_data = { _is_valid: true } const validation_row_el = this.validation_row_el validation_row_el.innerHTML = '' const current_password_el = this.current_password_el if (current_password_el.value) { current_password_el.classList.remove('rh2-form-input-invalid') form_data.current_password = current_password_el.value } else { current_password_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'current password should be provided' validation_row_el.appendChild(err_el) } const new_password_el = this.new_password_el if (rh2.utils.is_password_valid(new_password_el.value)) { new_password_el.classList.remove('rh2-form-input-invalid') form_data.new_password = new_password_el.value } else { new_password_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'password should be at least 8 characters long' validation_row_el.appendChild(err_el) } const repeat_password_el = this.repeat_password_el if (repeat_password_el.value === new_password_el.value) { repeat_password_el.classList.remove('rh2-form-input-invalid') } else { repeat_password_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'repeat should match the new password' validation_row_el.appendChild(err_el) } return form_data } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountRecoverPassword ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountRecoverPassword' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account/recover-password\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return '/rh2/account/recover-password/' } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) this.el.classList.add('rh2-account-page') const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Recover Password' col_1_el.appendChild(page_header_el) const form_el = document.createElement('form') form_el.classList.add('rh2-account-page-form') col_1_el.appendChild(form_el) const form_row0_el = document.createElement('div') form_row0_el.classList.add('rh2-row') form_el.appendChild(form_row0_el) const form_row0_label_el = document.createElement('div') form_row0_label_el.classList.add('rh2-account-page-form-label') form_row0_label_el.classList.add('rh2-account-recover-password-email-address-label') form_row0_label_el.innerText = 'Email' form_row0_el.appendChild(form_row0_label_el) const form_row0_input_el = this.email_address_el = document.createElement('input') form_row0_input_el.setAttribute('type', 'email') form_row0_input_el.setAttribute('name', 'email') form_row0_input_el.classList.add('rh2-account-page-form-input') form_row0_input_el.classList.add('rh2-account-recover-password-email-address-input') form_row0_el.appendChild(form_row0_input_el) const form_row1_el = this.validation_row_el = document.createElement('div') form_row1_el.classList.add('rh2-account-form-validation-row') form_el.appendChild(form_row1_el) const form_row2_el = document.createElement('div') form_row2_el.classList.add('rh2-row') form_row2_el.classList.add('rh2-account-recover-password-submit-row') form_el.appendChild(form_row2_el) const form_row2_input_el = this.submit_el = document.createElement('input') form_row2_input_el.setAttribute('type', 'submit') form_row2_input_el.setAttribute('value', 'Recover Password') form_row2_input_el.classList.add('rh2-account-recover-password-submit') form_row2_el.appendChild(form_row2_input_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-8') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) this.bind_submit_click() const footer = rh2.Footer.build() this.el.appendChild(footer) } fragment.bind_submit_click = function() { this.submit_el.addEventListener('click', function(e) { e.preventDefault() const validated_form_data = this.validate_form_data() if (!validated_form_data._is_valid) return const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const url = '/rh2/service/account/recover-password/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('A password recovery email has been sent to your email address. Follow the link in the email to reset your password.') dialogue.add_button('OK', undefined, function(d) { d.close(0, 0, function(d) { const params = {} if (this.params['post_login']) { const post_login = this.params['post_login'] params['post_login'] = post_login } this.fm.enter_fragment('AccountEmailLogin', params) }.bind(this)) }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + rtn.errcode + ' ErrMsg: ' + rtn.errmsg) dialogue.close(1000, 2000, function() {}) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) }.bind(this)) } fragment.validate_form_data = function() { const form_data = { _is_valid: true } const validation_row_el = this.validation_row_el validation_row_el.innerHTML = '' const email_address_el = this.email_address_el if (rh2.utils.is_email_address_valid(email_address_el.value)) { email_address_el.classList.remove('rh2-form-input-invalid') form_data.email_address = email_address_el.value } else { email_address_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'email looks invalid' validation_row_el.appendChild(err_el) } return form_data } rh2.fragment_manager.register(fragment) })()</script> <script>// #AccountResetPassword ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'AccountResetPassword' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/account/reset-password\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { const parts = rh2.utils.get_href_parts() const qd = rh2.utils.get_query_dict(parts[3]) const reset_password_ucid = qd['reset_password_ucid'][0] const reset_password_token = qd['reset_password_token'][0] return '/rh2/account/reset-password/?reset_password_ucid=' + reset_password_ucid + '&reset_password_token=' + reset_password_token } fragment._render = function() { this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') this.el.classList.add('rh2-fragment-padding-for-appbar-mobile') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) this.el.classList.add('rh2-account-page') const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_fw_el.appendChild(body_row_el) const col_0_el = document.createElement('div') col_0_el.classList.add('rh2-col') col_0_el.classList.add('rh2-w-8') col_0_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_0_el) const col_1_el = document.createElement('div') col_1_el.classList.add('rh2-col') col_1_el.classList.add('rh2-w-8') col_1_el.classList.add('rh2-w-O-s') body_row_el.appendChild(col_1_el) const page_header_el = document.createElement('h1') page_header_el.classList.add('rh2-account-page-header') page_header_el.innerText = 'Reset Password' col_1_el.appendChild(page_header_el) const form_el = document.createElement('form') form_el.classList.add('rh2-account-page-form') col_1_el.appendChild(form_el) const new_header_el = document.createElement('div') new_header_el.classList.add('rh2-account-page-form-section-header') new_header_el.innerText = '- new password -' form_el.appendChild(new_header_el) const form_row1_el = document.createElement('div') form_row1_el.classList.add('rh2-row') form_el.appendChild(form_row1_el) const form_row1_label_el = document.createElement('div') form_row1_label_el.classList.add('rh2-account-page-form-label') form_row1_label_el.classList.add('rh2-account-change-password-new-password-label') form_row1_label_el.innerText = 'New Password' form_row1_el.appendChild(form_row1_label_el) const form_row1_input_el = this.new_password_el = document.createElement('input') form_row1_input_el.setAttribute('type', 'password') form_row1_input_el.setAttribute('name', 'new-password') form_row1_input_el.classList.add('rh2-account-page-form-input') form_row1_input_el.classList.add('rh2-account-change-password-new-password-input') form_row1_el.appendChild(form_row1_input_el) const form_row2_el = document.createElement('div') form_row2_el.classList.add('rh2-row') form_el.appendChild(form_row2_el) const form_row2_label_el = document.createElement('div') form_row2_label_el.classList.add('rh2-account-page-form-label') form_row2_label_el.classList.add('rh2-account-change-password-repeat-password-label') form_row2_label_el.innerText = 'Confirm Password' form_row2_el.appendChild(form_row2_label_el) const form_row2_input_el = this.repeat_password_el = document.createElement('input') form_row2_input_el.setAttribute('type', 'password') form_row2_input_el.setAttribute('name', 'repeat-password') form_row2_input_el.classList.add('rh2-account-page-form-input') form_row2_input_el.classList.add('rh2-account-change-password-repeat-password-input') form_row2_el.appendChild(form_row2_input_el) const form_row3_el = this.validation_row_el = document.createElement('div') form_row3_el.classList.add('rh2-account-form-validation-row') form_el.appendChild(form_row3_el) const form_row4_el = document.createElement('div') form_row4_el.classList.add('rh2-row') form_row4_el.classList.add('rh2-account-change-password-submit-row') form_el.appendChild(form_row4_el) const form_row4_input_el = this.submit_el = document.createElement('input') form_row4_input_el.setAttribute('type', 'submit') form_row4_input_el.setAttribute('value', 'Save Changes') form_row4_input_el.classList.add('rh2-account-change-password-submit') form_row4_el.appendChild(form_row4_input_el) const col_2_el = document.createElement('div') col_2_el.classList.add('rh2-col') col_2_el.classList.add('rh2-w-8') col_2_el.classList.add('rh2-w-0-s') body_row_el.appendChild(col_2_el) this.bind_submit_click() } fragment.bind_submit_click = function() { this.submit_el.addEventListener('click', function(e) { e.preventDefault() const validated_form_data = this.validate_form_data() if (!validated_form_data._is_valid) return const dialogue = rh2.utils.new_dialogue() dialogue.set_title('Loading') dialogue.set_body_text('Waiting for the response from the server..') const url = '/rh2/service/account/change-password/' const xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) if (rtn.errcode === 0) { dialogue.set_title('Success') dialogue.set_body_text('Password has been changed.') dialogue.add_body_text('Please use the new password when signing in the next time.') dialogue.add_body_text('All devices that were previously signed in with the old password, including this window, have been signed out.') dialogue.add_button('OK', undefined, function(d) { d.close(0, 0, function(x) { this.fm.enter_fragment('AccountHome') }.bind(this)) }.bind(this)) } else { dialogue.set_title('Error') dialogue.set_body_text('Error occurred. Try again later.') dialogue.add_body_text(' ErrCode: ' + rtn.errcode + ' ErrMsg: ' + rtn.errmsg) dialogue.close(1000, 2000, function() {}) } }.bind(this)) xhr.open("POST", url) xhr.send(JSON.stringify({ form_data: validated_form_data, })) }.bind(this)) } fragment.validate_form_data = function() { const form_data = { _is_valid: true } const validation_row_el = this.validation_row_el validation_row_el.innerHTML = '' const parts = rh2.utils.get_href_parts() const qd = rh2.utils.get_query_dict(parts[3]) const reset_password_ucid = qd['reset_password_ucid'][0] const reset_password_token = qd['reset_password_token'][0] form_data.reset_password_ucid = reset_password_ucid form_data.reset_password_token = reset_password_token const new_password_el = this.new_password_el if (rh2.utils.is_password_valid(new_password_el.value)) { new_password_el.classList.remove('rh2-form-input-invalid') form_data.new_password = new_password_el.value } else { new_password_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'password should be at least 8 characters long' validation_row_el.appendChild(err_el) } const repeat_password_el = this.repeat_password_el if (repeat_password_el.value === new_password_el.value) { repeat_password_el.classList.remove('rh2-form-input-invalid') } else { repeat_password_el.classList.add('rh2-form-input-invalid') form_data._is_valid = false const err_el = document.createElement('div') err_el.innerText = 'repeat should match the new password' validation_row_el.appendChild(err_el) } return form_data } rh2.fragment_manager.register(fragment) })()</script> <script> // #ReadyStateChange document.addEventListener('readystatechange', function() { if (document.readyState === 'interactive') { rh2.fragment_manager.make_deployment_aware() const fragment = rh2.fragment_manager.choose_fragment_from_url() if (fragment) { //fragment.init() rh2.fragment_manager.enter_fragment(fragment.get_name(), { __LANDING__: true, }) //fragment.render() } rh2.utils.schedule_bgi() } if (document.readyState === 'complete') { const href_parts = rh2.utils.get_href_parts() // deprecating //window.ga && ga('create', 'UA-139747328-1', 'auto', 'RH201905') //window.ga && ga('RH201905.send', 'pageview', location.pathname) // Completing initialization of the Facebook Pixel window.setTimeout(function() { // window.fbq && fbq('init', '291559325101601') window.fbq && fbq('track', 'PageView') }, 100) // Nielson window.setTimeout(function() { if (window.nol_t != undefined) { nol_t({ cid: "nz-apn", content: "0", server: "secure-nz" }).record().post() } }, 100) } }) </script> <script>window.rh2.config = {"homepage_coupons_status":"disabled","homepage_restaurants":[{"uuid":"1fcf3600-2f95-c9e6-0d7c-44531a77d20d","name":"Sails Restaurant","slug":"sails-restaurant"},{"uuid":"1550d022-56a4-5eb2-47c6-94624421fad6","name":"Oyster and Chop","slug":"oyster-and-chop"},{"uuid":"30f1d264-d50e-404d-07a7-354648d1e5fa","name":"Soul Bar & Bistro","slug":"soul-bar-bistro"},{"uuid":"fbc49ba2-f303-f10f-3dfa-19df23edb653","name":"The Occidental","slug":"occidental"},{"uuid":"925be4c4-e721-cecd-382b-aaafa8a7199b","name":"Tony's Steakhouse Wellesley St","slug":"tonys-steakhouse-wellesley-st"},{"uuid":"876cb1b8-837f-a06a-8bb2-fc7947604f93","name":"Grand Harbour","slug":"grand-harbour"}],"homepage_restaurants_title":"Featured Restaurants - Best Seafood in Auckland November","homepage_specials":[{"uuid":"0d09de1098eab4c0a5f4efddc0e49371f78019ea","name":"Friends Cafe Papamoa - Hot Deal - 50% OFF Food Bill"},{"uuid":"f095a2f7c62e579cb476d4a82f7aff3f917c9e28","name":" R-Toscanis Auckland - Hot Deal - 40% OFF Food Bill"},{"uuid":"8007b4c6820e6038f1eea5d310b8d45764eca483","name":"Chilli Dhaba Dunedin - Hot Deal - 50% OFF Food Bill"},{"uuid":"d531e16fc61311c73972c031449b068cd19750c0","name":"Mexico Christchurch - Hot Deal - 50% OFF Food Bill"}],"maintenance_message":"","stripe_public_key":"pk_live_Pq883ByGL7SpwjaWFnDW9Jt3"}</script> <script>// # BusinessFilter ; (function() { const BusinessFilter = function(cfg) { this.cfg_blf = cfg['business_list_fragment'] this.cfg_on_active_filter_num_change = cfg['on_active_filter_num_change'] this.cfg_layout = cfg['layout'] || 'DEFAULT' this.cfg_variant = cfg['variant'] || 'LIST_VIEW' this.cfg_bl_params = this.cfg_blf.params this.active_filter_panel = null this.active_filter_code = null this.pdt_pax_by_user = null this.pdt_date_by_user = null this.pdt_time_by_user = null this.OPTIONS_STRUCTURE = [ // ['DISH_DISCOUNT', 'Special / Combo'], ['DISH_STARSPECIAL', 'Set Menus / Degustation'], // ['DISH_BxGyF', 'Buy 1 get 1 free'], // ['DISH_COMPLIMENTARY', 'Complimentary Items'], // ['TABLE_DISCOUNT_RECURRING', '% off discount'], ] this.OPTIONS_HD_DISCOUNT = [ ['30', '30%'], ['40', '40%'], ['50', '50%'], ] this.OPTIONS_PRICE = [ ['1', '$'], ['2', '$$'], ['3', '$$$'], ['4', '$$$$'], ] this.OPTIONS_CUISINE = [ ['Burgers', 'Burgers', 'Burgers'], ['European', 'European', 'European'], ['Indian', 'Indian', 'Indian'], ['Pizza', 'Pizza', 'Pizza'], ['NZ and Pasifika', 'NZ and Pasifika', 'NZ_and_Pasifika'], ['Asian', 'Asian', 'Asian'], ['Steak', 'Steak', 'Steak'], ['Seafood', 'Seafood', 'Seafood'], ['Italian', 'Italian', 'Italian'], ['Fusion', 'Fusion', 'Asian_Fusion'], ['Asian Fusion', 'Asian Fusion', 'Asian_Fusion'], ['BBQ/Grill', 'BBQ/Grill', 'BBQ_Grill'], ['American', 'American', 'American'], ['Thai', 'Thai', 'Thai'], ['Japanese', 'Japanese', 'Japanese'], ['Pasta', 'Pasta', 'Pasta'], ['Mediterranean', 'Mediterranean', 'Mediterranean'], ['Chinese', 'Chinese', 'Chinese'], ['Mexican', 'Mexican', 'Mexican'], ['Middle Eastern', 'Middle Eastern', 'Middle_Eastern'], ['French', 'French', 'French'], ['Vietnamese', 'Vietnamese', 'Vietnamese'], ['Fish and Chips', 'Fish and Chips', 'Fish_and_Chips'], ['South and Central American', 'South and Central American', 'South_and_Central_American'], ['Spanish', 'Spanish', 'Spanish'], ['Malaysian', 'Malaysian', 'Malaysian'], ['Healthy', 'Healthy', 'Healthy'], ['Oysters', 'Oysters', 'Oysters'], ['Dessert Venue', 'Dessert Venue', 'Dessert_Venue'], ['Salads', 'Salads', 'Salads'], ['Noodles', 'Noodles', 'Noodles'], ['Korean', 'Korean', 'Korean'], ['Yum Cha / Dim Sum', 'Yum Cha / Dim Sum', 'YumCha_DimSum'], ['Spicy', 'Spicy', 'Spicy'], ['Irish', 'Irish', 'Irish'], ['Sushi', 'Sushi', 'Sushi'], ['Dumplings', 'Dumplings', 'Dumplings'], ['Nepalese', 'Nepalese', 'Nepalese'], ['African', 'African', 'African'], ['Curry', 'Curry', 'Curry'], ['Fried Chicken', 'Fried Chicken', 'Fried_Chicken'], ['Ramen', 'Ramen', 'Ramen'], ] this.OPTIONS_DIETARY = [ ['Vegetarian Options', 'Vegetarian Options', 'Vegetarian_Options'], ['Gluten Free Options', 'Gluten Free Options', 'Gluten_Free_Options'], ['Vegan Options', 'Vegan Options', 'Vegan_Options'], ['Dairy Free Options', 'Dairy Free Options', 'Dairy_Free_Options'], ['Keto / Paleo Options', 'Keto / Paleo Options', 'Keto_Paleo_Options'], ['Healthy', 'Healthy', 'Healthy'], ['Halal', 'Halal', 'Halal'], ] this.OPTIONS_FEATURE = [ ['Sharing Platters', 'Sharing Platters', 'Sharing_Platters_Tapas'], ['Sharing Platters / Tapas', 'Sharing Platters / Tapas', 'Sharing_Platters_Tapas'], ['Family Friendly', 'Family Friendly', 'Family_Friendly'], ['Outdoor Dining', 'Outdoor Dining', 'Outdoor_Dining'], ['RANZ Vouchers', 'RANZ Vouchers', 'RANZ_Vouchers'], ['Sea or Water View', 'Sea or Water View', 'Sea_or_Water_View'], ['Live Music', 'Live Music', 'Live_Music'], ['Wheelchair Accessible', 'Wheelchair Accessible', 'Wheelchair_Accessible'], ['Live Sport', 'Live Sport', 'Live_Sport'], ['BYO', 'BYO', 'BYO'], ['Craft Beer', 'Craft Beer', 'Craft_Beer'], ['High Tea', 'High Tea', 'High_Tea'], ['Auckland Restaurant Month', 'Auckland Restaurant Month', 'Auckland_Restaurant_Month'], ['Fine Dining', 'Fine Dining', 'Fine_Dining'], ['Wood Fired (Pizza/Food/Grill)', 'Wood Fired (Pizza/Food/Grill)', 'Wood_Fired_Pizza_Food_Grill'], ['Celebrity Chef', 'Celebrity Chef', 'Celebrity_Chef'], ['Buffet', 'Buffet', 'Buffet'], ['All Day Breakfast', 'All Day Breakfast', 'All_Day_Breakfast'], ['Stone Grill', 'Stone Grill', 'Stone_Grill'], ['Teppanyaki', 'Teppanyaki', 'Teppanyaki'], ['Wine Bar', 'Wine Bar', 'Wine_Bar'], ['Pet Friendly', 'Pet Friendly', 'Pet_Friendly'], ['Vineyard', 'Vineyard', 'Vineyard'], ['Play Area', 'Play Area', 'Play_Area'], ['Wedding Venue', 'Wedding Venue', 'Wedding_Venue'], ['Sushi Train', 'Sushi Train', 'Sushi_Train'], ['Charity Dining', 'Charity Dining', 'Charity_Dining_DineAid_and_more'], ['Cocktail Bar', 'Cocktail Bar', 'Cocktail_Bar'], ['Catering', 'Catering', 'Catering'], ['Wellington on a Plate', 'Wellington on a Plate', 'wellington_on_a_plate'], ] this.filter_colors = [ '#FF9C08', '#446D23', '#BF6D3A', '#639CBD', '#B37F2F', '#521313', '#AE3140', '#412579', '#27C26C', ] } BusinessFilter.prototype.get_default_date = function() { const d = new Date() let dd = d.getDate() if (dd < 10) { dd = '0' + dd } let mm = d.getMonth() + 1 if (mm < 10) { mm = '0' + mm } return dd + '/' + mm + '/' + d.getFullYear() } BusinessFilter.prototype.get_active_filter_count = function() { const active_filter_s = new Set() if (this.cfg_blf.get_name() == 'BusinessListMobileMap') { if (this.cfg_blf.num_param_values('hd_discount') > 0) { active_filter_s.add('PROMOTION') } else if (this.cfg_blf.num_param_values('promotion_structure') > 0) { active_filter_s.add('PROMOTION') } } if (this.cfg_blf.num_param_values('price') > 0) { active_filter_s.add('PRICE') } if (this.cfg_blf.num_param_values('cuisine') > 0) { active_filter_s.add('CUISINE') } if (this.cfg_blf.num_param_values('dietary') > 0) { active_filter_s.add('DIETARY') } if (this.cfg_blf.num_param_values('feature') > 0) { active_filter_s.add('FEATURE') } return active_filter_s.size } BusinessFilter.prototype.set_on_active_filter_num_change = function(f) { this.cfg_on_active_filter_num_change = f } BusinessFilter.prototype.close_active_filter_panel = function() { if (this.active_filter_panel == null) { return } this.active_filter_panel.parentNode.removeChild(this.active_filter_panel) this.active_filter_code = null this.active_filter_panel = null } BusinessFilter.prototype.get_filter_list = function(category_code) { let filter_list = [] const filter_pool = [ ['PROMOTION', 'Special Offers'], ['PRICE', 'Price'], ['CUISINE', 'Cuisine'], ['DIETARY', 'Dietary'], ['FEATURE', 'Feature'], ['BOOKING', 'Booking'], ] let filter_code_list = [] if (category_code == 'ALL') { filter_code_list = [ 'PROMOTION', 'PRICE', 'CUISINE', 'DIETARY', 'FEATURE', 'BOOKING', ] } if (category_code == 'SPECIAL') { filter_code_list = [ 'PROMOTION', 'PRICE', 'CUISINE', 'DIETARY', 'FEATURE', ] } if (category_code == 'SPECIAL_HD') { filter_code_list = [ 'PROMOTION', 'PRICE', 'CUISINE', 'DIETARY', 'FEATURE', ] } if (category_code == 'COUPON') { filter_code_list = [ 'PROMOTION', 'PRICE', 'CUISINE', 'DIETARY', 'FEATURE', ] } filter_pool.map(function(tp) { if (filter_code_list.indexOf(tp[0]) > -1) { filter_list.push(tp) } }) return filter_list } BusinessFilter.prototype.render_row = function(viewport_el) { let d = new Date() let today_datestr = [ d.getFullYear(), rh2.utils.zero_pad(d.getMonth() + 1), rh2.utils.zero_pad(d.getDate()), ].join('-') let today_datestr_nz = [ rh2.utils.zero_pad(d.getDate()), rh2.utils.zero_pad(d.getMonth() + 1), d.getFullYear(), ].join('/') viewport_el.innerHTML = '' let container_el = null let container_row_1 = null if (this.cfg_layout == 'BUSINESS_LIST_MOBILE') { container_row_1 = document.createElement('div') container_row_1.classList.add('rh2-business-filter-mobile-row-1') container_row_1.classList.add('rh2-business-filter-layout-business-list-mobile') if (this.cfg_variant == 'MAP_VIEW') { container_row_1.classList.add('rh2-business-filter-mobile-row-variant-map-view') } viewport_el.appendChild(container_row_1) } else { container_el = document.createElement('div') container_el.classList.add('rh2-business-filter-viewport') viewport_el.appendChild(container_el) } const category_code = this.cfg_bl_params['category'] && this.cfg_bl_params['category'][0] || 'ALL' const filter_list = this.get_filter_list(category_code) // filter const filter_col = document.createElement('div') filter_col.classList.add('rh2-business-filter-pdt-filter-col') if (this.cfg_layout == 'BUSINESS_LIST_MOBILE') { container_row_1.appendChild(filter_col) } else { container_el.appendChild(filter_col) } const filter_icon = document.createElement('div') filter_icon.classList.add('rh2-business-filter-pdt-filter-icon') filter_col.appendChild(filter_icon) const filter_active_counter = document.createElement('div') filter_active_counter.classList.add('rh2-business-filter-pdt-filter-active-counter') filter_active_counter.classList.add('rh2-business-filter-pdt-filter-active-counter-hidden') filter_icon.appendChild(filter_active_counter) const render_filter_active_counter = function(n) { filter_active_counter.innerText = n if (n == 0) { filter_active_counter.classList.add('rh2-business-filter-pdt-filter-active-counter-hidden') } else { filter_active_counter.classList.remove('rh2-business-filter-pdt-filter-active-counter-hidden') } } const active_filter_count = this.get_active_filter_count() render_filter_active_counter(active_filter_count) filter_icon.addEventListener('click', function(e) { if (this.cfg_layout == 'BUSINESS_LIST_MOBILE') { this.render_panel('MOBILE') } else { this.render_panel('DESKTOP') } }.bind(this)) this.set_on_active_filter_num_change(render_filter_active_counter) // pdt bar const pdt_bar_el = document.createElement('div') pdt_bar_el.classList.add('rh2-business-filter-pdt-bar') if (this.cfg_blf.get_param_value('category') != 'COUPON') { if (this.cfg_layout == 'BUSINESS_LIST_MOBILE') { container_row_1.appendChild(pdt_bar_el) } else { container_el.appendChild(pdt_bar_el) } } const pax_col = document.createElement('div') pax_col.classList.add('rh2-business-filter-pdt-pax-col') pdt_bar_el.appendChild(pax_col) pax_col.addEventListener('click', function() { if (pax_dropdown.classList.contains('rh2-business-filter-pdt-pax-dropdown-hidden')) { pax_dropdown.classList.remove('rh2-business-filter-pdt-pax-dropdown-hidden') render_pax_dropdown() date_dropdown.classList.add('rh2-business-filter-pdt-date-dropdown-hidden') time_dropdown.classList.add('rh2-business-filter-pdt-time-dropdown-hidden') } else { pax_dropdown.classList.add('rh2-business-filter-pdt-pax-dropdown-hidden') } }.bind(this)) const set_pax = function(v) { pax_el.innerText = v if (v != '') { pax_icon.classList.add('rh2-business-filter-pdt-pax-icon-hidden') pax_placeholder.classList.add('rh2-business-filter-pdt-pax-placeholder-hidden') } else { pax_icon.classList.remove('rh2-business-filter-pdt-pax-icon-hidden') pax_placeholder.classList.remove('rh2-business-filter-pdt-pax-placeholder-hidden') } } const pax_icon = document.createElement('div') pax_icon.classList.add('rh2-business-filter-pdt-pax-icon') pax_col.appendChild(pax_icon) const pax_el = document.createElement('div') pax_el.classList.add('rh2-business-filter-pdt-pax') pax_col.appendChild(pax_el) const pax_placeholder = document.createElement('div') pax_placeholder.classList.add('rh2-business-filter-pdt-pax-placeholder') pax_placeholder.innerText = 'guests' pax_col.appendChild(pax_placeholder) const pax_dropdown = document.createElement('div') pax_dropdown.classList.add('rh2-business-filter-pdt-pax-dropdown') pax_dropdown.classList.add('rh2-business-filter-pdt-pax-dropdown-hidden') pdt_bar_el.appendChild(pax_dropdown) const render_pax_dropdown = function() { pax_dropdown.innerHTML = '' for (let i = 1; i < 17; i++) { const label = i + '' const item = document.createElement('div') item.classList.add('rh2-business-filter-pdt-pax-dropdown-option') if (label == pax_el.innerText) { item.classList.add('rh2-business-filter-pdt-pax-dropdown-option-selected') } item.innerText = i item.addEventListener('click', function() { set_pax(i) pax_dropdown.classList.add('rh2-business-filter-pdt-pax-dropdown-hidden') this.pdt_pax_by_user = label toggle_pdt_clear_col() this.cfg_blf.set_param_value('av_pax', label) this.cfg_blf.search.run() }.bind(this)) pax_dropdown.appendChild(item) } }.bind(this) let pax_value = '' if (this.cfg_blf.num_param_values('av_pax') > 0) { pax_value = this.cfg_blf.get_param_value('av_pax') } set_pax(pax_value) const date_col = document.createElement('div') date_col.classList.add('rh2-business-filter-pdt-date-col') pdt_bar_el.appendChild(date_col) date_col.addEventListener('click', function() { if (date_dropdown.classList.contains('rh2-business-filter-pdt-date-dropdown-hidden')) { date_dropdown.classList.remove('rh2-business-filter-pdt-date-dropdown-hidden') render_date_dropdown() pax_dropdown.classList.add('rh2-business-filter-pdt-pax-dropdown-hidden') time_dropdown.classList.add('rh2-business-filter-pdt-time-dropdown-hidden') } else { date_dropdown.classList.add('rh2-business-filter-pdt-date-dropdown-hidden') } }.bind(this)) const set_date = function(v) { date_el.innerText = v if (v != '') { date_icon.classList.add('rh2-business-filter-pdt-date-icon-hidden') date_placeholder.classList.add('rh2-business-filter-pdt-date-placeholder-hidden') } else { date_icon.classList.remove('rh2-business-filter-pdt-date-icon-hidden') date_placeholder.classList.remove('rh2-business-filter-pdt-date-placeholder-hidden') } } const date_icon = document.createElement('div') date_icon.classList.add('rh2-business-filter-pdt-date-icon') date_col.appendChild(date_icon) const date_el = document.createElement('div') date_el.classList.add('rh2-business-filter-pdt-date') date_col.appendChild(date_el) const date_placeholder = document.createElement('div') date_placeholder.classList.add('rh2-business-filter-pdt-date-placeholder') date_placeholder.innerText = 'date' date_col.appendChild(date_placeholder) const date_dropdown = document.createElement('div') date_dropdown.classList.add('rh2-business-filter-pdt-date-dropdown') date_dropdown.classList.add('rh2-business-filter-pdt-date-dropdown-hidden') pdt_bar_el.appendChild(date_dropdown) const render_date_dropdown = function() { date_dropdown.innerHTML = '' const calendar = new rh2.Calendar({ date: date_el.innerText, min_date: today_datestr, num_months: 1, onselect: function(value, value_nz) { const v = value_nz date_dropdown.classList.add('rh2-business-filter-pdt-date-dropdown-hidden') set_date(v) this.pdt_date_by_user = v toggle_pdt_clear_col() const param_date = v.substring(6, 10) + '-' + v.substring(3, 5) + '-' + v.substring(0, 2) this.cfg_blf.set_param_value('av_date', param_date) this.cfg_blf.search.run() }.bind(this) }) calendar.render(date_dropdown) calendar.render_date() }.bind(this) let date_value = '' if (this.cfg_blf.num_param_values('av_date') > 0) { const iso_date = this.cfg_blf.get_param_value('av_date') const local_date = iso_date.substring(8, 10) + '/' + iso_date.substring(5, 7) + '/' + iso_date.substring(0, 4) date_value = local_date } set_date(date_value) const time_col = document.createElement('div') time_col.classList.add('rh2-business-filter-pdt-time-col') pdt_bar_el.appendChild(time_col) time_col.addEventListener('click', function() { if (time_dropdown.classList.contains('rh2-business-filter-pdt-time-dropdown-hidden')) { time_dropdown.classList.remove('rh2-business-filter-pdt-time-dropdown-hidden') render_time_dropdown() pax_dropdown.classList.add('rh2-business-filter-pdt-pax-dropdown-hidden') date_dropdown.classList.add('rh2-business-filter-pdt-date-dropdown-hidden') } else { time_dropdown.classList.add('rh2-business-filter-pdt-time-dropdown-hidden') } }.bind(this)) const set_time = function(v) { time_el.innerText = v if (v != '') { time_icon.classList.add('rh2-business-filter-pdt-time-icon-hidden') time_placeholder.classList.add('rh2-business-filter-pdt-time-placeholder-hidden') } else { time_icon.classList.remove('rh2-business-filter-pdt-time-icon-hidden') time_placeholder.classList.remove('rh2-business-filter-pdt-time-placeholder-hidden') } } const time_icon = document.createElement('div') time_icon.classList.add('rh2-business-filter-pdt-time-icon') time_col.appendChild(time_icon) const time_el = document.createElement('div') time_el.classList.add('rh2-business-filter-pdt-time') time_col.appendChild(time_el) const time_placeholder = document.createElement('div') time_placeholder.classList.add('rh2-business-filter-pdt-time-placeholder') time_placeholder.innerText = 'time' time_col.appendChild(time_placeholder) const time_dropdown = document.createElement('div') time_dropdown.classList.add('rh2-business-filter-pdt-time-dropdown') time_dropdown.classList.add('rh2-business-filter-pdt-time-dropdown-hidden') pdt_bar_el.appendChild(time_dropdown) const render_time_dropdown = function() { time_dropdown.innerHTML = '' for (let i = 6; i < 24; i++) { for (let j = 0; j < 60; j += 30) { const label = rh2.utils.zero_pad(i) + ':' + rh2.utils.zero_pad(j) const item = document.createElement('div') item.classList.add('rh2-business-filter-pdt-time-dropdown-option') if (label == time_el.innerText) { item.classList.add('rh2-business-filter-pdt-time-dropdown-option-selected') } item.innerText = label item.addEventListener('click', function() { set_time(label) time_dropdown.classList.add('rh2-business-filter-pdt-time-dropdown-hidden') this.pdt_time_by_user = label toggle_pdt_clear_col() this.cfg_blf.set_param_value('av_time', label) this.cfg_blf.search.run() }.bind(this)) time_dropdown.appendChild(item) } } }.bind(this) let time_value = '' if (this.cfg_blf.num_param_values('av_time') > 0) { time_value = this.cfg_blf.get_param_value('av_time') } set_time(time_value) const pdt_clear_col = document.createElement('div') pdt_clear_col.classList.add('rh2-business-filter-pdt-clear-col') pdt_bar_el.appendChild(pdt_clear_col) pdt_clear_col.addEventListener('click', function() { set_pax('') set_date('') set_time('') this.cfg_blf.set_param_value('av_pax', pax_el.innerText) this.cfg_blf.set_param_value('av_date', pax_el.innerText) this.cfg_blf.set_param_value('av_time', pax_el.innerText) pax_icon.classList.remove('rh2-business-filter-pdt-pax-icon-hidden') date_icon.classList.remove('rh2-business-filter-pdt-date-icon-hidden') time_icon.classList.remove('rh2-business-filter-pdt-time-icon-hidden') this.cfg_blf.search.run() toggle_pdt_clear_col() }.bind(this)) const pdt_clear_icon = document.createElement('div') pdt_clear_icon.classList.add('rh2-business-filter-pdt-clear-icon') pdt_clear_col.appendChild(pdt_clear_icon) const toggle_pdt_clear_col = function() { let state = 'OFF' if (pax_el.innerText != '' || date_el.innerText != '' || time_el.innerText != '') { state = 'ON' } let date_value = date_el.innerText if (state == 'OFF') { pdt_clear_col.classList.add('rh2-business-filter-pdt-clear-col-hidden') if (!date_value) { time_col.classList.add('hidden') } } else { pdt_clear_col.classList.remove('rh2-business-filter-pdt-clear-col-hidden') if (date_value > '') { time_col.classList.remove('hidden') } } } toggle_pdt_clear_col() } BusinessFilter.prototype.check_paint_inactive = function(els) { let is_group_in_use = false for (let i = 0; i < els.length; i++) { const _item_el = els[i] if (_item_el.classList.contains('rh2-business-filter-mobile-panel-item-active')) { is_group_in_use = true } } for (let i = 0; i < els.length; i++) { const _item_el = els[i] if (is_group_in_use && !_item_el.classList.contains('rh2-business-filter-mobile-panel-item-active')) { _item_el.classList.add('rh2-business-filter-mobile-panel-item-inactive') } else { _item_el.classList.remove('rh2-business-filter-mobile-panel-item-inactive') } } } BusinessFilter.prototype.render_panel = function(env) { let panel_overlay = null let panel_fixed = null let panel = null if (env == 'DESKTOP') { panel_overlay = document.createElement('div') panel_overlay.classList.add('rh2-business-filter-desktop-panel-overlay') this.cfg_blf.fm.el.appendChild(panel_overlay) panel_overlay.addEventListener('click', function() { close_panel() }.bind(this)) panel_fixed = document.createElement('div') panel_fixed.classList.add('rh2-business-filter-desktop-panel-fixed') this.cfg_blf.fm.el.appendChild(panel_fixed) panel_fixed.addEventListener('click', function(e) { e.stopPropagation() }.bind(this)) panel = document.createElement('div') panel.classList.add('rh2-business-filter-desktop-panel') panel_fixed.appendChild(panel) const close_el = document.createElement('div') close_el.classList.add('rh2-business-filter-desktop-panel-close') close_el.addEventListener('click', function() { close_panel() }.bind(this)) panel_fixed.appendChild(close_el) } else if (env == 'MOBILE') { panel_overlay = document.createElement('div') panel_overlay.classList.add('rh2-business-filter-mobile-panel-overlay') this.cfg_blf.fm.el.appendChild(panel_overlay) panel_fixed = document.createElement('div') panel_fixed.classList.add('rh2-business-filter-mobile-panel-fixed') this.cfg_blf.fm.el.appendChild(panel_fixed) panel = document.createElement('div') panel.classList.add('rh2-business-filter-mobile-panel') panel_fixed.appendChild(panel) const close_el = document.createElement('div') close_el.classList.add('rh2-business-filter-mobile-panel-close') close_el.addEventListener('click', function() { close_panel() }.bind(this)) panel.appendChild(close_el) } const close_panel = function() { panel.parentNode.removeChild(panel) panel_fixed.parentNode.removeChild(panel_fixed) panel_overlay.parentNode.removeChild(panel_overlay) } const heading_el = document.createElement('div') heading_el.classList.add('rh2-business-filter-mobile-heading') heading_el.innerText = 'Filters' panel.appendChild(heading_el) const category_code = this.cfg_bl_params['category'] && this.cfg_bl_params['category'][0] || 'ALL' const filter_list = this.get_filter_list(category_code) const active_filter_s = new Set() const item_els_product = [] const item_els_structure = [] const item_els_hd_discount = [] const item_els_price = [] const item_els_cuisine = [] const item_els_dietary = [] const item_els_feature = [] const item_els_booking = [] for (let i = 0; i < filter_list.length; i++) { const filter_tuple = filter_list[i] const [code, title] = filter_tuple if (this.cfg_blf.get_name() == 'BusinessListMobileMap' && code == 'PROMOTION') { const panel_el = document.createElement('div') panel_el.classList.add('rh2-business-filter-mobile-panel-section') panel.appendChild(panel_el) panel_el.classList.add('rh2-business-filter-mobile-panel-section-promotion') { const heading_el = document.createElement('div') heading_el.classList.add('rh2-business-filter-mobile-panel-section-heading') heading_el.innerText = 'Type of Promotion' panel_el.appendChild(heading_el) } { const body_el = document.createElement('div') body_el.classList.add('rh2-business-filter-mobile-panel-section-promotion-body') panel_el.appendChild(body_el) } } if (code == 'PRICE') { const panel_el = document.createElement('div') panel_el.classList.add('rh2-business-filter-mobile-panel-section') panel.appendChild(panel_el) panel_el.classList.add('rh2-business-filter-mobile-panel-section-price') const heading_el = document.createElement('div') heading_el.classList.add('rh2-business-filter-mobile-panel-section-heading') heading_el.innerText = 'Price' panel_el.appendChild(heading_el) const body_el = document.createElement('div') body_el.classList.add('rh2-business-filter-mobile-panel-section-price-body') panel_el.appendChild(body_el) for (let i = 0; i < this.OPTIONS_PRICE.length; i++) { const option = this.OPTIONS_PRICE[i] let value = '' let label = '' if (Array.isArray(option)) { value = option[0] label = option[1] } else { value = option label = option } const item_el = document.createElement('div') item_el.setAttribute('rh2-valuegroup-value', value) item_el.classList.add('rh2-business-filter-mobile-panel-section-price-item') if (this.cfg_blf.has_param_value('price', value)) { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } body_el.appendChild(item_el) item_els_price.push(item_el) item_el.addEventListener('click', function() { if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } else { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_price) }.bind(this)) const item_text_el = document.createElement('div') item_text_el.classList.add('rh2-business-filter-mobile-panel-section-price-item-text') item_text_el.innerText = label item_el.appendChild(item_text_el) } this.check_paint_inactive(item_els_price) } if (code == 'CUISINE') { const panel_el = document.createElement('div') panel_el.classList.add('rh2-business-filter-mobile-panel-section') panel.appendChild(panel_el) panel_el.classList.add('rh2-business-filter-mobile-panel-section-cuisine') const heading_el = document.createElement('div') heading_el.classList.add('rh2-business-filter-mobile-panel-section-heading') heading_el.innerText = 'Cuisine' panel_el.appendChild(heading_el) const body_el = document.createElement('div') body_el.classList.add('rh2-business-filter-mobile-panel-section-cuisine-body') panel_el.appendChild(body_el) for (let i = 0; i < this.OPTIONS_CUISINE.length; i++) { const option = this.OPTIONS_CUISINE[i] let value = '' let label = '' let icon = null if (Array.isArray(option)) { value = option[0] label = option[1] icon = option[2] } else { value = option label = option } const item_el = document.createElement('div') item_el.setAttribute('rh2-valuegroup-value', value) item_el.classList.add('rh2-business-filter-mobile-panel-section-item') item_el.classList.add('rh2-business-filter-mobile-panel-section-cuisine-item') item_el.style['background-color'] = this.filter_colors[0] if (this.cfg_blf.has_param_value('cuisine', value)) { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } body_el.appendChild(item_el) item_els_cuisine.push(item_el) item_el.addEventListener('click', function() { if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } else { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_cuisine) }.bind(this)) const item_text_el = document.createElement('div') item_text_el.classList.add('rh2-business-filter-mobile-panel-section-cuisine-item-text') item_text_el.innerText = label item_el.appendChild(item_text_el) } this.check_paint_inactive(item_els_cuisine) } if (code == 'DIETARY') { const panel_el = document.createElement('div') panel_el.classList.add('rh2-business-filter-mobile-panel-section') panel.appendChild(panel_el) panel_el.classList.add('rh2-business-filter-mobile-panel-section-dietary') const heading_el = document.createElement('div') heading_el.classList.add('rh2-business-filter-mobile-panel-section-heading') heading_el.innerText = 'Dietary' panel_el.appendChild(heading_el) const body_el = document.createElement('div') body_el.classList.add('rh2-business-filter-mobile-panel-section-dietary-body') panel_el.appendChild(body_el) for (let i = 0; i < this.OPTIONS_DIETARY.length; i++) { const option = this.OPTIONS_DIETARY[i] let value = '' let label = '' let icon = null if (Array.isArray(option)) { value = option[0] label = option[1] icon = option[2] } else { value = option label = option } const item_el = document.createElement('div') item_el.setAttribute('rh2-valuegroup-value', value) item_el.classList.add('rh2-business-filter-mobile-panel-section-item') item_el.classList.add('rh2-business-filter-mobile-panel-section-dietary-item') item_el.style['background-color'] = this.filter_colors[1] if (this.cfg_blf.has_param_value('dietary', value)) { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } body_el.appendChild(item_el) item_els_dietary.push(item_el) item_el.addEventListener('click', function() { if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } else { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_dietary) }.bind(this)) const item_text_el = document.createElement('div') item_text_el.classList.add('rh2-business-filter-mobile-panel-section-dietary-item-text') item_text_el.innerText = label item_el.appendChild(item_text_el) } this.check_paint_inactive(item_els_dietary) } if (code == 'FEATURE') { const panel_el = document.createElement('div') panel_el.classList.add('rh2-business-filter-mobile-panel-section') panel.appendChild(panel_el) panel_el.classList.add('rh2-business-filter-mobile-panel-section-feature') const heading_el = document.createElement('div') heading_el.classList.add('rh2-business-filter-mobile-panel-section-heading') heading_el.innerText = 'Feature' panel_el.appendChild(heading_el) const body_el = document.createElement('div') body_el.classList.add('rh2-business-filter-mobile-panel-section-feature-body') panel_el.appendChild(body_el) for (let i = 0; i < this.OPTIONS_FEATURE.length; i++) { const option = this.OPTIONS_FEATURE[i] let value = '' let label = '' let icon = null if (Array.isArray(option)) { value = option[0] label = option[1] icon = option[2] } else { value = option label = option } const item_el = document.createElement('div') item_el.setAttribute('rh2-valuegroup-value', value) item_el.classList.add('rh2-business-filter-mobile-panel-section-item') item_el.classList.add('rh2-business-filter-mobile-panel-section-feature-item') item_el.style['background-color'] = this.filter_colors[7] if (this.cfg_blf.has_param_value('feature', value)) { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } body_el.appendChild(item_el) item_els_feature.push(item_el) item_el.addEventListener('click', function() { if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } else { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_feature) }.bind(this)) const item_text_el = document.createElement('div') item_text_el.classList.add('rh2-business-filter-mobile-panel-section-feature-item-text') item_text_el.innerText = label item_el.appendChild(item_text_el) } this.check_paint_inactive(item_els_feature) } } const action_row_el = document.createElement('div') action_row_el.classList.add('rh2-business-filter-mobile-panel-section-action-row') panel.appendChild(action_row_el) const apply_el = document.createElement('div') apply_el.classList.add('rh2-business-filter-mobile-panel-section-action-row-apply') apply_el.innerText = 'Apply' action_row_el.appendChild(apply_el) apply_el.addEventListener('click', function() { if (item_els_booking.length > 0 && item_els_booking[0].innerText != '') { this.cfg_blf.set_param_value('av_pax', item_els_booking[0].innerText) } else { this.cfg_blf.clear_param_values('av_pax') } if (item_els_booking.length > 1 && item_els_booking[1].innerText != '') { this.cfg_blf.set_param_value('av_date', item_els_booking[1].innerText) } else { this.cfg_blf.clear_param_values('av_date') } if (item_els_booking.length > 2 && item_els_booking[2].innerText != '') { this.cfg_blf.set_param_value('av_time', item_els_booking[2].innerText) } else { this.cfg_blf.clear_param_values('av_time') } for (let i = 0; i < item_els_product.length; i++) { const item_el = item_els_product[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('promotion_product', value) } else { this.cfg_blf.remove_param_value('promotion_product', value) } } for (let i = 0; i < item_els_structure.length; i++) { const item_el = item_els_structure[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('promotion_structure', value) } else { this.cfg_blf.remove_param_value('promotion_structure', value) } } for (let i = 0; i < item_els_hd_discount.length; i++) { const item_el = item_els_hd_discount[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('hd_discount', value) } else { this.cfg_blf.remove_param_value('hd_discount', value) } } for (let i = 0; i < item_els_price.length; i++) { const item_el = item_els_price[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('price', value) } else { this.cfg_blf.remove_param_value('price', value) } } for (let i = 0; i < item_els_cuisine.length; i++) { const item_el = item_els_cuisine[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('cuisine', value) } else { this.cfg_blf.remove_param_value('cuisine', value) } } for (let i = 0; i < item_els_dietary.length; i++) { const item_el = item_els_dietary[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('dietary', value) } else { this.cfg_blf.remove_param_value('dietary', value) } } for (let i = 0; i < item_els_feature.length; i++) { const item_el = item_els_feature[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('feature', value) } else { this.cfg_blf.remove_param_value('feature', value) } } close_panel() this.cfg_blf.search.run() this.cfg_on_active_filter_num_change(this.get_active_filter_count()) }.bind(this)) const reset_el = document.createElement('div') reset_el.classList.add('rh2-business-filter-mobile-panel-section-action-row-reset') reset_el.innerText = 'Reset' action_row_el.appendChild(reset_el) reset_el.addEventListener('click', function() { for (let i = 0; i < item_els_structure.length; i++) { const item_el = item_els_structure[i] item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } for (let i = 0; i < item_els_hd_discount.length; i++) { const item_el = item_els_hd_discount[i] item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } for (let i = 0; i < item_els_price.length; i++) { const item_el = item_els_price[i] item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } for (let i = 0; i < item_els_cuisine.length; i++) { const item_el = item_els_cuisine[i] item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } for (let i = 0; i < item_els_dietary.length; i++) { const item_el = item_els_dietary[i] item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } for (let i = 0; i < item_els_feature.length; i++) { const item_el = item_els_feature[i] item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_structure) this.check_paint_inactive(item_els_hd_discount) this.check_paint_inactive(item_els_price) this.check_paint_inactive(item_els_cuisine) this.check_paint_inactive(item_els_dietary) this.check_paint_inactive(item_els_feature) }.bind(this)) } BusinessFilter.prototype.render_promotion_structure_row = function(row_el) { const item_els_structure = [] const item_els_hd_discount = [] let body = document.querySelector('.rh2-business-filter-mobile-panel-section-promotion-body') if (body) { body.remove() } const body_el = document.createElement('div') body_el.classList.add('rh2-business-filter-mobile-panel-section-promotion-body') row_el.appendChild(body_el) const category_code = this.cfg_bl_params['category'] && this.cfg_bl_params['category'][0] || 'ALL' if (category_code == 'ALL') { // we don't need promotion structure filters for restaurants, // as we have dedicated categories (specials/hotdeals) this.OPTIONS_STRUCTURE = [] } if (category_code == 'SPECIAL_HD') { for (let option of this.OPTIONS_HD_DISCOUNT) { let value = option[0] let label = option[1] const item_el = document.createElement('div') item_el.setAttribute('rh2-valuegroup-value', value) item_el.classList.add('rh2-business-filter-mobile-panel-section-promotion-item') if (this.cfg_blf.has_param_value('hd_discount', value)) { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } body_el.appendChild(item_el) item_els_hd_discount.push(item_el) item_el.addEventListener('click', function() { if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } else { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_hd_discount) for (let i = 0; i < item_els_hd_discount.length; i++) { const item_el = item_els_hd_discount[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('hd_discount', value) } else { this.cfg_blf.remove_param_value('hd_discount', value) } } this.cfg_blf.search.run() }.bind(this)) const item_text_el = document.createElement('div') item_text_el.classList.add('rh2-business-filter-mobile-panel-section-promotion-item-text') item_text_el.innerText = label item_el.appendChild(item_text_el) } } else { for (let i = 0; i < this.OPTIONS_STRUCTURE.length; i++) { const option = this.OPTIONS_STRUCTURE[i] let value = '' let label = '' if (Array.isArray(option)) { value = option[0] label = option[1] } else { value = option label = option } const item_el = document.createElement('div') item_el.setAttribute('rh2-valuegroup-value', value) item_el.classList.add('rh2-business-filter-mobile-panel-section-promotion-item') if (this.cfg_blf.has_param_value('promotion_structure', value)) { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } body_el.appendChild(item_el) item_els_structure.push(item_el) item_el.addEventListener('click', function() { if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { item_el.classList.remove('rh2-business-filter-mobile-panel-section-item-active') } else { item_el.classList.add('rh2-business-filter-mobile-panel-section-item-active') } this.check_paint_inactive(item_els_structure) for (let i = 0; i < item_els_structure.length; i++) { const item_el = item_els_structure[i] const value = item_el.getAttribute('rh2-valuegroup-value') if (item_el.classList.contains('rh2-business-filter-mobile-panel-section-item-active')) { this.cfg_blf.add_param_value('promotion_structure', value) } else { this.cfg_blf.remove_param_value('promotion_structure', value) } } this.cfg_blf.search.run() }.bind(this)) const item_text_el = document.createElement('div') item_text_el.classList.add('rh2-business-filter-mobile-panel-section-promotion-item-text') item_text_el.innerText = label item_el.appendChild(item_text_el) } } this.check_paint_inactive(item_els_structure) this.check_paint_inactive(item_els_hd_discount) } rh2.BusinessFilter = BusinessFilter })()</script> <script>// # BusinessCard ; (function() { const BusinessCard = function(data, qd, blf) { this.data = data this.qd = qd this.cfg_blf = blf } BusinessCard.prototype.make_item_page_url = function(qd) { let url = this.data['item_page_url'] let pairs = [] for (let k in this.qd || {}) { let v = this.qd[k] if (!Array.isArray(v)) { continue } for (let i = 0; i < v.length; i++) { if (v[i] == null) { continue } pairs.push([k, v[i]]) } } for (let k in qd) { let v = qd[k] if (!Array.isArray(v)) { continue } for (let i = 0; i < v.length; i++) { if (v[i] == null) { continue } pairs.push([k, v[i]]) } } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { url = url + '?' + querystring } return url } BusinessCard.prototype.open_item_page = function(qd) { document.location.href = this.make_item_page_url(qd) } BusinessCard.prototype.render = function(i) { if (rh2.utils.is_desktop()) { return this.render_desktop(i) } else if (rh2.utils.is_mobile()) { return this.render_mobile(i) } } BusinessCard.prototype.render_desktop = function(i) { const card_el = document.createElement('div') card_el.classList.add('rh2-business-card-desktop') if (i != null && this.cfg_blf && this.cfg_blf.desktop_map_wrapper_el) { const map_wrapper_el = this.cfg_blf.desktop_map_wrapper_el const markers = this.cfg_blf.desktop_map_wrapper_el.markers card_el.addEventListener('mouseenter', function() { for (let i = 0; i < markers.length; i++) { const marker = markers[i] if (marker.rh_slug == this.data['slug']) { map_wrapper_el.highlighted_marker_idx = i map_wrapper_el.highlighted_marker_icon = marker.content const icon_file_path = '/rh2/static/icon/site/map/marker_black.png' const icon_url = window.location.origin + icon_file_path const marker_img = document.createElement('img') marker_img.src = icon_url marker.content = marker_img break } } }.bind(this)) card_el.addEventListener('mouseleave', function() { if (map_wrapper_el.highlighted_marker_idx != null) { let idx = map_wrapper_el.highlighted_marker_idx map_wrapper_el.markers[idx].content = map_wrapper_el.highlighted_marker_icon map_wrapper_el.highlighted_marker_idx = null map_wrapper_el.highlighted_marker_icon = null } }.bind(this)) } if (this.data['name'] == undefined) { return card_el } const image_el = document.createElement('a') image_el.classList.add('rh2-business-card-desktop-image') image_el.classList.add('rh2-dbgi') image_el.setAttribute('href', this.make_item_page_url()) image_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({}) }.bind(this)) rh2.utils.schedule_bgi(image_el, this.data['image_url'], 0) card_el.appendChild(image_el) const attrs_el = document.createElement('div') attrs_el.classList.add('rh2-business-card-desktop-attrs') card_el.appendChild(attrs_el) const name_el = document.createElement('a') name_el.classList.add('rh2-business-card-desktop-name') name_el.innerText = this.data['name'] attrs_el.appendChild(name_el) name_el.setAttribute('href', this.make_item_page_url()) name_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({}) }.bind(this)) const address_el = document.createElement('div') address_el.classList.add('rh2-business-card-desktop-address') address_el.innerText = this.data['address'] attrs_el.appendChild(address_el) const cuisine_text = this.data['cuisine_vals'].slice(0, 5).join(' · ') const cuisine_el = document.createElement('div') cuisine_el.classList.add('rh2-business-card-desktop-cuisine') cuisine_el.innerText = cuisine_text attrs_el.appendChild(cuisine_el) const review_el = document.createElement('div') review_el.classList.add('rh2-business-card-desktop-review') attrs_el.appendChild(review_el) if (this.data['ta_rating'] && this.data['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-card-desktop-review-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + this.data['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") review_el.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-business-card-desktop-review-ta-number') ta_num_reviews_el.innerText = this.data['ta_num_reviews'] + ' Reviews' review_el.appendChild(ta_num_reviews_el) } const price_level = this.data['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_el = document.createElement('div') price_el.classList.add('rh2-business-card-desktop-price') attrs_el.appendChild(price_el) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-business-card-desktop-price-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-business-card-desktop-price-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) let hotdeals = this.data['specials_hd'] let specials = this.data['specials'] const action_row_el = document.createElement('div') action_row_el.classList.add('rh2-business-card-desktop-action-row') attrs_el.appendChild(action_row_el) if (specials.length) { const action_special_col_el = document.createElement('div') action_special_col_el.classList.add('rh2-business-card-desktop-action-special-col') action_row_el.appendChild(action_special_col_el) const action_special_el = document.createElement('div') action_special_el.classList.add('rh2-business-card-desktop-action-special') action_special_el.innerText = 'Specials' action_special_col_el.appendChild(action_special_el) const action_special_icon_el = document.createElement('div') action_special_icon_el.classList.add('rh2-business-card-desktop-action-special-icon') $(action_special_el).prepend(action_special_icon_el) const action_special_count_el = document.createElement('div') action_special_count_el.classList.add('rh2-business-card-desktop-action-special-count') action_special_el.appendChild(action_special_count_el) action_special_count_el.innerText = specials.length.toString() action_special_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({ 'scrollto': ['SPECIAL'], }) }.bind(this)) } if (hotdeals.length) { const action_hotdeal_col_el = document.createElement('div') action_hotdeal_col_el.classList.add('rh2-business-card-desktop-action-hotdeal-col') action_row_el.appendChild(action_hotdeal_col_el) const action_hotdeal_el = document.createElement('div') action_hotdeal_el.classList.add('rh2-business-card-desktop-action-hotdeal') action_hotdeal_el.innerText = 'Hot Deals!' action_hotdeal_col_el.appendChild(action_hotdeal_el) const action_hotdeal_icon_el = document.createElement('div') action_hotdeal_icon_el.classList.add('rh2-business-card-desktop-action-hotdeal-icon') $(action_hotdeal_el).prepend(action_hotdeal_icon_el) const action_hotdeal_count_el = document.createElement('div') action_hotdeal_count_el.classList.add('rh2-business-card-desktop-action-hotdeal-count') action_hotdeal_el.appendChild(action_hotdeal_count_el) // action_hotdeal_el.classList.add('rh2-business-card-desktop-action-hotdeal-grey') // action_hotdeal_count_el.classList.add('rh2-business-card-desktop-action-hotdeal-count-hidden') action_hotdeal_count_el.innerText = hotdeals.length.toString() action_hotdeal_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({ 'scrollto': ['SPECIAL'], }) }.bind(this)) } const action_book_col_el = document.createElement('div') action_book_col_el.classList.add('rh2-business-card-desktop-action-book-col') action_row_el.appendChild(action_book_col_el) const action_book_el = document.createElement('div') action_book_el.classList.add('rh2-business-card-desktop-action-book') action_book_el.innerText = 'Book' action_book_col_el.appendChild(action_book_el) if (this.data['bookable'] == false) { action_book_el.classList.add('rh2-business-card-desktop-action-book-hidden') } else { action_book_el.addEventListener('click', function(e) { e.preventDefault() let url = this.data['item_page_url'] + 'booking/' let pairs = [] if (this.qd['av_date'] && this.qd['av_date'][0] != null) { pairs.push(['av_date', this.qd['av_date'][0]]) } if (this.qd['av_pax'] && this.qd['av_pax'][0] != null) { pairs.push(['av_pax', this.qd['av_pax'][0]]) } if (this.qd['av_time'] && this.qd['av_time'][0] != null) { pairs.push(['av_time', this.qd['av_time'][0]]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { url = url + '?' + querystring } document.location.href = url }.bind(this)) } return card_el } BusinessCard.prototype.render_mobile = function(i) { const card_el = document.createElement('div') card_el.classList.add('rh2-business-card-mobile') if (this.data['name'] == undefined) { return card_el } const image_block = document.createElement('div') image_block.classList.add('rh2-business-card-image-block') card_el.appendChild(image_block) const business_page_url = this.make_item_page_url() const image_el = document.createElement('a') image_el.classList.add('rh2-business-card-mobile-image') image_el.classList.add('rh2-dbgi') image_el.setAttribute('href', business_page_url) rh2.utils.schedule_bgi(image_el, this.data['image_url'], 0) image_block.appendChild(image_el) const action_row_el = document.createElement('div') action_row_el.classList.add('rh2-business-card-mobile-action-row') image_block.appendChild(action_row_el) if (this.data.specials_hd.length > 0) { const action_hotdeal_col_el = document.createElement('div') action_hotdeal_col_el.classList.add('rh2-business-card-mobile-action-hotdeal-col') action_row_el.appendChild(action_hotdeal_col_el) const action_hotdeal_el = document.createElement('div') action_hotdeal_el.classList.add('rh2-business-card-mobile-action-hotdeal') action_hotdeal_col_el.appendChild(action_hotdeal_el) const action_hotdeal_icon_el = document.createElement('div') action_hotdeal_icon_el.classList.add('rh2-business-card-mobile-action-hotdeal-icon') action_hotdeal_el.appendChild(action_hotdeal_icon_el) const action_hotdeal_text_el = document.createElement('div') action_hotdeal_text_el.classList.add('rh2-business-card-mobile-action-hotdeal-text') action_hotdeal_text_el.innerText = 'Hot Deals' action_hotdeal_el.appendChild(action_hotdeal_text_el) action_hotdeal_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({ 'scrollto': ['SPECIAL'] }) }.bind(this)) } if (this.data.specials.length > 0) { const action_special_col_el = document.createElement('div') action_special_col_el.classList.add('rh2-business-card-mobile-action-special-col') action_row_el.appendChild(action_special_col_el) const action_special_el = document.createElement('div') action_special_el.classList.add('rh2-business-card-mobile-action-special') action_special_col_el.appendChild(action_special_el) const action_special_icon_el = document.createElement('div') action_special_icon_el.classList.add('rh2-business-card-mobile-action-special-icon') action_special_el.appendChild(action_special_icon_el) const action_special_text_el = document.createElement('div') action_special_text_el.classList.add('rh2-business-card-mobile-action-special-text') action_special_text_el.innerText = "Specials" action_special_el.appendChild(action_special_text_el) action_special_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({ 'scrollto': ['SPECIAL'] }) }.bind(this)) } const action_book_col_el = document.createElement('div') action_book_col_el.classList.add('rh2-business-card-mobile-action-book-col') action_row_el.appendChild(action_book_col_el) const action_book_el = document.createElement('div') action_book_el.classList.add('rh2-business-card-mobile-action-book') action_book_el.innerText = 'Book' action_book_col_el.appendChild(action_book_el) if (this.data['bookable'] == false) { action_book_el.classList.add('rh2-business-card-mobile-action-book-hidden') } else { action_book_el.addEventListener('click', function(e) { document.location.href = this.data.item_page_url + 'booking/' }.bind(this)) } const attrs_el = document.createElement('div') attrs_el.classList.add('rh2-business-card-mobile-attrs') card_el.appendChild(attrs_el) const attrs_name_row = document.createElement('div') attrs_name_row.classList.add('rh2-business-card-mobile-attrs-name-row') attrs_el.appendChild(attrs_name_row) const name_el = document.createElement('a') name_el.classList.add('rh2-business-card-mobile-name') name_el.innerText = this.data['name'] attrs_name_row.appendChild(name_el) name_el.setAttribute('href', this.make_item_page_url()) name_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({}) }.bind(this)) const review_el = document.createElement('div') review_el.classList.add('rh2-business-card-mobile-review') attrs_name_row.appendChild(review_el) if (this.data['ta_rating'] && this.data['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-card-mobile-review-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + this.data['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") review_el.appendChild(ta_image_el) } const attrs_cuisine_row = document.createElement('div') attrs_cuisine_row.classList.add('rh2-business-card-mobile-attrs-cuisine-row') attrs_el.appendChild(attrs_cuisine_row) const cuisine_text = this.data['cuisine_vals'].slice(0, 5).join(' · ') const cuisine_el = document.createElement('div') cuisine_el.classList.add('rh2-business-card-mobile-cuisine') cuisine_el.innerText = cuisine_text attrs_cuisine_row.appendChild(cuisine_el) const price_level = this.data['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_el = document.createElement('div') price_el.classList.add('rh2-business-card-mobile-price') attrs_cuisine_row.appendChild(price_el) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-business-card-mobile-price-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-business-card-mobile-price-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) return card_el } BusinessCard.render_separator = function(i) { const sep_el = document.createElement('div') if (rh2.utils.is_desktop()) { sep_el.classList.add('rh2-business-card-desktop-separator') } else if (rh2.utils.is_mobile()) { sep_el.classList.add('rh2-business-card-mobile-separator') } return sep_el } BusinessCard.prototype.render_card_for_homepage_restaurants = function() { // console.log(this.data) const card_el = document.createElement('div') card_el.classList.add('rh2-business-card-desktop') if (!this.data) { return card_el } const image_el = document.createElement('a') image_el.classList.add('rh2-business-card-desktop-image') image_el.classList.add('rh2-dbgi') image_el.setAttribute('href', this.make_item_page_url()) image_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({}) }.bind(this)) rh2.utils.schedule_bgi(image_el, this.data['image_url'], 0) card_el.appendChild(image_el) const attrs_el = document.createElement('div') attrs_el.classList.add('rh2-business-card-desktop-attrs') card_el.appendChild(attrs_el) const name_el = document.createElement('a') name_el.classList.add('rh2-business-card-desktop-name') name_el.innerText = this.data['name'] attrs_el.appendChild(name_el) name_el.setAttribute('href', this.make_item_page_url()) name_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({}) }.bind(this)) const address_el = document.createElement('div') address_el.classList.add('rh2-business-card-desktop-address') address_el.innerText = this.data['address'] attrs_el.appendChild(address_el) const cuisine_text = this.data['cuisine_vals'].slice(0, 5).join(' · ') const cuisine_el = document.createElement('div') cuisine_el.classList.add('rh2-business-card-desktop-cuisine') cuisine_el.innerText = cuisine_text attrs_el.appendChild(cuisine_el) const review_el = document.createElement('div') review_el.classList.add('rh2-business-card-desktop-review') attrs_el.appendChild(review_el) if (this.data['ta_rating'] && this.data['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-card-desktop-review-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + this.data['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") review_el.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-business-card-desktop-review-ta-number') ta_num_reviews_el.innerText = this.data['ta_num_reviews'] + ' Reviews' review_el.appendChild(ta_num_reviews_el) } const price_level = this.data['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_el = document.createElement('div') price_el.classList.add('rh2-business-card-desktop-price') attrs_el.appendChild(price_el) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-business-card-desktop-price-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-business-card-desktop-price-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) let hotdeals = this.data['hotdeals'] let specials = this.data['specials'] const action_row_el = document.createElement('div') action_row_el.classList.add('rh2-business-card-desktop-action-row') attrs_el.appendChild(action_row_el) const action_hotdeal_col_el = document.createElement('div') action_hotdeal_col_el.classList.add('rh2-business-card-desktop-action-hotdeal-col') action_row_el.appendChild(action_hotdeal_col_el) const action_hotdeal_el = document.createElement('div') action_hotdeal_el.classList.add('rh2-business-card-desktop-action-hotdeal') action_hotdeal_el.innerText = 'Takeaways' action_hotdeal_col_el.appendChild(action_hotdeal_el) const action_hotdeal_icon_el = document.createElement('div') action_hotdeal_icon_el.classList.add('rh2-business-card-desktop-action-hotdeal-icon') action_hotdeal_el.appendChild(action_hotdeal_icon_el) const action_hotdeal_count_el = document.createElement('div') action_hotdeal_count_el.classList.add('rh2-business-card-desktop-action-hotdeal-count') action_hotdeal_el.appendChild(action_hotdeal_count_el) if (hotdeals.length == 0) { action_hotdeal_el.classList.add('rh2-business-card-desktop-action-hotdeal-grey') action_hotdeal_count_el.classList.add('rh2-business-card-desktop-action-hotdeal-count-hidden') // hide column but let it occupy same space to keep layout consistent action_hotdeal_col_el.classList.add('invisible') } else { action_hotdeal_count_el.innerText = hotdeals.length.toString() action_hotdeal_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({ 'scrollto': ['SPECIAL'], }) }.bind(this)) } const action_special_col_el = document.createElement('div') action_special_col_el.classList.add('rh2-business-card-desktop-action-special-col') action_row_el.appendChild(action_special_col_el) const action_special_el = document.createElement('div') action_special_el.classList.add('rh2-business-card-desktop-action-special') action_special_el.innerText = 'Specials' action_special_col_el.appendChild(action_special_el) const action_special_icon_el = document.createElement('div') action_special_icon_el.classList.add('rh2-business-card-desktop-action-special-icon') action_special_el.appendChild(action_special_icon_el) const action_special_count_el = document.createElement('div') action_special_count_el.classList.add('rh2-business-card-desktop-action-special-count') action_special_el.appendChild(action_special_count_el) if (specials.length == 0) { action_special_el.classList.add('rh2-business-card-desktop-action-special-grey') action_special_count_el.classList.add('rh2-business-card-desktop-action-special-count-hidden') } else { action_special_count_el.innerText = specials.length.toString() action_special_el.addEventListener('click', function(e) { e.preventDefault() this.open_item_page({ 'scrollto': ['SPECIAL'], }) }.bind(this)) } const action_book_col_el = document.createElement('div') action_book_col_el.classList.add('rh2-business-card-desktop-action-book-col') action_row_el.appendChild(action_book_col_el) const action_book_el = document.createElement('div') action_book_el.classList.add('rh2-business-card-desktop-action-book') action_book_el.innerText = 'Book' action_book_col_el.appendChild(action_book_el) if (this.data['bookable'] == false) { action_book_el.classList.add('rh2-business-card-desktop-action-book-hidden') } else { action_book_el.addEventListener('click', function(e) { e.preventDefault() let url = this.data['item_page_url'] + 'booking/' let pairs = [] if (this.qd['av_date'] && this.qd['av_date'][0] != null) { pairs.push(['av_date', this.qd['av_date'][0]]) } if (this.qd['av_pax'] && this.qd['av_pax'][0] != null) { pairs.push(['av_pax', this.qd['av_pax'][0]]) } if (this.qd['av_time'] && this.qd['av_time'][0] != null) { pairs.push(['av_time', this.qd['av_time'][0]]) } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { url = url + '?' + querystring } document.location.href = url }.bind(this)) } return card_el } rh2.BusinessCard = BusinessCard })()</script> <script>// # BusinessInfoWindow ; (function() { const BusinessInfoWindow = function(map_item_data, fm) { this.map_item_data = map_item_data this.fm = fm this.data = null const infowindow_el = this.infowindow_el = document.createElement('div') } BusinessInfoWindow.prototype.load = function() { return new Promise((resolve, reject) => { let url = '/rh2/service/business/business_item_get/' + this.map_item_data['slug'] + '/' let xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const data = rtn.data if (rtn.errcode === 404) { return } this.data = data if (rh2.utils.is_desktop()) { this.render_desktop() resolve(this.infowindow_el) } else if (rh2.utils.is_mobile()) { this.render_mobile() resolve(this.infowindow_el) } }.bind(this)) xhr.open("GET", url) xhr.send() }) //return this.inforwindow_el } BusinessInfoWindow.prototype.render_desktop = function() { const infowindow_el = this.infowindow_el infowindow_el.classList.add('rh2-business-infowindow-desktop') const attrs_row = document.createElement('div') attrs_row.classList.add('rh2-business-infowindow-desktop-attrs-row') infowindow_el.appendChild(attrs_row) const coupon_row = document.createElement('div') coupon_row.classList.add('rh2-business-infowindow-desktop-coupon-row') infowindow_el.appendChild(coupon_row) const special_row = document.createElement('div') special_row.classList.add('rh2-business-infowindow-desktop-special-row') infowindow_el.appendChild(special_row) const book_row = document.createElement('div') book_row.classList.add('rh2-business-infowindow-desktop-book-row') infowindow_el.appendChild(book_row) const image_el = document.createElement('div') image_el.classList.add('rh2-business-infowindow-desktop-image') image_el.classList.add('rh2-dbgi') rh2.utils.schedule_bgi(image_el, this.data['logo_image_url'], 0) attrs_row.appendChild(image_el) const attrs_el = document.createElement('div') attrs_el.classList.add('rh2-business-infowindow-desktop-attrs') attrs_row.appendChild(attrs_el) const name_el = document.createElement('div') name_el.classList.add('rh2-business-infowindow-desktop-name') name_el.innerText = this.data['name'] attrs_el.appendChild(name_el) name_el.addEventListener('click', function(e) { e.preventDefault() document.location.href = this.data['item_page_url'] //e.preventDefault() //const params = { // slug: this.data['slug'], // url: this.data['item_page_url'], //} //this.fm.enter_fragment('BusinessItem', params) }.bind(this)) const cuisine_text = this.data['cuisine_vals'].slice(0, 5).join(' · ') const cuisine_el = document.createElement('div') cuisine_el.classList.add('rh2-business-infowindow-desktop-cuisine') cuisine_el.innerText = cuisine_text attrs_el.appendChild(cuisine_el) const review_el = document.createElement('div') review_el.classList.add('rh2-business-infowindow-desktop-review') attrs_el.appendChild(review_el) if (this.data['ta_rating'] && this.data['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-infowindow-desktop-review-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + this.data['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") review_el.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-business-infowindow-desktop-review-ta-number') if (this.data['ta_num_reviews'] > -1) { ta_num_reviews_el.innerText = this.data['ta_num_reviews'] + ' Reviews' } review_el.appendChild(ta_num_reviews_el) } const price_level = this.data['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_el = document.createElement('div') price_el.classList.add('rh2-business-infowindow-desktop-review-price') review_el.appendChild(price_el) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-business-infowindow-desktop-price-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-business-infowindow-desktop-price-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) let coupons = this.data['coupons'] || [] let specials = this.data['specials'] || [] let specials_hd = this.data['specials_hd'] || [] //let coupons = [] //let specials = [] //console.log(this.data['promotions']) //for (let i = 0; i < this.data['promotions'].length; i++) { // const promotion = this.data['promotions'][i] // if (promotion['manifestation'] == 'COUPON') { // coupons.push(promotion) // } // if (promotion['manifestation'] == 'EVEVE') { // specials.push(promotion) // } //} if (coupons.length > 0) { const coupon_heading_row = document.createElement('div') coupon_heading_row.classList.add('rh2-business-infowindow-desktop-coupon-heading-row') coupon_row.appendChild(coupon_heading_row) const coupon_heading_text = document.createElement('div') coupon_heading_text.classList.add('rh2-business-infowindow-desktop-coupon-heading-text') coupon_heading_text.innerText = 'Coupons' coupon_heading_row.appendChild(coupon_heading_text) const coupon_body_row = document.createElement('div') coupon_body_row.classList.add('rh2-business-infowindow-desktop-coupon-body-row') coupon_row.appendChild(coupon_body_row) for (let i = 0; i < Math.min(2, coupons.length); i++) { const promotion = coupons[i] const title = rh2.Promotion.get_promotion_title(promotion) const coupon_item_row = document.createElement('div') coupon_item_row.classList.add('rh2-business-infowindow-desktop-coupon-item-row') coupon_body_row.appendChild(coupon_item_row) const coupon_item_icon = document.createElement('div') coupon_item_icon.classList.add('rh2-business-infowindow-desktop-coupon-item-icon') coupon_item_row.appendChild(coupon_item_icon) const coupon_item_title = document.createElement('div') coupon_item_title.classList.add('rh2-business-infowindow-desktop-coupon-item-title') coupon_item_title.innerText = title coupon_item_row.appendChild(coupon_item_title) const coupon_item_claim = document.createElement('div') coupon_item_claim.classList.add('rh2-business-infowindow-desktop-coupon-item-claim') coupon_item_claim.innerText = 'Claim' coupon_item_row.appendChild(coupon_item_claim) coupon_item_row.addEventListener('click', function(e) { e.preventDefault() const coupon_item_page_url = this.data['item_page_url'] + 'coupon/' + promotion['uuid'] + '/' document.location.href = coupon_item_page_url }.bind(this)) } } if (specials.length > 0) { const special_heading_row = document.createElement('div') special_heading_row.classList.add('rh2-business-infowindow-desktop-special-heading-row') special_row.appendChild(special_heading_row) const special_heading_text = document.createElement('div') special_heading_text.classList.add('rh2-business-infowindow-desktop-special-heading-text') special_heading_text.innerText = 'Specials' special_heading_row.appendChild(special_heading_text) const special_body_row = document.createElement('div') special_body_row.classList.add('rh2-business-infowindow-desktop-special-body-row') special_row.appendChild(special_body_row) for (let i = 0; i < Math.min(2, specials.length); i++) { const promotion = specials[i] const title = rh2.Promotion.get_promotion_title(promotion) const special_item_row = document.createElement('div') special_item_row.classList.add('rh2-business-infowindow-desktop-special-item-row') special_body_row.appendChild(special_item_row) const special_item_icon = document.createElement('div') special_item_icon.classList.add('rh2-business-infowindow-desktop-special-item-icon') special_item_row.appendChild(special_item_icon) const special_item_title = document.createElement('div') special_item_title.classList.add('rh2-business-infowindow-desktop-special-item-title') special_item_title.innerText = title special_item_row.appendChild(special_item_title) const special_item_claim = document.createElement('div') special_item_claim.classList.add('rh2-business-infowindow-desktop-special-item-claim') special_item_claim.innerText = 'View' special_item_row.appendChild(special_item_claim) special_item_claim.addEventListener('click', function(e) { e.preventDefault() const special_item_page_url = this.data['item_page_url'] + '?special=' + promotion['uuid'] document.location.href = special_item_page_url }.bind(this)) } } if (specials_hd.length > 0) { const special_heading_row = document.createElement('div') special_heading_row.classList.add('rh2-business-infowindow-desktop-special-heading-row') special_row.appendChild(special_heading_row) const special_heading_text = document.createElement('div') special_heading_text.classList.add('rh2-business-infowindow-desktop-special-heading-text') special_heading_text.innerText = 'Hot Deals' special_heading_row.appendChild(special_heading_text) const special_body_row = document.createElement('div') special_body_row.classList.add('rh2-business-infowindow-desktop-special-body-row') special_row.appendChild(special_body_row) for (let i = 0; i < Math.min(2, specials_hd.length); i++) { const promotion = specials_hd[i] const title = rh2.Promotion.get_promotion_title(promotion) const special_item_row = document.createElement('div') special_item_row.classList.add('rh2-business-infowindow-desktop-special-item-row') special_body_row.appendChild(special_item_row) const special_item_icon = document.createElement('div') special_item_icon.classList.add('rh2-business-infowindow-desktop-special-item-icon') special_item_icon.classList.add('hotdeal') special_item_row.appendChild(special_item_icon) const special_item_title = document.createElement('div') special_item_title.classList.add('rh2-business-infowindow-desktop-special-item-title') special_item_title.innerText = title special_item_row.appendChild(special_item_title) const special_item_claim = document.createElement('div') special_item_claim.classList.add('rh2-business-infowindow-desktop-special-item-claim') special_item_claim.innerText = 'View' special_item_row.appendChild(special_item_claim) special_item_claim.addEventListener('click', function(e) { e.preventDefault() const special_item_page_url = this.data['item_page_url'] + '?special=' + promotion['uuid'] document.location.href = special_item_page_url }.bind(this)) } } if (this.data['bookable']) { const book_button = document.createElement('div') book_button.classList.add('rh2-business-infowindow-desktop-book-button') book_button.innerText = 'Book' book_row.appendChild(book_button) book_button.addEventListener('click', function(e) { e.preventDefault() document.location.href = this.data['item_page_url'] + 'booking/' }.bind(this)) } return infowindow_el } BusinessInfoWindow.prototype.render_mobile = function() { const infowindow_el = this.infowindow_el infowindow_el.classList.add('rh2-business-infowindow-mobile') const attrs_row = document.createElement('div') attrs_row.classList.add('rh2-business-infowindow-mobile-attrs-row') infowindow_el.appendChild(attrs_row) const coupon_row = document.createElement('div') coupon_row.classList.add('rh2-business-infowindow-mobile-coupon-row') infowindow_el.appendChild(coupon_row) const special_row = document.createElement('div') special_row.classList.add('rh2-business-infowindow-mobile-special-row') infowindow_el.appendChild(special_row) const book_row = document.createElement('div') book_row.classList.add('rh2-business-infowindow-mobile-book-row') infowindow_el.appendChild(book_row) //const image_el = document.createElement('div') //image_el.classList.add('rh2-business-infowindow-mobile-image') //image_el.classList.add('rh2-dbgi') //rh2.utils.schedule_bgi(image_el, this.data['logo_image_url'], (0 + 1) * 100) //attrs_row.appendChild(image_el) const attrs_el = document.createElement('div') attrs_el.classList.add('rh2-business-infowindow-mobile-attrs') attrs_row.appendChild(attrs_el) const name_el = document.createElement('div') name_el.classList.add('rh2-business-infowindow-mobile-name') name_el.innerText = this.data['name'] attrs_el.appendChild(name_el) name_el.addEventListener('click', function(e) { e.preventDefault() document.location.href = this.data['item_page_url'] //e.preventDefault() //const params = { // slug: this.data['slug'], // url: this.data['item_page_url'], //} //this.fm.enter_fragment('BusinessItem', params) }.bind(this)) const cuisine_text = this.data['cuisine_vals'].slice(0, 5).join(' · ') const cuisine_el = document.createElement('div') cuisine_el.classList.add('rh2-business-infowindow-mobile-cuisine') cuisine_el.innerText = cuisine_text attrs_el.appendChild(cuisine_el) const review_el = document.createElement('div') review_el.classList.add('rh2-business-infowindow-mobile-review') attrs_el.appendChild(review_el) if (this.data['ta_rating'] && this.data['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-business-infowindow-mobile-review-ta-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + this.data['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") review_el.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-business-infowindow-mobile-review-ta-number') if (this.data['ta_num_reviews'] > -1) { ta_num_reviews_el.innerText = this.data['ta_num_reviews'] + ' Reviews' } review_el.appendChild(ta_num_reviews_el) } const price_level = this.data['price_level'] if (price_level > 0) { const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_el = document.createElement('div') price_el.classList.add('rh2-business-infowindow-mobile-review-price') review_el.appendChild(price_el) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-business-infowindow-mobile-price-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-business-infowindow-mobile-price-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) } let coupons = this.data['coupons'] || [] let specials = this.data['specials'] || [] let specials_hd = this.data['specials_hd'] || [] if (coupons.length > 0) { const coupon_heading_row = document.createElement('div') coupon_heading_row.classList.add('rh2-business-infowindow-mobile-coupon-heading-row') coupon_row.appendChild(coupon_heading_row) const coupon_heading_text = document.createElement('div') coupon_heading_text.classList.add('rh2-business-infowindow-mobile-coupon-heading-text') coupon_heading_text.innerText = 'Coupons' coupon_heading_row.appendChild(coupon_heading_text) const coupon_body_row = document.createElement('div') coupon_body_row.classList.add('rh2-business-infowindow-mobile-coupon-body-row') coupon_row.appendChild(coupon_body_row) for (let i = 0; i < Math.min(2, coupons.length); i++) { const promotion = coupons[i] const title = rh2.Promotion.get_promotion_title(promotion) const coupon_item_row = document.createElement('div') coupon_item_row.classList.add('rh2-business-infowindow-mobile-coupon-item-row') coupon_body_row.appendChild(coupon_item_row) const coupon_item_icon = document.createElement('div') coupon_item_icon.classList.add('rh2-business-infowindow-mobile-coupon-item-icon') coupon_item_row.appendChild(coupon_item_icon) const coupon_item_title = document.createElement('div') coupon_item_title.classList.add('rh2-business-infowindow-mobile-coupon-item-title') coupon_item_title.innerText = title coupon_item_row.appendChild(coupon_item_title) const coupon_item_claim = document.createElement('div') coupon_item_claim.classList.add('rh2-business-infowindow-mobile-coupon-item-claim') coupon_item_claim.innerText = 'Claim' coupon_item_row.appendChild(coupon_item_claim) coupon_item_row.addEventListener('click', function(e) { e.preventDefault() const coupon_item_page_url = this.data['item_page_url'] + 'coupon/' + promotion['uuid'] + '/' document.location.href = coupon_item_page_url }.bind(this)) } } if (specials.length > 0) { const special_heading_row = document.createElement('div') special_heading_row.classList.add('rh2-business-infowindow-mobile-special-heading-row') special_row.appendChild(special_heading_row) const special_heading_text = document.createElement('div') special_heading_text.classList.add('rh2-business-infowindow-mobile-special-heading-text') special_heading_text.innerText = 'Specials' special_heading_row.appendChild(special_heading_text) const special_body_row = document.createElement('div') special_body_row.classList.add('rh2-business-infowindow-mobile-special-body-row') special_row.appendChild(special_body_row) for (let i = 0; i < Math.min(2, specials.length); i++) { const promotion = specials[i] const title = rh2.Promotion.get_promotion_title(promotion) const special_item_row = document.createElement('div') special_item_row.classList.add('rh2-business-infowindow-mobile-special-item-row') special_body_row.appendChild(special_item_row) const special_item_icon = document.createElement('div') special_item_icon.classList.add('rh2-business-infowindow-mobile-special-item-icon') special_item_row.appendChild(special_item_icon) const special_item_title = document.createElement('div') special_item_title.classList.add('rh2-business-infowindow-mobile-special-item-title') special_item_title.innerText = title special_item_row.appendChild(special_item_title) const special_item_claim = document.createElement('div') special_item_claim.classList.add('rh2-business-infowindow-mobile-special-item-claim') special_item_claim.innerText = 'View' special_item_row.appendChild(special_item_claim) special_item_claim.addEventListener('click', function(e) { e.preventDefault() const special_item_page_url = this.data['item_page_url'] + '?special=' + promotion['uuid'] document.location.href = special_item_page_url }.bind(this)) } } if (specials_hd.length > 0) { const special_heading_row = document.createElement('div') special_heading_row.classList.add('rh2-business-infowindow-mobile-special-heading-row') special_row.appendChild(special_heading_row) const special_heading_text = document.createElement('div') special_heading_text.classList.add('rh2-business-infowindow-mobile-special-heading-text') special_heading_text.innerText = 'Hot Deals' special_heading_row.appendChild(special_heading_text) const special_body_row = document.createElement('div') special_body_row.classList.add('rh2-business-infowindow-mobile-special-body-row') special_row.appendChild(special_body_row) for (let i = 0; i < Math.min(2, specials_hd.length); i++) { const promotion = specials_hd[i] const title = rh2.Promotion.get_promotion_title(promotion) const special_item_row = document.createElement('div') special_item_row.classList.add('rh2-business-infowindow-mobile-special-item-row') special_body_row.appendChild(special_item_row) const special_item_icon = document.createElement('div') special_item_icon.classList.add('rh2-business-infowindow-mobile-special-item-icon') special_item_icon.classList.add('hotdeal') special_item_row.appendChild(special_item_icon) const special_item_title = document.createElement('div') special_item_title.classList.add('rh2-business-infowindow-mobile-special-item-title') special_item_title.innerText = title special_item_row.appendChild(special_item_title) const special_item_claim = document.createElement('div') special_item_claim.classList.add('rh2-business-infowindow-mobile-special-item-claim') special_item_claim.innerText = 'View' special_item_row.appendChild(special_item_claim) special_item_claim.addEventListener('click', function(e) { e.preventDefault() const special_item_page_url = this.data['item_page_url'] + '?special=' + promotion['uuid'] document.location.href = special_item_page_url }.bind(this)) } } if (this.data['bookable']) { const book_button = document.createElement('div') book_button.classList.add('rh2-business-infowindow-mobile-book-button') book_button.innerText = 'Book' book_row.appendChild(book_button) book_button.addEventListener('click', function(e) { e.preventDefault() document.location.href = this.data['item_page_url'] + 'booking/' }.bind(this)) } return infowindow_el } rh2.BusinessInfoWindow = BusinessInfoWindow })()</script> <script>// #BusinessList ; (function() { const Fragment = function() { rh2.Fragment.call(this) this.map_desktop_info_window = null this.map_desktop_marker_clusterer = null this.map_bounds_change_skip = 2 } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'BusinessList' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eats\\/?$'), new RegExp('^/rh2/eats/in-region/[\\w-_]+/in-city/[\\w-_]+/in-suburb/[\\w-_]+\\/?$'), new RegExp('^/rh2/eats/in-region/[\\w-_]+/in-city/[\\w-_]+\\/?$'), new RegExp('^/rh2/eats/in-region/[\\w-_]+\\/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } rh2.fragment_manager.register(fragment) fragment._initialize = function() { if (!this.params.__LANDING__) { return } const qd = Search.parse_url(window.location.href) if (qd['q'] && qd['q'].length > 0) { const q = qd['q'][0] this.params['q'] = [q] } else { this.params['q'] = null } if (qd['loc_text'] && qd['loc_text'].length > 0) { const loc_text = qd['loc_text'][0] this.params['loc_text'] = [loc_text] } else { this.params['loc_text'] = null } if (qd['loc_code'] && qd['loc_code'].length > 0) { const loc_code = qd['loc_code'][0] this.params['loc_code'] = [loc_code] } else { this.params['loc_code'] = null } if (qd['region'] && qd['region'].length > 0) { const region = qd['region'][0] this.params['region'] = [region] } else { this.params['region'] = [null] } if (qd['city'] && qd['city'].length > 0) { const city = qd['city'][0] this.params['city'] = [city] } else { this.params['city'] = [null] } if (qd['suburb'] && qd['suburb'].length > 0) { const suburb = qd['suburb'][0] this.params['suburb'] = [suburb] } else { this.params['suburb'] = [null] } if (qd['locate_me'] && qd['locate_me'].length > 0) { if (qd['locate_me'][0] == true) { this.params['locate_me'] = [true] } else { this.params['locate_me'] = null } } else { this.params['locate_me'] = null } if (qd['category'] && qd['category'].length > 0) { const category = qd['category'][0] this.params['category'] = [category] } if (qd['geosw'] && qd['geosw'].length > 0) { const geosw = qd['geosw'][0] this.params['geosw'] = [geosw] } else { this.params['geosw'] = [null] } if (qd['geone'] && qd['geone'].length > 0) { const geone = qd['geone'][0] this.params['geone'] = [geone] } else { this.params['geone'] = [null] } if (qd['geocenter'] && qd['geocenter'].length > 0) { const geocenter = qd['geocenter'][0] this.params['geocenter'] = [geocenter] } else { this.params['geocenter'] = [null] } if (qd['georadius'] && qd['georadius'].length > 0) { const georadius = qd['georadius'][0] this.params['georadius'] = [georadius] } else { this.params['georadius'] = [null] } if (qd['promotion_product'] && qd['promotion_product'].length > 0) { this.params['promotion_product'] = qd['promotion_product'] } if (qd['promotion_structure'] && qd['promotion_structure'].length > 0) { this.params['promotion_structure'] = qd['promotion_structure'] } if (qd['hd_discount'] && qd['hd_discount'].length > 0) { this.params['hd_discount'] = qd['hd_discount'] } if (qd['price'] && qd['price'].length > 0) { this.params['price'] = qd['price'] } if (qd['cuisine'] && qd['cuisine'].length > 0) { this.params['cuisine'] = qd['cuisine'] } if (qd['dietary'] && qd['dietary'].length > 0) { this.params['dietary'] = qd['dietary'] } if (qd['feature'] && qd['feature'].length > 0) { this.params['feature'] = qd['feature'] } if (qd['av_pax'] && qd['av_pax'].length > 0) { this.params['av_pax'] = qd['av_pax'] } if (qd['av_date'] && qd['av_date'].length > 0) { this.params['av_date'] = qd['av_date'] } if (qd['av_time'] && qd['av_time'].length > 0) { this.params['av_time'] = qd['av_time'] } } fragment._render = function() { if (rh2.utils.is_desktop()) { this.render_desktop() } else if (rh2.utils.is_mobile()) { this.render_mobile() } const footer = rh2.Footer.build() this.el.appendChild(footer) if (this.params['q']) { this.appbar.set_search_freetext(this.params['q'][0]) } if (this.params['loc_text']) { this.appbar.set_search_location_text(this.params['loc_text'][0]) } else { this.appbar.set_search_location_text('') } if (this.params['loc_code']) { this.appbar.set_search_location_code(this.params['loc_code'][0]) } else { this.appbar.set_search_location_code('') } const full_screen_overlay = this.full_screen_overlay = document.createElement('div') full_screen_overlay.classList.add('rh2-full-screen-overlay') this.el.appendChild(full_screen_overlay) const full_screen_overlay_translucent = this.full_screen_overlay_translucent = document.createElement('div') full_screen_overlay_translucent.classList.add('rh2-full-screen-overlay-translucent') this.el.appendChild(full_screen_overlay_translucent) this.appbar.location_dialog() } fragment.load = function() { this.search = new Search({ collect_qd: this.collect_qd.bind(this), list_el: this.list_el, fragment: this, }) this.prepare_map_desktop() if (this.params['locate_me'] && this.params['locate_me'][0] == true) { this.params['locate_me'] == [null] this.locate_me() return } this.search.run() } fragment.collect_qd = function() { return this.collect_qd_desktop() } fragment.collect_qd_desktop = function() { const qd = {} if (this.params['q'] != null) { qd['q'] = [this.params['q'][0]] } if (this.params['loc_text'] != null) { qd['loc_text'] = [this.params['loc_text'][0]] } if (this.params['loc_code'] != null) { qd['loc_code'] = [this.params['loc_code'][0]] } if (this.params['region'] != null) { const region = this.params['region'][0] qd['region'] = [region] } if (this.params['city'] != null) { const city = this.params['city'][0] qd['city'] = [city] } if (this.params['suburb'] != null) { const suburb = this.params['suburb'][0] qd['suburb'] = [suburb] } if (this.params['category'] != null) { qd['category'] = [this.params['category'][0]] } if (this.params['geosw'] != null) { qd['geosw'] = [this.params['geosw'][0]] } if (this.params['geone'] != null) { qd['geone'] = [this.params['geone'][0]] } if (this.params['geocenter'] != null) { qd['geocenter'] = [this.params['geocenter'][0]] } if (this.params['georadius'] != null) { qd['georadius'] = [this.params['georadius'][0]] } if (this.params['is_locating_me'] != null) { qd['is_locating_me'] = [this.params['is_locating_me'][0]] this.clear_param_values('is_locating_me') } if (this.params['promotion_product'] != null) { qd['promotion_product'] = this.params['promotion_product'] } if (this.params['promotion_structure'] != null) { qd['promotion_structure'] = this.params['promotion_structure'] } if (this.params['hd_discount'] != null) { qd['hd_discount'] = this.params['hd_discount'] } if (this.params['price'] != null) { qd['price'] = this.params['price'] } if (this.params['cuisine'] != null) { qd['cuisine'] = this.params['cuisine'] } if (this.params['dietary'] != null) { qd['dietary'] = this.params['dietary'] } if (this.params['feature'] != null) { qd['feature'] = this.params['feature'] } if (this.params['av_pax'] != null) { qd['av_pax'] = this.params['av_pax'] } if (this.params['av_date'] != null) { qd['av_date'] = this.params['av_date'] } if (this.params['av_time'] != null) { qd['av_time'] = this.params['av_time'] } return qd } fragment.collect_qd_mobile = function() { const qd = {} return qd } fragment.locate_me = function() { if (window.navigator === undefined || window.navigator.geolocation === undefined) { console.error('window.navigator or window.navigator.geolocation is undefined') return } navigator.geolocation.getCurrentPosition( function(pos) { const coords = pos.coords this.params['geocenter'] = [coords.latitude + ',' + coords.longitude] this.params['georadius'] = [0.025] this.params['is_locating_me'] = ['true'] this.params['loc'] = [] this.params['geosw'] = [] this.params['geone'] = [] this.params['region'] = [] this.params['city'] = [] this.params['suburb'] = [] this.appbar.set_search_location_text('<Near Me>') this.params['loc_text'] = ['<Near Me>'] this.search.run() }.bind(this), function(err) { console.error(err) }.bind(this), { enableHighAccuracy: true, timeout: 10000, } ) } fragment.render_desktop_map_controls = function() { if (this.has_param_value('promotion_product', 'BOOKABLE')) { this.desktop_map_bookable_only_icon_el.classList.add('rh2-business-list-desktop-map-bookable-only-icon-on') this.desktop_map_bookable_only_icon_el.classList.remove('rh2-business-list-desktop-map-bookable-only-icon-off') } else { this.desktop_map_bookable_only_icon_el.classList.remove('rh2-business-list-desktop-map-bookable-only-icon-on') this.desktop_map_bookable_only_icon_el.classList.add('rh2-business-list-desktop-map-bookable-only-icon-off') } } fragment.on_change_category = function() { this.product_introduction_banner.innerHTML = '' this.product_introduction_banner.classList.remove('rh2-business-list-pib-border') const close_button = document.createElement('div') close_button.classList.add('rh2-business-list-pib-close-button') this.product_introduction_banner.appendChild(close_button) close_button.addEventListener('click', function() { this.product_introduction_banner.innerHTML = '' this.product_introduction_banner.classList.remove('rh2-business-list-pib-border') this.product_introduction_banner.classList.add('hidden') }.bind(this)) let category = this.get_param_value('category') if (!category || ['ALL', 'SPECIAL', 'SPECIAL_HD'].indexOf(category) === -1) { category = this.params.category = ['ALL'] } if (category == 'ALL') { // if no introduction, don't show it's container as it will add extra padding space this.product_introduction_banner.classList.add('hidden') } else { this.product_introduction_banner.classList.remove('hidden') } if (category == 'SPECIAL') { this.product_introduction_banner.classList.add('rh2-business-list-pib-border') const icon = document.createElement('div') icon.classList.add('rh2-business-list-pib-icon') icon.classList.add('rh2-business-list-pib-icon-special') this.product_introduction_banner.appendChild(icon) const textarea = document.createElement('div') textarea.classList.add('rh2-business-list-pib-textarea') this.product_introduction_banner.appendChild(textarea) { const line = document.createElement('div') line.classList.add('rh2-business-list-pib-textarea-line') line.classList.add('highlight') line.innerText = "Restaurant Specials" textarea.appendChild(line) } { const line = document.createElement('div') line.classList.add('rh2-business-list-pib-textarea-line') line.innerHTML = `Check out our Local Blackboard Deals for set menus, buy one get one free, complimentary treats, and more.<br> For the hottest discounts, head over to our Hot Deals 🔥 section!` textarea.appendChild(line) } } else if (category == 'SPECIAL_HD') { this.product_introduction_banner.classList.add('rh2-business-list-pib-border') const icon = document.createElement('div') icon.classList.add('rh2-business-list-pib-icon') icon.classList.add('rh2-business-list-pib-icon-special-hd') this.product_introduction_banner.appendChild(icon) const textarea = document.createElement('div') textarea.classList.add('rh2-business-list-pib-textarea') this.product_introduction_banner.appendChild(textarea) { const line = document.createElement('div') line.classList.add('rh2-business-list-pib-textarea-line') line.classList.add('highlight') line.innerText = 'Hot Deals!' textarea.appendChild(line) } { const line = document.createElement('div') line.classList.add('rh2-business-list-pib-textarea-line') line.innerHTML = 'Grab a Hot Deal and slice up to 50% off your food bill! Hurry, spots are limited, so jump in fast. A tiny booking fee applies - worth every bite!' textarea.appendChild(line) } } else { close_button.parentNode.removeChild(close_button) } } fragment.render_desktop = function() { this.el.innerHTML = '' const business_filter = this.business_filter = new rh2.BusinessFilter({ business_list_fragment: this, }) const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const page_row = document.createElement('div') page_row.classList.add('rh2-business-list-desktop-page-row') page_row.classList.add('rh2-row-pw') this.el.appendChild(page_row) // divide page_row const page_left = document.createElement('div') page_left.classList.add('rh2-business-list-desktop-page-left') page_row.appendChild(page_left) const page_right = document.createElement('div') page_right.classList.add('rh2-business-list-desktop-page-right') page_row.appendChild(page_right) // for page_left const category_row = this.category_row_el = document.createElement('div') category_row.classList.add('rh2-business-list-category-row') category_row.classList.add('rh2-business-list-category-row-desktop') page_left.appendChild(category_row) rh2.components.render_category_row(this.category_row_el, this, this.on_change_category.bind(this)) const filter_row_el = this.desktop_filter_row_el = document.createElement('div') //filter_row_el.classList.add('rh2-business-filter-desktop-row') page_left.appendChild(filter_row_el) this.business_filter.render_row(this.desktop_filter_row_el) const promotion_structure_row_el = this.desktop_promotion_structure_row_el = document.createElement('div') promotion_structure_row_el.classList.add('rh2-business-promotion-structure-desktop-row') page_left.appendChild(promotion_structure_row_el) this.business_filter.render_promotion_structure_row(this.desktop_promotion_structure_row_el) const product_introduction_banner = this.product_introduction_banner = document.createElement('div') product_introduction_banner.classList.add('rh2-business-list-pib') product_introduction_banner.classList.add('rh2-business-list-pib-desktop') page_left.appendChild(product_introduction_banner) const search_result_text = this.search_result_text = document.createElement('div') search_result_text.classList.add('rh2-business-list-search-result-text') page_left.appendChild(search_result_text) const list_el = this.list_el = document.createElement('div') list_el.classList.add('rh2-business-list-desktop-list') page_left.appendChild(list_el) // for page_right const sticky_right_el = this.sticky_right_el = document.createElement('div') sticky_right_el.classList.add('rh2-business-list-desktop-sticky-right') page_right.appendChild(sticky_right_el) // sticky-right sizing const viewport_height = window.innerHeight sticky_right_el.style['height'] = (viewport_height - 96) + 'px' const desktop_map_container_el = this.desktop_map_container_el = document.createElement('div') desktop_map_container_el.classList.add('rh2-business-list-desktop-map-container') sticky_right_el.appendChild(desktop_map_container_el) const desktop_map_wrapper_el = this.desktop_map_wrapper_el = document.createElement('div') desktop_map_wrapper_el.classList.add('rh2-business-list-desktop-map-wrapper') desktop_map_container_el.appendChild(desktop_map_wrapper_el) desktop_map_wrapper_el.markers = [] desktop_map_wrapper_el.highlighted_marker_idx = null desktop_map_wrapper_el.highlighted_marker_icon = null const desktop_map_search_area_el = this.desktop_map_search_area_el = document.createElement('div') desktop_map_search_area_el.classList.add('rh2-business-list-desktop-map-search-area') desktop_map_search_area_el.innerText = 'Search this area' desktop_map_container_el.appendChild(desktop_map_search_area_el) desktop_map_search_area_el.addEventListener('click', function() { const bounds = this.map_desktop.getBounds() const sw = bounds.getSouthWest() const ne = bounds.getNorthEast() const sw_lat = sw.lat() const sw_lng = sw.lng() const ne_lat = ne.lat() const ne_lng = ne.lng() this.params['geosw'] = [sw_lat.toFixed(6) + ',' + sw_lng.toFixed(6)] this.params['geone'] = [ne_lat.toFixed(6) + ',' + ne_lng.toFixed(6)] this.params['region'] = [] this.params['city'] = [] this.params['suburb'] = [] this.params['loc_code'] = [] this.params['loc_text'] = ['<Visible area on the map>'] this.appbar.set_search_location_text('<Visible area on the map>') this.params['geocenter'] = [null] this.params['georadius'] = [null] this.desktop_map_search_area_el.classList.add('rh2-business-list-desktop-map-search-area-hidden') this.search.run() }.bind(this)) const desktop_map_search_area_icon_el = document.createElement('div') desktop_map_search_area_icon_el.classList.add('rh2-business-list-desktop-map-search-area-icon') desktop_map_search_area_el.appendChild(desktop_map_search_area_icon_el) const desktop_map_zoom_el = document.createElement('div') desktop_map_zoom_el.classList.add('rh2-business-list-desktop-map-zoom') desktop_map_container_el.appendChild(desktop_map_zoom_el) const desktop_map_zoom_in_el = document.createElement('div') desktop_map_zoom_in_el.classList.add('rh2-business-list-desktop-map-zoom-in') desktop_map_zoom_el.appendChild(desktop_map_zoom_in_el) desktop_map_zoom_in_el.addEventListener('click', function() { const current_zoom = this.map_desktop.getZoom() const new_zoom = Math.min(current_zoom + 1, 18) this.map_desktop.setZoom(new_zoom) }.bind(this)) const desktop_map_zoom_out_el = document.createElement('div') desktop_map_zoom_out_el.classList.add('rh2-business-list-desktop-map-zoom-out') desktop_map_zoom_el.appendChild(desktop_map_zoom_out_el) desktop_map_zoom_out_el.addEventListener('click', function() { const current_zoom = this.map_desktop.getZoom() const new_zoom = Math.max(current_zoom - 1, 6) this.map_desktop.setZoom(new_zoom) }.bind(this)) const desktop_map_nearme_el = document.createElement('div') desktop_map_nearme_el.classList.add('rh2-business-list-desktop-map-nearme') desktop_map_nearme_el.innerText = "Near me" desktop_map_container_el.appendChild(desktop_map_nearme_el) desktop_map_nearme_el.addEventListener('click', this.locate_me.bind(this)) const desktop_map_locate_el = this.desktop_map_locate_el = document.createElement('div') desktop_map_locate_el.classList.add('rh2-business-list-desktop-map-locate') desktop_map_container_el.appendChild(desktop_map_locate_el) desktop_map_locate_el.addEventListener('click', this.locate_me.bind(this)) const page_right_ad = this.page_right_ad = document.createElement('div') page_right_ad.classList.add('rh2-business-list-desktop-page-right-ad') sticky_right_el.appendChild(page_right_ad) this.on_change_category() } fragment.render_mobile = function() { this.el.innerHTML = '' const business_filter = this.business_filter = new rh2.BusinessFilter({ business_list_fragment: this, layout: 'BUSINESS_LIST_MOBILE', }) const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, business_filter: this.business_filter, layout: 'BUSINESS_LIST_MOBILE', }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const page_row = document.createElement('div') page_row.classList.add('rh2-business-list-mobile-page-row') page_row.classList.add('rh2-row-pw') this.el.appendChild(page_row) const category_row = this.category_row_el = document.createElement('div') category_row.classList.add('rh2-business-list-category-row') category_row.classList.add('rh2-business-list-category-row-mobile') page_row.appendChild(category_row) rh2.components.render_category_row(this.category_row_el, this, this.on_change_category.bind(this)) const filter_row_el = this.desktop_filter_row_el = document.createElement('div') page_row.appendChild(filter_row_el) this.business_filter.render_row(this.desktop_filter_row_el) const promotion_structure_row_el = this.mobile_promotion_structure_row_el = document.createElement('div') promotion_structure_row_el.classList.add('rh2-business-promotion-structure-mobile-row') page_row.appendChild(promotion_structure_row_el) this.business_filter.render_promotion_structure_row(this.mobile_promotion_structure_row_el) const product_introduction_banner = this.product_introduction_banner = document.createElement('div') product_introduction_banner.classList.add('rh2-business-list-pib') product_introduction_banner.classList.add('rh2-business-list-pib-mobile') page_row.appendChild(product_introduction_banner) const search_result_text = this.search_result_text = document.createElement('div') search_result_text.classList.add('rh2-business-list-search-result-text') page_row.appendChild(search_result_text) const list_el = this.list_el = document.createElement('div') list_el.classList.add('rh2-business-list-mobile-list') page_row.appendChild(list_el) const mobile_map_locate_el = this.mobile_map_locate_el = document.createElement('div') mobile_map_locate_el.classList.add('rh2-business-list-mobile-map-locate') page_row.appendChild(mobile_map_locate_el) mobile_map_locate_el.addEventListener('click', this.locate_me.bind(this)) const mobile_mode_switch_el = document.createElement('div') mobile_mode_switch_el.classList.add('rh2-business-list-mobile-mode-switch') page_row.appendChild(mobile_mode_switch_el) const mobile_mode_switch_list_el = document.createElement('div') mobile_mode_switch_list_el.classList.add('rh2-business-list-mobile-mode-switch-list') mobile_mode_switch_list_el.classList.add('rh2-business-list-mobile-mode-switch-on') mobile_mode_switch_el.appendChild(mobile_mode_switch_list_el) mobile_mode_switch_list_el.addEventListener('click', function() { //this.fm.enter_fragment('BusinessList', this.params) }.bind(this)) const mobile_mode_switch_map_el = document.createElement('div') mobile_mode_switch_map_el.classList.add('rh2-business-list-mobile-mode-switch-map') mobile_mode_switch_el.appendChild(mobile_mode_switch_map_el) mobile_mode_switch_map_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessListMobileMap', this.params) }.bind(this)) this.on_change_category() } fragment.prepare_map_desktop = async function() { if (!rh2.utils.is_desktop()) { return } let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } let map = this.map_desktop const center = new google.maps.LatLng( -40.805, 172.760 ) const options = { zoom: 6, zoomControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, center: center, mapTypeControl: false, streetViewControl: false, fullscreenControl: false, gestureHandling: 'greedy', mapId: 'business_list_desktop', } map = this.map_desktop = new google.maps.Map(this.desktop_map_wrapper_el, options) google.maps.event.addListener(map, 'bounds_changed', function() { if (this.map_bounds_change_skip > 0) { this.map_bounds_change_skip = this.map_bounds_change_skip - 1 } else { this.desktop_map_search_area_el.classList.remove('rh2-business-list-desktop-map-search-area-hidden') } }.bind(this)) } const Search = function(cfg) { this.cfg = cfg this.cfg_collect_qd = cfg.collect_qd this.cfg_list_el = cfg.list_el this.fragment = cfg.fragment this.see_more_el = null this.pagination = null } Search.prototype.render_see_more_el = function() { const see_more_el = this.see_more_el = document.createElement('div') see_more_el.classList.add('rh2-business-list-desktop-see-more') see_more_el.innerText = 'See more' see_more_el.addEventListener('click', function() { const qd = this.cfg_collect_qd() this.fetch_data(qd, true) }.bind(this)) return see_more_el } Search.prototype.build_url = function(qd) { let path = '/rh2/eats/' let pairs = [] let keys = [] for (let k in qd) { if (k === '') { continue } keys.push(k) } keys = keys.sort() for (let i = 0; i < keys.length; i++) { const k = keys[i] if (['region', 'city', 'suburb'].indexOf(k) > -1) { continue } let v = qd[k] if (!Array.isArray(v)) { continue } v = v.sort() for (let i = 0; i < v.length; i++) { if (v[i] === null || v[i] === undefined || v[i] === '__UNSPECIFIED__' || v[i] === '') { continue } pairs.push([k, v[i]]) } } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { path = path + '?' + querystring } const parts = rh2.utils.get_href_parts() const url = parts[0] + '://' + parts[1] + path return url } Search.parse_url = function(url) { const href_parts = rh2.utils.get_href_parts(url) const querystring = href_parts[3] const qd = rh2.utils.get_query_dict(querystring) const path = href_parts[2] const re_region = new RegExp('^/rh2/eats/in-region/([\\w-_]+)\\/?') const mo_region = re_region.exec(path) if (mo_region) { qd['region'] = [mo_region[1]] const re_city = new RegExp('^/rh2/eats/in-region/([\\w-_]+)/in-city/([\\w-_]+)\\/?') const mo_city = re_city.exec(path) if (mo_city) { qd['city'] = [mo_city[2]] const re_suburb = new RegExp('^/rh2/eats/in-region/([\\w-_]+)/in-city/([\\w-_]+)/in-suburb/([\\w-_]+)\\/?$') const mo_suburb = re_suburb.exec(path) if (mo_suburb) { qd['suburb'] = [mo_suburb[3]] } } } return qd } Search.prototype.post_fetch = async function(data, is_see_more) { let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } this.pagination = data['pagination'] const category = this.fragment.get_param_value('category') || 'ALL' let loc_text = this.fragment.get_param_value('loc_text') || '' loc_text = loc_text.toLowerCase() let entity = 'Restaurant' if (category == 'SPECIAL') { entity = 'Special' } else if (category == 'SPECIAL_HD') { entity = 'Hot Deal' } let search_result_html = '<p>' if (data.pagination.total_count > 0) { search_result_html += data.pagination.total_count + (data.pagination.total_count > 1 ? ` ${entity}s found` : ` ${entity} found`) } else { search_result_html += `No ${entity}s found` } if (data.suburb_name && data.suburb_name.toLowerCase() == loc_text) { search_result_html += ' in <b>' + data.suburb_name + '</b>' } else if (data.city_name && data.city_name.toLowerCase() == loc_text) { search_result_html += ' in <b>' + data.city_name + '</b>' } else if (data.region_name && data.region_name.toLowerCase().indexOf(loc_text) > -1) { search_result_html += ' in <b>' + data.region_name + '</b>' } search_result_html += '</p>' this.fragment.search_result_text.innerHTML = search_result_html if (data.page_title) { document.title = data.page_title } const bounds = data['geo_attributes']['bounds'] const sw_lat = bounds['sw']['lat'] const sw_lng = bounds['sw']['lng'] const ne_lat = bounds['ne']['lat'] const ne_lng = bounds['ne']['lng'] if (this.fragment.map_desktop) { if (ne_lat != null && ne_lng != null && ne_lat != null && ne_lng != null) { if (data['geo_attributes']['no_change'] != true) { this.fragment.map_desktop.fitBounds( new google.maps.LatLngBounds( new google.maps.LatLng(sw_lat, sw_lng), new google.maps.LatLng(ne_lat, ne_lng), ) ) } } } if (this.pagination['current_offset'] == 0) { this.cfg_list_el.innerHTML = '' this.see_more_el = null } if (this.pagination['next_offset'] == null) { if (this.see_more_el != null) { this.see_more_el.parentNode.removeChild(this.see_more_el) this.see_more_el = null } } else { if (this.see_more_el == null) { this.see_more_el = this.render_see_more_el() this.cfg_list_el.appendChild(this.see_more_el) } } const object_list = data.object_list for (let i = 0; i < object_list.length; i++) { const obj_data = object_list[i] let card_el = null if (category == 'ALL') { const qd = { av_pax: [this.fragment.get_param_value('av_pax')], av_date: [this.fragment.get_param_value('av_date')], av_time: [this.fragment.get_param_value('av_time')], } const card = new rh2.BusinessCard(obj_data, qd, this.fragment) card_el = card.render(i) } if (category == 'SPECIAL' || category == 'SPECIAL_HD') { if (rh2.utils.is_mobile()) { card_el = rh2.Special.render_card_for_mobile(obj_data, obj_data['business'], this.fragment) } else { card_el = rh2.Special.render_card_for_business_list_page(obj_data, obj_data['business'], this.fragment) } } if (['SPECIAL', 'SPECIAL_HD'].indexOf(category) >= 0) { // skip separator if (this.see_more_el != null) { this.cfg_list_el.insertBefore(card_el, this.see_more_el) } else { this.cfg_list_el.appendChild(card_el) } continue } const sep_el = rh2.BusinessCard.render_separator() if (this.see_more_el != null) { this.cfg_list_el.insertBefore(card_el, this.see_more_el) this.cfg_list_el.insertBefore(sep_el, this.see_more_el) } else { this.cfg_list_el.appendChild(card_el) this.cfg_list_el.appendChild(sep_el) } } if (category == 'ALL' && data.name_search_suggestion && data.name_search_suggestion.length > 0) { const obj = data.name_search_suggestion[0] this.fragment.search_result_text.innerHTML += '<p>Are you looking for this one in <b>' + obj.city_name + '</b>?</p>' const card = new rh2.BusinessCard(obj, {}, this.fragment) card_el = card.render(0) this.cfg_list_el.appendChild(card_el) const sep_el = rh2.BusinessCard.render_separator() this.cfg_list_el.appendChild(sep_el) } if (rh2.utils.is_desktop()) { const markers = this.fragment.desktop_map_wrapper_el.markers for (let j = markers.length - 1; j > -1; j--) { markers[j].setMap(null) markers.pop() } if (this.my_location_marker) { this.my_location_marker.setMap(null) } for (let j = 0; j < Math.min(65536, data['object_list_for_map'].length); j++) { const obj = data['object_list_for_map'][j] if (obj.geo_latitude && obj.geo_longitude) { let has_specials = obj['specials'].length > 0 let has_specials_hd = obj['specials_hd'].length > 0 let icon_file_name = 'marker' if (has_specials && has_specials_hd) { icon_file_name = 'marker_hotdeal_special' } else if (has_specials_hd) { icon_file_name = 'marker_hotdeal' } else if (has_specials) { icon_file_name = 'marker_special' } const icon_file_path = '/rh2/static/icon/site/map/' + icon_file_name + '.png' const icon_url = window.origin + icon_file_path const marker_img = document.createElement('img'); marker_img.src = icon_url const marker = new google.maps.marker.AdvancedMarkerElement({ position: new google.maps.LatLng(obj['geo_latitude'], obj['geo_longitude']), map: this.fragment.map_desktop, title: obj['name'], content: marker_img }) marker.rh_slug = obj['slug'] google.maps.event.addListener(marker, 'click', function(e) { const params = { slug: obj['slug'], } // smoothZoom(this.fragment.map_desktop, 16, this.fragment.map_desktop.getZoom()) if (this.fragment.map_desktop.getZoom() < 16) { this.fragment.map_desktop.setZoom(16) } this.fragment.map_desktop.panTo(marker.position) const biw = new rh2.BusinessInfoWindow(obj, this.fragment.fm) biw.load() .then(function(biw_el) { if (this.fragment.map_desktop_info_window != null) { this.fragment.map_desktop_info_window.close() } const w = this.fragment.map_desktop_info_window = new google.maps.InfoWindow({ content: biw_el, }) this.fragment.map_bounds_change_skip = 2 w.open(this.fragment.map_desktop, marker) }.bind(this)) //const wc_el = (new rh2.BusinessInfoWindow(obj, this.fragment.fm)).render() }.bind(this)) google.maps.event.addListener(marker, 'mouseover', function(e) {}.bind(this)) markers.push(marker) } } if (data['geo_attributes']['my_location']) { const lat = data['geo_attributes']['my_location']['lat'] const lng = data['geo_attributes']['my_location']['lng'] const icon_file_path = '/rh2/static/icon/site/map/my_location.png' const icon_url = window.location.origin + icon_file_path this.my_location_marker = new google.maps.marker.AdvancedMarkerElement({ position: new google.maps.LatLng(lat, lng), map: this.fragment.map_desktop, content: marker_img }) } const map = this.fragment.map_desktop if (this.fragment.map_desktop_marker_clusterer != null) { this.fragment.map_desktop_marker_clusterer.clearMarkers() } const { MarkerClusterer } = markerClusterer const clusterer = this.fragment.map_desktop_marker_clusterer = new MarkerClusterer({ map: map, markers: markers, zoomOnClick: true, algorithmOptions: { maxZoom: 16 } }) } } Search.prototype.fetch_data = function(qd, is_see_more) { let path = '/rh2/service/business/list/' let pairs = [] if (is_see_more == true && this.pagination != null) { pairs.push(['offset', this.pagination['next_offset']]) } for (let k in qd) { let v = qd[k] if (!Array.isArray(v)) { continue } for (let i = 0; i < v.length; i++) { if (v[i] == null) { continue } pairs.push([k, v[i]]) } } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { path = path + '?' + querystring } let xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const data = rtn.data // console.log(data) this.post_fetch.call(this, data, is_see_more) }.bind(this)) xhr.open("GET", path) xhr.send() } Search.prototype.run = function() { this.fragment.map_bounds_change_skip = 2 //this.cfg_list_el.innerHTML = '' const qd = this.cfg_collect_qd() const url = this.build_url(qd) if (url != window.location.href) { window.history.pushState({}, 'Business', url) } this.fetch_data(qd) { const search_string = qd && qd['q'] && qd['q'][0] || '' window.ga && ga('RH201905.send', 'event', { 'eventCategory': 'Restaurant', 'eventAction': 'Search', 'eventLabel': search_string, }) window.fbq && fbq('track', 'Search', { search_string: search_string, }) } } })()</script> <script>// #BusinessList ; // const { MarkerClusterer } = markerClusterer; // already defined in site-1-business-list.js (function() { const Fragment = function() { rh2.Fragment.call(this) this.map_mobile_info_window = null this.map_mobile_marker_clusterer = null this.map_bounds_change_skip = 2 } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'BusinessListMobileMap' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eats-mobile-map/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } rh2.fragment_manager.register(fragment) fragment._initialize = function() { if (!this.params.__LANDING__) { return } const qd = Search.parse_url(window.location.href) if (qd['q'] && qd['q'].length > 0) { const q = qd['q'][0] this.params['q'] = [q] } else { this.params['q'] = null } if (qd['loc_text'] && qd['loc_text'].length > 0) { const loc_text = qd['loc_text'][0] this.params['loc_text'] = [loc_text] } else { this.params['loc_text'] = null } if (qd['loc_code'] && qd['loc_code'].length > 0) { const loc_code = qd['loc_code'][0] this.params['loc_code'] = [loc_code] } else { this.params['loc_code'] = null } if (qd['region'] && qd['region'].length > 0) { const region = qd['region'][0] this.params['region'] = [region] } else { this.params['region'] = [null] } if (qd['city'] && qd['city'].length > 0) { const city = qd['city'][0] this.params['city'] = [city] } else { this.params['city'] = [null] } if (qd['suburb'] && qd['suburb'].length > 0) { const suburb = qd['suburb'][0] this.params['suburb'] = [suburb] } else { this.params['suburb'] = [null] } if (qd['locate_me'] && qd['locate_me'].length > 0) { if (qd['locate_me'][0] == true) { this.params['locate_me'] = [true] } else { this.params['locate_me'] = null } } else { this.params['locate_me'] = null } if (qd['category'] && qd['category'].length > 0) { const category = qd['category'][0] this.params['category'] = [category] } else { //this.params['category'] = ['ALL'] } if (qd['geosw'] && qd['geosw'].length > 0) { const geosw = qd['geosw'][0] this.params['geosw'] = [geosw] } else { this.params['geosw'] = [null] } if (qd['geone'] && qd['geone'].length > 0) { const geone = qd['geone'][0] this.params['geone'] = [geone] } else { this.params['geone'] = [null] } if (qd['geocenter'] && qd['geocenter'].length > 0) { const geocenter = qd['geocenter'][0] this.params['geocenter'] = [geocenter] } else { this.params['geocenter'] = [null] } if (qd['georadius'] && qd['georadius'].length > 0) { const georadius = qd['georadius'][0] this.params['georadius'] = [georadius] } else { this.params['georadius'] = [null] } if (qd['promotion_product'] && qd['promotion_product'].length > 0) { this.params['promotion_product'] = qd['promotion_product'] } if (qd['promotion_structure'] && qd['promotion_structure'].length > 0) { this.params['promotion_structure'] = qd['promotion_structure'] } if (qd['price'] && qd['price'].length > 0) { this.params['price'] = qd['price'] } if (qd['cuisine'] && qd['cuisine'].length > 0) { this.params['cuisine'] = qd['cuisine'] } if (qd['dietary'] && qd['dietary'].length > 0) { this.params['dietary'] = qd['dietary'] } if (qd['feature'] && qd['feature'].length > 0) { this.params['feature'] = qd['feature'] } if (qd['av_pax'] && qd['av_pax'].length > 0) { this.params['av_pax'] = qd['av_pax'] } if (qd['av_date'] && qd['av_date'].length > 0) { this.params['av_date'] = qd['av_date'] } if (qd['av_time'] && qd['av_time'].length > 0) { this.params['av_time'] = qd['av_time'] } } fragment._render = function() { this.render_mobile() if (this.params['q']) { this.appbar.set_search_freetext(this.params['q'][0]) } if (this.params['loc_text']) { this.appbar.set_search_location_text(this.params['loc_text'][0]) } else { this.appbar.set_search_location_text('') } if (this.params['loc_code']) { this.appbar.set_search_location_code(this.params['loc_code'][0]) } else { this.appbar.set_search_location_code('') } } fragment._before_exit = function() { document.body.style['overscroll-behavior'] = 'unset' } fragment.load = function() { document.body.style['overscroll-behavior'] = 'contain' this.search = new Search({ collect_qd: this.collect_qd.bind(this), fragment: this, }) this.prepare_map() if (this.params['locate_me'] && this.params['locate_me'][0] == true) { this.params['locate_me'] == [null] this.locate_me() return } this.search.run() } fragment.collect_qd = function() { const qd = {} if (this.params['q'] != null) { qd['q'] = [this.params['q'][0]] } if (this.params['loc_text'] != null) { qd['loc_text'] = [this.params['loc_text'][0]] } if (this.params['loc_code'] != null) { qd['loc_code'] = [this.params['loc_code'][0]] } if (this.params['region'] != null) { const region = this.params['region'][0] qd['region'] = [region] } if (this.params['city'] != null) { const city = this.params['city'][0] qd['city'] = [city] } if (this.params['suburb'] != null) { const suburb = this.params['suburb'][0] qd['suburb'] = [suburb] } if (this.params['category'] != null) { qd['category'] = [this.params['category'][0]] } if (this.params['geosw'] != null) { qd['geosw'] = [this.params['geosw'][0]] } if (this.params['geone'] != null) { qd['geone'] = [this.params['geone'][0]] } if (this.params['geocenter'] != null) { qd['geocenter'] = [this.params['geocenter'][0]] } if (this.params['georadius'] != null) { qd['georadius'] = [this.params['georadius'][0]] } if (this.params['is_locating_me'] != null) { qd['is_locating_me'] = [this.params['is_locating_me'][0]] this.clear_param_values('is_locating_me') } if (this.params['promotion_product'] != null) { qd['promotion_product'] = this.params['promotion_product'] } if (this.params['promotion_structure'] != null) { qd['promotion_structure'] = this.params['promotion_structure'] } if (this.params['hd_discount'] != null) { qd['hd_discount'] = this.params['hd_discount'] } if (this.params['price'] != null) { qd['price'] = this.params['price'] } if (this.params['cuisine'] != null) { qd['cuisine'] = this.params['cuisine'] } if (this.params['dietary'] != null) { qd['dietary'] = this.params['dietary'] } if (this.params['feature'] != null) { qd['feature'] = this.params['feature'] } if (this.params['av_pax'] != null) { qd['av_pax'] = this.params['av_pax'] } if (this.params['av_date'] != null) { qd['av_date'] = this.params['av_date'] } if (this.params['av_time'] != null) { qd['av_time'] = this.params['av_time'] } return qd } fragment.locate_me = function() { if (window.navigator === undefined || window.navigator.geolocation === undefined) { console.error('window.navigator or window.navigator.geolocation is undefined') return } navigator.geolocation.getCurrentPosition( function(pos) { const coords = pos.coords this.params['geocenter'] = [coords.latitude + ',' + coords.longitude] this.params['georadius'] = [0.025] this.params['is_locating_me'] = ['true'] this.params['loc'] = [] this.params['geosw'] = [] this.params['geone'] = [] this.params['region'] = [] this.params['city'] = [] this.params['suburb'] = [] this.appbar.set_search_location_text('<Near Me>') this.params['loc_text'] = ['<Near Me>'] this.search.run() }.bind(this), function(err) { console.error(err) }.bind(this), { enableHighAccuracy: true, timeout: 10000, } ) } fragment.on_change_category = function() {} fragment.render_mobile = function() { this.el.innerHTML = '' const business_filter = this.business_filter = new rh2.BusinessFilter({ business_list_fragment: this, layout: 'BUSINESS_LIST_MOBILE', variant: 'MAP_VIEW', }) const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, business_filter: this.business_filter, layout: 'BUSINESS_LIST_MOBILE', variant: 'MAP_VIEW', }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const page_row = document.createElement('div') page_row.classList.add('rh2-business-list-mobile-page-row') page_row.classList.add('rh2-row-pw') this.el.appendChild(page_row) const category_row = this.category_row_el = document.createElement('div') category_row.classList.add('rh2-business-list-category-row') category_row.classList.add('rh2-business-list-category-row-mobile-map') page_row.appendChild(category_row) rh2.components.render_category_row(this.category_row_el, this, this.on_change_category.bind(this)) const filter_row_el = this.desktop_filter_row_el = document.createElement('div') page_row.appendChild(filter_row_el) this.business_filter.render_row(this.desktop_filter_row_el) const mobile_map_container_el = this.mobile_map_container_el = document.createElement('div') mobile_map_container_el.classList.add('rh2-business-list-mobile-map-container') page_row.appendChild(mobile_map_container_el) const mobile_map_wrapper_el = this.mobile_map_wrapper_el = document.createElement('div') mobile_map_wrapper_el.classList.add('rh2-business-list-mobile-map-wrapper') mobile_map_container_el.appendChild(mobile_map_wrapper_el) mobile_map_wrapper_el.markers = [] const mobile_map_search_area_el = this.mobile_map_search_area_el = document.createElement('div') mobile_map_search_area_el.classList.add('rh2-business-list-mobile-map-search-area') mobile_map_search_area_el.classList.add('rh2-business-list-mobile-map-search-area-hidden') mobile_map_search_area_el.innerText = 'Search this area' page_row.appendChild(mobile_map_search_area_el) mobile_map_search_area_el.addEventListener('click', function() { const bounds = this.map_mobile.getBounds() const sw = bounds.getSouthWest() const ne = bounds.getNorthEast() const sw_lat = sw.lat() const sw_lng = sw.lng() const ne_lat = ne.lat() const ne_lng = ne.lng() this.params['geosw'] = [sw_lat.toFixed(6) + ',' + sw_lng.toFixed(6)] this.params['geone'] = [ne_lat.toFixed(6) + ',' + ne_lng.toFixed(6)] this.params['region'] = [] this.params['city'] = [] this.params['suburb'] = [] this.params['loc_code'] = [] this.params['loc_text'] = ['<Visible area on the map>'] this.appbar.set_search_location_text('<Visible area on the map>') this.params['geocenter'] = [null] this.params['georadius'] = [null] this.mobile_map_search_area_el.classList.add('rh2-business-list-mobile-map-search-area-hidden') this.search.run() }.bind(this)) const mobile_map_search_area_icon_el = document.createElement('div') mobile_map_search_area_icon_el.classList.add('rh2-business-list-mobile-map-search-area-icon') mobile_map_search_area_el.appendChild(mobile_map_search_area_icon_el) const mobile_map_locate_el = this.mobile_map_locate_el = document.createElement('div') mobile_map_locate_el.classList.add('rh2-business-list-mobile-map-locate') page_row.appendChild(mobile_map_locate_el) mobile_map_locate_el.addEventListener('click', this.locate_me.bind(this)) const mobile_mode_switch_el = document.createElement('div') mobile_mode_switch_el.classList.add('rh2-business-list-mobile-mode-switch') page_row.appendChild(mobile_mode_switch_el) const mobile_mode_switch_list_el = document.createElement('div') mobile_mode_switch_list_el.classList.add('rh2-business-list-mobile-mode-switch-list') mobile_mode_switch_el.appendChild(mobile_mode_switch_list_el) mobile_mode_switch_list_el.addEventListener('click', function() { this.fm.enter_fragment('BusinessList', this.params) }.bind(this)) const mobile_mode_switch_map_el = document.createElement('div') mobile_mode_switch_map_el.classList.add('rh2-business-list-mobile-mode-switch-map') mobile_mode_switch_map_el.classList.add('rh2-business-list-mobile-mode-switch-on') mobile_mode_switch_el.appendChild(mobile_mode_switch_map_el) mobile_mode_switch_map_el.addEventListener('click', function() { //this.fm.enter_fragment('BusinessListMobileMap', this.params) }.bind(this)) } fragment.prepare_map = async function() { let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } let map = this.map_mobile const center = new google.maps.LatLng( -40.805, 172.760 ) const options = { zoom: 6, zoomControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, center: center, mapTypeControl: false, streetViewControl: false, fullscreenControl: false, gestureHandling: 'greedy', mapId: 'business_list_mobile' } map = this.map_mobile = new google.maps.Map(this.mobile_map_wrapper_el, options) google.maps.event.addListener(map, 'bounds_changed', function() { if (this.map_bounds_change_skip > 0) { this.map_bounds_change_skip = this.map_bounds_change_skip - 1 } else { this.mobile_map_search_area_el.classList.remove('rh2-business-list-mobile-map-search-area-hidden') } }.bind(this)) } const Search = function(cfg) { this.cfg = cfg this.cfg_collect_qd = cfg.collect_qd this.fragment = cfg.fragment this.see_more_el = null this.pagination = null } Search.prototype.render_see_more_el = function() { const see_more_el = this.see_more_el = document.createElement('div') see_more_el.classList.add('rh2-business-list-desktop-see-more') see_more_el.innerText = 'See more' see_more_el.addEventListener('click', function() { const qd = this.cfg_collect_qd() this.fetch_data(qd, true) }.bind(this)) return see_more_el } Search.prototype.build_url = function(qd) { let path = '/rh2/eats-mobile-map/' let pairs = [] let keys = [] for (let k in qd) { if (k === '') { continue } keys.push(k) } keys = keys.sort() for (let i = 0; i < keys.length; i++) { const k = keys[i] if (['region', 'city', 'suburb'].indexOf(k) > -1) { continue } let v = qd[k] if (!Array.isArray(v)) { continue } v = v.sort() for (let i = 0; i < v.length; i++) { if (v[i] === null || v[i] === undefined || v[i] === '__UNSPECIFIED__' || v[i] === '') { continue } pairs.push([k, v[i]]) } } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { path = path + '?' + querystring } const parts = rh2.utils.get_href_parts() const url = parts[0] + '://' + parts[1] + path return url } Search.parse_url = function(url) { const href_parts = rh2.utils.get_href_parts(url) const querystring = href_parts[3] const qd = rh2.utils.get_query_dict(querystring) const path = href_parts[2] return qd } Search.prototype.post_fetch = async function(data, is_see_more) { let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } this.pagination = data['pagination'] const category = this.fragment.get_param_value('category') const bounds = data['geo_attributes']['bounds'] const sw_lat = bounds['sw']['lat'] const sw_lng = bounds['sw']['lng'] const ne_lat = bounds['ne']['lat'] const ne_lng = bounds['ne']['lng'] if (this.fragment.map_mobile) { if (ne_lat != null && ne_lng != null && ne_lat != null && ne_lng != null) { if (data['geo_attributes']['no_change'] != true) { this.fragment.map_mobile.fitBounds( new google.maps.LatLngBounds( new google.maps.LatLng(sw_lat, sw_lng), new google.maps.LatLng(ne_lat, ne_lng), ) ) } } } if (this.pagination['current_offset'] == 0) { this.see_more_el = null } if (this.pagination['next_offset'] == null) { if (this.see_more_el != null) { this.see_more_el.parentNode.removeChild(this.see_more_el) this.see_more_el = null } } else { if (this.see_more_el == null) { this.see_more_el = this.render_see_more_el() } } const object_list = data.object_list for (let i = 0; i < object_list.length; i++) { const obj_data = object_list[i] let business_data = obj_data if (category == 'SPECIAL' || category == 'COUPON') { business_data = obj_data['business'] } const card = new rh2.BusinessCard(business_data, { av_pax: [this.fragment.get_param_value('av_pax')], av_date: [this.fragment.get_param_value('av_date')], av_time: [this.fragment.get_param_value('av_time')], }) const card_el = card.render(i) } const markers = this.fragment.mobile_map_wrapper_el.markers for (let i = markers.length - 1; i > -1; i--) { markers[i].setMap(null) markers.pop() } if (this.my_location_marker) { this.my_location_marker.setMap(null) } for (let i = 0; i < Math.min(65536, data['object_list_for_map'].length); i++) { const obj = data['object_list_for_map'][i] if (obj.geo_latitude && obj.geo_longitude) { let has_specials = obj['specials'].length > 0 let has_specials_hd = obj['specials_hd'].length > 0 let has_coupons = obj['coupons'].length > 0 let has_live_coupons = false for (let i = 0; i < obj['coupons'].length; i++) { const coupon = obj['coupons'][i] has_live_coupons = true } let icon_file_name = 'marker' if (has_specials && has_specials_hd) { icon_file_name = 'marker_hotdeal_special' } else if (has_specials) { icon_file_name = 'marker_special' } else if (has_specials_hd) { icon_file_name = 'marker_hotdeal' } const icon_file_path = '/rh2/static/icon/site/map/' + icon_file_name + '.png' const icon_url = window.location.origin + icon_file_path const marker_img = document.createElement('img') marker_img.src = icon_url const marker = new google.maps.marker.AdvancedMarkerElement({ position: new google.maps.LatLng(obj['geo_latitude'], obj['geo_longitude']), map: this.fragment.map_mobile, title: obj['name'], content: marker_img }) google.maps.event.addListener(marker, 'click', function(e) { const params = { slug: obj['slug'], } // smoothZoom(this.fragment.map_mobile, 16, this.fragment.map_mobile.getZoom()) if (this.fragment.map_mobile.getZoom() < 16) { this.fragment.map_mobile.setZoom(16) } this.fragment.map_mobile.panTo(marker.position) const biw = new rh2.BusinessInfoWindow(obj, this.fragment.fm) biw.load() .then(function(biw_el) { if (this.fragment.map_mobile_info_window != null) { this.fragment.map_mobile_info_window.close() } const w = this.fragment.map_mobile_info_window = new google.maps.InfoWindow({ content: biw_el, minWidth: 320, }) this.fragment.map_bounds_change_skip = 2 w.open(this.fragment.map_mobile, marker) }.bind(this)) }.bind(this)) google.maps.event.addListener(marker, 'mouseover', function(e) {}.bind(this)) markers.push(marker) } } if (data['geo_attributes']['my_location']) { const lat = data['geo_attributes']['my_location']['lat'] const lng = data['geo_attributes']['my_location']['lng'] const icon_file_path = '/rh2/static/icon/site/map/my_location.png' const icon_url = window.location.origin + icon_file_path const marker_img = document.createElement('img') marker_img.src = icon_url this.my_location_marker = new google.maps.marker.AdvancedMarkerElement({ position: new google.maps.LatLng(lat, lng), map: this.fragment.map_mobile, content: marker_img }) } const map = this.fragment.map_mobile if (this.fragment.map_mobile_marker_clusterer != null) { this.fragment.map_mobile_marker_clusterer.clearMarkers() } const { MarkerClusterer } = markerClusterer const clusterer = this.fragment.map_mobile_marker_clusterer = new MarkerClusterer({ map: map, markers: markers, zoomOnClick: true, algorithmOptions: { maxZoom: 16 } }) } Search.prototype.fetch_data = function(qd, is_see_more) { let path = '/rh2/service/business/list/' let pairs = [] if (is_see_more == true && this.pagination != null) { pairs.push(['offset', this.pagination['next_offset']]) } for (let k in qd) { let v = qd[k] if (!Array.isArray(v)) { continue } for (let i = 0; i < v.length; i++) { if (v[i] == null) { continue } pairs.push([k, v[i]]) } } let querystring = pairs.map(function(pair) { return pair[0] + '=' + encodeURIComponent(pair[1]) }).join('&') if (querystring) { path = path + '?' + querystring } let xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const data = rtn.data this.post_fetch.call(this, data, is_see_more) }.bind(this)) xhr.open("GET", path) xhr.send() } Search.prototype.run = function() { this.fragment.map_bounds_change_skip = 2 const qd = this.cfg_collect_qd() const url = this.build_url(qd) if (url != window.location.href) { window.history.pushState({}, 'Business', url) } this.fetch_data(qd) const search_string = qd && qd['q'] && qd['q'][0] || '' window.ga && ga('RH201905.send', 'event', { 'eventCategory': 'Restaurant', 'eventAction': 'Search', 'eventLabel': search_string, }) window.fbq && fbq('track', 'Search', { search_string: search_string, }) } })()</script> <script>// #BusinessItem ; (function() { const Fragment = function() { this.search_params = new Map() this.filters = [] } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'BusinessItem' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eats/in-region/([\\w-_]+)/in-city/([\\w-_]+)/in-suburb/([\\w-_]+)/([\\w-_]+)\\/'), ] for (let i = 0; i < path_re_list.length; i++) { const mo = path_re_list[i].exec(href_path) if (mo) { return mo } } return false } fragment.get_current_url = function() { return [ "/rh2/eats/in-region/", this.params['region'], "/in-city/", this.params['city'], "/in-suburb/", this.params['suburb'], "/", this.params['slug'], "/", ].join('') } rh2.fragment_manager.register(fragment) fragment._initialize = function() { if (!this.params.__LANDING__) { return } const href_parts = rh2.utils.get_href_parts() const mo = this.match_current_url(href_parts) const region = mo[1] this.params['region'] = region const city = mo[2] this.params['city'] = city const suburb = mo[3] this.params['suburb'] = suburb const slug = mo[4] this.params['slug'] = [slug] const querystring = href_parts[3] const qd = rh2.utils.get_query_dict(querystring) if (qd['ref'] && qd['ref'].length > 0) { this.params['referrer'] = qd['ref'] } if (qd['referrer'] && qd['referrer'].length > 0) { this.params['referrer'] = qd['referrer'] } if (qd['av_pax'] && qd['av_pax'].length > 0) { this.params['pax'] = qd['av_pax'] } if (qd['av_date'] && qd['av_date'].length > 0) { this.params['date'] = qd['av_date'] } if (qd['av_time'] && qd['av_time'].length > 0) { this.params['time'] = qd['av_time'] } if (qd['pax'] && qd['pax'].length > 0) { this.params['pax'] = qd['pax'] } if (qd['date'] && qd['date'].length > 0) { this.params['date'] = qd['date'] if (this.params['date'] < (new Date()).toISOString().substring(0, 10)) { this.clear_param_values('date') this.clear_param_values('pax') } } if (qd['time'] && qd['time'].length > 0) { this.params['time'] = qd['time'] } if (qd['scrollto'] && qd['scrollto'].length > 0) { this.params['scrollto'] = qd['scrollto'] } if (qd['special'] && qd['special'].length > 0) { this.params['special'] = qd['special'] } let url = rh2.utils.modify_href(null, {}) if (url.url_abs !== window.location.href) { window.history.pushState({}, 'Business', url.url_abs) } } fragment._render = function(data) { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-restaurant-item') this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const full_screen_overlay = this.full_screen_overlay = document.createElement('div') full_screen_overlay.classList.add('rh2-restaurant-item-full-screen-overlay') this.el.appendChild(full_screen_overlay) full_screen_overlay.addEventListener('touchbegin', function(e) { e.stopPropagation() }) full_screen_overlay.addEventListener('touchend', function(e) { e.stopPropagation() }) full_screen_overlay.addEventListener('touchmove', function(e) { e.stopPropagation() }) const full_screen_overlay_translucent = this.full_screen_overlay_translucent = document.createElement('div') full_screen_overlay_translucent.classList.add('rh2-restaurant-item-full-screen-overlay-translucent') this.el.appendChild(full_screen_overlay_translucent) const photo_row_fw_el = document.createElement('div') photo_row_fw_el.classList.add('rh2-row-fw') photo_row_fw_el.classList.add('rh2-restaurant-item-photo-row-fw') this.el.appendChild(photo_row_fw_el) const photo_row_el = this.photo_row_el = document.createElement('div') photo_row_el.classList.add('rh2-row-pw') photo_row_el.classList.add('rh2-restaurant-item-photo-row') photo_row_fw_el.appendChild(photo_row_el) const photo_row_left_col_el = this.photo_row_left_col_el = document.createElement('div') photo_row_left_col_el.classList.add('rh2-col') photo_row_left_col_el.classList.add('rh2-w-O-s') photo_row_left_col_el.classList.add('rh2-restaurant-item-photo-row-left-col') photo_row_el.appendChild(photo_row_left_col_el) const photo_show_all_el = this.photo_show_all_el = document.createElement('div') photo_show_all_el.classList.add('rh2-restaurant-item-photo-show-all') photo_row_left_col_el.appendChild(photo_show_all_el) const photo_show_all_icon_el = document.createElement('div') photo_show_all_icon_el.classList.add('rh2-restaurant-item-photo-show-all-icon') photo_show_all_el.appendChild(photo_show_all_icon_el) const photo_show_all_text_el = document.createElement('div') photo_show_all_text_el.classList.add('rh2-restaurant-item-photo-show-all-text') photo_show_all_text_el.innerText = "Show all photos" photo_show_all_el.appendChild(photo_show_all_text_el) const photo_right_col_el = this.photo_row_right_col_el = document.createElement('div') photo_right_col_el.classList.add('rh2-col') photo_right_col_el.classList.add('rh2-hide-on-mobile') photo_right_col_el.classList.add('rh2-restaurant-item-photo-row-right-col') photo_row_el.appendChild(photo_right_col_el) const body_row_fw_el = document.createElement('div') body_row_fw_el.classList.add('rh2-row-fw') body_row_fw_el.classList.add('rh2-body-row') body_row_fw_el.classList.add('rh2-restaurant-item-body-row-fw') this.el.appendChild(body_row_fw_el) const body_row_el = document.createElement('div') body_row_el.classList.add('rh2-row-pw') body_row_el.classList.add('rh2-restaurant-item-body-row') body_row_fw_el.appendChild(body_row_el) const body_row_left_col_el = this.body_row_left_col_el = document.createElement('div') body_row_left_col_el.classList.add('rh2-w-O-s') body_row_left_col_el.classList.add('rh2-restaurant-item-body-row-left-col') body_row_el.appendChild(body_row_left_col_el) const topnav_row = document.createElement('div') body_row_left_col_el.appendChild(topnav_row) const body_row_right_col_el = document.createElement('div') body_row_right_col_el.classList.add('rh2-w-O-s') body_row_right_col_el.classList.add('rh2-restaurant-item-body-row-right-col') body_row_el.appendChild(body_row_right_col_el) this.reservation_form_container = null this.reservation_form_wrapper = null if (this.fm.is_desktop()) { const reservation_form_wrapper_desktop = this.reservation_form_wrapper_desktop = document.createElement('div') reservation_form_wrapper_desktop.classList.add('rh2-restaurant-item-desktop-reservation-form-wrapper') reservation_form_wrapper_desktop.classList.add('rh2-hide-on-mobile') body_row_right_col_el.appendChild(reservation_form_wrapper_desktop) const reservation_form_container_desktop = this.reservation_form_container_desktop = document.createElement('div') reservation_form_container_desktop.classList.add('rh2-restaurant-item-reservation-form-container') reservation_form_wrapper_desktop.appendChild(reservation_form_container_desktop) this.reservation_form_container = reservation_form_container_desktop this.reservation_form_wrapper = reservation_form_wrapper_desktop // const facebook_row_el = this.facebook_row_el = document.createElement('div') // facebook_row_el.classList.add('rh2-row') // facebook_row_el.classList.add('rh2-restaurant-item-facebook-page-row') // body_row_right_col_el.appendChild(facebook_row_el) // const facebook_el = this.facebook_el = document.createElement('div') // facebook_el.setAttribute('class', 'fb-page') // facebook_el.setAttribute('data-tabs', 'timeline') // // facebook_el.setAttribute('data-show-posts', 'true') // facebook_el.setAttribute('data-small-header', 'true') // // facebook_el.setAttribute('data-adapt-container-width', 'true') // facebook_el.setAttribute('data-width', '340') // facebook_el.setAttribute('data-height', '1024') // facebook_el.setAttribute('data-hide-cover', 'false') // facebook_el.setAttribute('data-show-facepile', 'false') // // facebook_el.setAttribute('data-lazy', 'true') // facebook_row_el.appendChild(facebook_el) } // const instagram_row_el = this.instagram_row_el = document.createElement('div') // instagram_row_el.classList.add('rh2-row') // instagram_row_el.classList.add('rh2-restaurant-item-instagram-row') // body_row_right_col_el.appendChild(instagram_row_el) // const instagram_el = this.instagram_el = document.createElement('div') // instagram_row_el.appendChild(instagram_el) const nav_row_el = this.nav_row_el = document.createElement('div') nav_row_el.classList.add('rh2-restaurant-item-nav-row') body_row_left_col_el.appendChild(nav_row_el) const nav_row_fixable_el = this.nav_row_fixable_el = document.createElement('div') nav_row_fixable_el.classList.add('rh2-restaurant-item-nav-row-fixable') nav_row_el.appendChild(nav_row_fixable_el) { let section_offset_modifier = 160 if (this.fm.is_mobile()) { section_offset_modifier = 96 } if (data && (data.specials.length || data.specials_hd.length)) { const nav_specials_el = this.nav_specials_el = document.createElement('div') nav_specials_el.classList.add('rh2-restaurant-item-nav-row-item') nav_specials_el.innerText = 'Specials' nav_row_fixable_el.appendChild(nav_specials_el) nav_specials_el.addEventListener('click', function() { const anchor = this.promotions_section_el const rect = anchor.getBoundingClientRect() const anchor_offset_top = rect.top + document.documentElement.scrollTop //const anchor_offset_top = rect.top window.scrollTo({ top: anchor_offset_top - section_offset_modifier, behavior: 'smooth' }) }.bind(this)) } const nav_menu_el = this.nav_menu_el = document.createElement('div') nav_menu_el.classList.add('rh2-restaurant-item-nav-row-item') nav_menu_el.innerText = 'Menu' nav_row_fixable_el.appendChild(nav_menu_el) nav_menu_el.addEventListener('click', function() { const anchor = this.menu_section_el const rect = anchor.getBoundingClientRect() const anchor_offset_top = rect.top + document.documentElement.scrollTop //const anchor_offset_top = rect.top window.scrollTo({ top: anchor_offset_top - section_offset_modifier, behavior: 'smooth' }) }.bind(this)) const nav_location_el = document.createElement('div') nav_location_el.classList.add('rh2-restaurant-item-nav-row-item') nav_location_el.innerText = 'Location' nav_row_fixable_el.appendChild(nav_location_el) nav_location_el.addEventListener('click', function() { const anchor = this.location_section_el const rect = anchor.getBoundingClientRect() const anchor_offset_top = rect.top + document.documentElement.scrollTop //const anchor_offset_top = rect.top window.scrollTo({ top: anchor_offset_top - section_offset_modifier, behavior: 'smooth' }) }.bind(this)) if (data && data.giftcard_url) { const nav_giftcard_el = this.nav_giftcard_el = document.createElement('div') nav_giftcard_el.classList.add('rh2-restaurant-item-nav-row-item') nav_giftcard_el.innerText = 'Gift card' nav_row_fixable_el.appendChild(nav_giftcard_el) nav_giftcard_el.addEventListener('click', function() { const anchor = this.giftcard_section_el const rect = anchor.getBoundingClientRect() const anchor_offset_top = rect.top + document.documentElement.scrollTop window.scrollTo({ top: anchor_offset_top - section_offset_modifier, behavior: 'smooth' }) }.bind(this)) } if (data && data.delivery_url) { const nav_delivery_el = this.nav_delivery_el = document.createElement('div') nav_delivery_el.classList.add('rh2-restaurant-item-nav-row-item') nav_delivery_el.innerText = 'Order Online' nav_row_fixable_el.appendChild(nav_delivery_el) nav_delivery_el.addEventListener('click', function() { const anchor = this.delivery_section_el const rect = anchor.getBoundingClientRect() const anchor_offset_top = rect.top + document.documentElement.scrollTop window.scrollTo({ top: anchor_offset_top - section_offset_modifier, behavior: 'smooth' }) }.bind(this)) } if (data && data.ta_num_reviews > 0 && this.reviews_section_el) { const nav_reviews_el = document.createElement('div') nav_reviews_el.classList.add('rh2-restaurant-item-nav-row-item') nav_reviews_el.innerText = 'Reviews' nav_row_fixable_el.appendChild(nav_reviews_el) nav_reviews_el.addEventListener('click', function() { const anchor = this.reviews_section_el const rect = anchor.getBoundingClientRect() const anchor_offset_top = rect.top + document.documentElement.scrollTop //const anchor_offset_top = rect.top window.scrollTo({ top: anchor_offset_top - section_offset_modifier, behavior: 'smooth' }) }.bind(this)) } } const info_section_el = this.info_section_el = document.createElement('div') info_section_el.classList.add('rh2-row') info_section_el.classList.add('rh2-restaurant-item-section') info_section_el.classList.add('rh2-restaurant-item-section-info') body_row_left_col_el.appendChild(info_section_el) const name_row_el = this.name_row_el = document.createElement('div') name_row_el.classList.add('rh2-restaurant-item-name-row') info_section_el.appendChild(name_row_el) const name_row_name_col_el = this.name_row_name_col_el = document.createElement('h1') name_row_name_col_el.classList.add('rh2-restaurant-item-name-row-name-col') name_row_el.appendChild(name_row_name_col_el) const name_row_price_col_el = this.name_row_price_col_el = document.createElement('div') name_row_price_col_el.classList.add('rh2-restaurant-item-name-row-price-col') name_row_el.appendChild(name_row_price_col_el) const cuisine_row_el = this.cuisine_row_el = document.createElement('div') cuisine_row_el.classList.add('rh2-restaurant-item-cuisine-row') info_section_el.appendChild(cuisine_row_el) const dietary_row_el = this.dietary_row_el = document.createElement('div') dietary_row_el.classList.add('rh2-restaurant-item-dietary-row') info_section_el.appendChild(dietary_row_el) const feature_row_el = this.feature_row_el = document.createElement('div') feature_row_el.classList.add('rh2-restaurant-item-feature-row') info_section_el.appendChild(feature_row_el) const description_el = this.description_el = document.createElement('div') description_el.classList.add('rh2-restaurant-item-description') info_section_el.appendChild(description_el) if (rh2.config.homepage_coupons_status == 'enabled') { const live_coupons_section_el = this.live_coupons_section_el = document.createElement('div') live_coupons_section_el.classList.add('rh2-row') live_coupons_section_el.classList.add('rh2-restaurant-item-section') live_coupons_section_el.classList.add('rh2-restaurant-item-section-live-coupons') body_row_left_col_el.appendChild(live_coupons_section_el) const live_coupons_section_header_el = this.live_coupons_section_header_el = document.createElement('h2') live_coupons_section_header_el.classList.add('rh2-restaurant-item-section-header') live_coupons_section_header_el.innerText = "Takeaway Offers" live_coupons_section_el.appendChild(live_coupons_section_header_el) const live_coupons_section_body_el = this.live_coupons_section_body_el = document.createElement('div') live_coupons_section_body_el.classList.add('rh2-restaurant-item-section-body') live_coupons_section_body_el.classList.add('rh2-restaurant-item-section-body-live-coupons') live_coupons_section_el.appendChild(live_coupons_section_body_el) const upcoming_coupons_section_el = this.upcoming_coupons_section_el = document.createElement('div') upcoming_coupons_section_el.classList.add('rh2-row') upcoming_coupons_section_el.classList.add('rh2-restaurant-item-section') upcoming_coupons_section_el.classList.add('rh2-restaurant-item-section-upcoming-coupons') body_row_left_col_el.appendChild(upcoming_coupons_section_el) const upcoming_coupons_section_header_el = this.upcoming_coupons_section_header_el = document.createElement('h2') upcoming_coupons_section_header_el.classList.add('rh2-restaurant-item-section-header') upcoming_coupons_section_header_el.innerText = 'Upcoming Takeaway Offers' upcoming_coupons_section_el.appendChild(upcoming_coupons_section_header_el) const upcoming_coupons_section_body_el = this.upcoming_coupons_section_body_el = document.createElement('div') upcoming_coupons_section_body_el.classList.add('rh2-restaurant-item-section-body') upcoming_coupons_section_body_el.classList.add('rh2-restaurant-item-section-body-upcoming-coupons') upcoming_coupons_section_el.appendChild(upcoming_coupons_section_body_el) } if (data && (data.specials.length || data.specials_hd.length)) { const promotions_section_el = this.promotions_section_el = document.createElement('div') promotions_section_el.classList.add('rh2-row') promotions_section_el.classList.add('rh2-restaurant-item-section') promotions_section_el.classList.add('rh2-restaurant-item-section-promotions') body_row_left_col_el.appendChild(promotions_section_el) const promotions_section_header_el = this.promotions_section_header_el = document.createElement('h2') promotions_section_header_el.classList.add('rh2-restaurant-item-section-header') promotions_section_header_el.innerText = 'Bookable Specials' promotions_section_el.appendChild(promotions_section_header_el) const promotions_section_body_el = this.promotions_section_body_el = document.createElement('div') promotions_section_body_el.classList.add('rh2-restaurant-item-section-body') promotions_section_body_el.classList.add('rh2-restaurant-item-section-body-promotions') promotions_section_el.appendChild(promotions_section_body_el) } if (this.fm.is_mobile()) { const reservation_form_wrapper_mobile = this.reservation_form_wrapper_mobile = document.createElement('div') reservation_form_wrapper_mobile.classList.add('rh2-restaurant-item-mobile-reservation-form-wrapper') reservation_form_wrapper_mobile.classList.add('rh2-hide-on-desktop') body_row_left_col_el.appendChild(reservation_form_wrapper_mobile) const reservation_form_container_mobile = this.reservation_form_container_mobile = document.createElement('div') reservation_form_container_mobile.classList.add('rh2-restaurant-item-reservation-form-container') reservation_form_wrapper_mobile.appendChild(reservation_form_container_mobile) this.reservation_form_container = reservation_form_container_mobile this.reservation_form_wrapper = reservation_form_wrapper_mobile } const is_bookable = data && data.bookable const has_history = window.history.length > 1 const show_topnav = is_bookable || has_history if (show_topnav) { topnav_row.classList.add('rh2-restaurant-item-topnav') if (has_history) { const history_back = document.createElement('a') history_back.setAttribute('href', '#') topnav_row.appendChild(history_back) history_back.innerHTML = '← Go back' history_back.addEventListener('click', (e) => { e.preventDefault() window.history.back() }) } else { const placeholder = document.createElement('span') topnav_row.appendChild(placeholder) } if (is_bookable && this.fm.is_mobile()) { const $form = $(this.reservation_form_container) const topnav_book = document.createElement('a') topnav_book.setAttribute('href', '#') topnav_book.classList.add('booking') topnav_book.innerText = 'Book' topnav_row.appendChild(topnav_book) topnav_book.addEventListener('click', (e) => { e.preventDefault() $('html, body').animate({ scrollTop: $form.offset().top - 100 }, 300) }) } } const menu_section_el = this.menu_section_el = document.createElement('div') menu_section_el.classList.add('rh2-row') menu_section_el.classList.add('rh2-restaurant-item-section') body_row_left_col_el.appendChild(menu_section_el) const menu_section_header_el = this.menu_section_header_el = document.createElement('h2') menu_section_header_el.classList.add('rh2-restaurant-item-section-header') menu_section_header_el.innerText = 'Menus' menu_section_el.appendChild(menu_section_header_el) const menu_section_body_el = this.menu_section_body_el = document.createElement('div') menu_section_body_el.classList.add('rh2-restaurant-item-section-body') menu_section_el.appendChild(menu_section_body_el) const menu_m_container_el = this.menu_m_container_el = document.createElement('div') menu_m_container_el.classList.add('rh2-row') menu_m_container_el.classList.add('rh2-restaurant-item-menu-m-container') menu_section_body_el.appendChild(menu_m_container_el) const menu_m_image_row_el = this.menu_m_image_row_el = document.createElement('div') menu_m_image_row_el.classList.add('rh2-row') menu_m_image_row_el.classList.add('rh2-restaurant-item-menu-m-image-row') menu_section_body_el.appendChild(menu_m_image_row_el) const menu_mg_container_el = this.menu_mg_container_el = document.createElement('div') menu_mg_container_el.classList.add('rh2-row') menu_mg_container_el.classList.add('rh2-restaurant-item-menu-mg-container') menu_section_body_el.appendChild(menu_mg_container_el) const menu_mg_image_row_el = this.menu_mg_image_row_el = document.createElement('div') menu_mg_image_row_el.classList.add('rh2-row') menu_mg_image_row_el.classList.add('rh2-restaurant-item-menu-mg-image-row') menu_section_body_el.appendChild(menu_mg_image_row_el) const menu_mi_container_el = this.menu_mi_container_el = document.createElement('div') menu_mi_container_el.classList.add('rh2-row') menu_mi_container_el.classList.add('rh2-restaurant-item-menu-mi-container') menu_section_body_el.appendChild(menu_mi_container_el) const location_section_el = this.location_section_el = document.createElement('div') location_section_el.classList.add('rh2-row') location_section_el.classList.add('rh2-restaurant-item-section') body_row_left_col_el.appendChild(location_section_el) const location_section_header_el = this.location_section_header_el = document.createElement('h2') location_section_header_el.classList.add('rh2-restaurant-item-section-header') location_section_header_el.innerText = 'Location' location_section_el.appendChild(location_section_header_el) const map_container_el = this.map_container_el = document.createElement('div') map_container_el.classList.add('rh2-restaurant-item-section-info-map-container') location_section_el.appendChild(map_container_el) const address_row_el = this.address_row_el = document.createElement('div') this.address_row_el.classList.add('rh2-restaurant-item-address-row') location_section_el.appendChild(address_row_el) const phone_row_el = this.phone_row_el = document.createElement('div') this.phone_row_el.classList.add('rh2-restaurant-item-phone-row') location_section_el.appendChild(phone_row_el) this.openinghours_td_ar = [] const openinghours_table = this.openinghours_table = document.createElement('table') openinghours_table.classList.add('rh2-restaurant-item-openinghours-table') location_section_el.appendChild(openinghours_table) const openinghours_tbody = document.createElement('tbody') openinghours_tbody.classList.add('rh2-restaurant-item-openinghours-tbody') openinghours_table.appendChild(openinghours_tbody) for (let i = 0; i < 2; i++) { const openinghours_tr = document.createElement('tr') openinghours_tr.classList.add('rh2-restaurant-item-openinghours-tr') openinghours_tbody.appendChild(openinghours_tr) for (let j = 0; j < 4; j++) { const openinghours_td = document.createElement('td') openinghours_td.classList.add('rh2-restaurant-item-openinghours-td') openinghours_tr.appendChild(openinghours_td) this.openinghours_td_ar.push(openinghours_td) } } if (data && data.giftcard_url) { const giftcard_section_el = this.giftcard_section_el = document.createElement('div') giftcard_section_el.classList.add('rh2-row') giftcard_section_el.classList.add('rh2-restaurant-item-section') body_row_left_col_el.appendChild(giftcard_section_el) const giftcard_section_header_el = this.giftcard_section_header_el = document.createElement('h2') giftcard_section_header_el.classList.add('rh2-restaurant-item-section-header') giftcard_section_header_el.innerText = 'Gift card' giftcard_section_el.appendChild(giftcard_section_header_el) } if (data && data.delivery_url) { const delivery_section_el = this.delivery_section_el = document.createElement('div') delivery_section_el.classList.add('rh2-row') delivery_section_el.classList.add('rh2-restaurant-item-section') body_row_left_col_el.appendChild(delivery_section_el) const delivery_section_header_el = this.delivery_section_header_el = document.createElement('h2') delivery_section_header_el.classList.add('rh2-restaurant-item-section-header') delivery_section_header_el.innerText = 'Order Online' delivery_section_el.appendChild(delivery_section_header_el) } if (data && data.tripadvisor_id > '' && data.tripadvisor_reviews_active && data.tripadvisor_bookable) { const reviews_section_el = this.reviews_section_el = document.createElement('div') reviews_section_el.classList.add('rh2-row') reviews_section_el.classList.add('rh2-restaurant-item-section') reviews_section_el.classList.add('rh2-restaurant-item-section-reviews') body_row_left_col_el.appendChild(reviews_section_el) const reviews_section_header_el = this.reviews_section_header_el = document.createElement('h2') reviews_section_header_el.classList.add('rh2-restaurant-item-section-header') reviews_section_header_el.innerText = 'Reviews' reviews_section_el.appendChild(reviews_section_header_el) const reviews_section_body_el = this.reviews_section_body_el = document.createElement('div') reviews_section_body_el.classList.add('rh2-restaurant-item-section-body') reviews_section_el.appendChild(reviews_section_body_el) } const footer = rh2.Footer.build() this.el.appendChild(footer) } fragment.load = function() { let slug = this.get_param_value('slug') if (slug == undefined) { return } let url = '/rh2/service/business/business_item_get/' + slug + '/' let xhr = new XMLHttpRequest() xhr.addEventListener('load', function(e) { let s = e.target.responseText let rtn let data try { rtn = JSON.parse(s) data = rtn.data } catch (err) { throw err return } if (rtn.errcode === 404) { window.location.assign('/rh2/generic-404/') return } this.load_restaurant_callback(data) }.bind(this)) xhr.open("GET", url) xhr.send() } fragment.load_restaurant_callback = function(data) { this._render(data) let is_light_weight = false if (this.get_param_value('weight') === 'light') { is_light_weight = true } if (this.get_param_value('referrer') === 'tripadvisor') { is_light_weight = true } if (this.get_param_value('referrer') === 'grabone_rh') { is_light_weight = true } this.name_row_name_col_el.innerText = data.name // this.header_row_el.appendChild(name_el) const price_level = data['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-restaurant-item-name-row-price-on') price_on_el.innerText = price_on_text this.name_row_price_col_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-restaurant-item-name-row-price-off') price_off_el.innerText = price_off_text this.name_row_price_col_el.appendChild(price_off_el) this.cuisine_row_el.innerText = data['cuisine_vals'].join(' · ') this.dietary_row_el.innerText = data['dietary_vals'].join(' · ') this.feature_row_el.innerText = data['feature_vals'].join(' · ') for (let i = 0; i < data.description_lines.length; i++) { const item = data.description_lines[i] const description_line_el = document.createElement('p') description_line_el.classList.add('rh2-restaurant-item-description-row') description_line_el.innerText = item this.description_el.appendChild(description_line_el) } this.map_container_el.setAttribute('data-rh2-restaurant-item-map-restaurant-name', data.name) this.map_container_el.setAttribute('data-rh2-restaurant-item-map-latitude', data['geo_latitude']) this.map_container_el.setAttribute('data-rh2-restaurant-item-map-longitude', data['geo_longitude']) this.prepare_map(this.map_container_el) this.address_row_el.innerText = 'Address: ' + data.address if (data.phone_visible) { this.phone_row_el.innerText = 'Phone: ' + data.phone_number } let openinghours_count = 0 for (let i = 0; i < Math.max(data.openinghours.length, 7); i++) { const item = data.openinghours[i] if (item === undefined) { continue } openinghours_count += 1 const td = this.openinghours_td_ar[i] const day_of_week_row = document.createElement('div') day_of_week_row.classList.add('rh2-restaurant-item-openinghours-td-day-of-week-row') day_of_week_row.innerText = item.weekday_repr td.appendChild(day_of_week_row) for (let j = 0; j < item.chunks.length; j++) { const chunk = item.chunks[j] const time_row = document.createElement('div') time_row.classList.add('rh2-restaurant-item-openinghours-td-time-row') td.appendChild(time_row) const open_el = document.createElement('div') open_el.classList.add('rh2-restaurant-item-section-info-openinghours-open') open_el.innerText = chunk.open_repr time_row.appendChild(open_el) const dash_el = document.createElement('span') dash_el.innerText = ' - ' time_row.appendChild(dash_el) const close_el = document.createElement('div') close_el.classList.add('rh2-restaurant-item-section-info-openinghours-close') close_el.innerText = chunk.close_repr time_row.appendChild(close_el) } } if (openinghours_count == 0) { this.openinghours_table.style['display'] = 'none' } // if (this.fm.is_desktop() && data.facebook_page && !is_light_weight) { // this.facebook_el.setAttribute('data-href', data.facebook_page) // this.prepare_facebook() // } // if (data.instagram_id && !is_light_weight) { // this.embed_instagram(data.instagram_id) // } const photo_left_el = document.createElement('div') photo_left_el.classList.add('rh2-dbgi') photo_left_el.classList.add('rh2-restaurant-item-photo-left') this.photo_row_left_col_el.appendChild(photo_left_el) const images_and_logo_ar = [] for (let i in data.images) { const image = data.images[i] images_and_logo_ar.push({ 'url': image.url + 'imgproc-maxsize=1000/', 'thumbnail_url': image.thumbnail_url, 'tile_url': image.tile_url, }) // this is intentional (not bug) - logo must be put as 2nd image in the list // the first one is used as the main banner if (i == 0 && data.logo_image_url) { images_and_logo_ar.push({ 'url': data.logo_image_url + 'imgproc-maxsize=1000/', 'thumbnail_url': data.logo_image_url, 'tile_url': data.logo_image_url, }) } } if (images_and_logo_ar.length > 0) { const image = images_and_logo_ar[0] rh2.utils.schedule_bgi(photo_left_el, image.url, 0) photo_left_el.addEventListener('click', function() { this.open_image_gallery(images_and_logo_ar, 0)() }.bind(this)) } for (let i = 1; i <= 4; i++) { const photo_tile_container_el = document.createElement('div') photo_tile_container_el.classList.add('rh2-restaurant-item-photo-right-container') this.photo_row_right_col_el.appendChild(photo_tile_container_el) const photo_tile_el = document.createElement('div') photo_tile_el.classList.add('rh2-dbgi') photo_tile_el.classList.add('rh2-restaurant-item-photo-right') photo_tile_container_el.appendChild(photo_tile_el) if (i == 1) { photo_tile_el.classList.add('rh2-restaurant-item-photo-right-tl') } else if (i == 2) { photo_tile_el.classList.add('rh2-restaurant-item-photo-right-tr') } else if (i == 3) { photo_tile_el.classList.add('rh2-restaurant-item-photo-right-bl') } else if (i == 4) { photo_tile_el.classList.add('rh2-restaurant-item-photo-right-br') } const image = images_and_logo_ar[i] if (image) { rh2.utils.schedule_bgi(photo_tile_el, image.tile_url, 0) photo_tile_el.addEventListener('click', function() { this.open_image_gallery(images_and_logo_ar, i)() }.bind(this)) } } this.photo_show_all_el.addEventListener('click', function() { this.open_image_gallery(images_and_logo_ar, 0)() }.bind(this)) if (data.bookable) { const cfg = { 'business_slug': data['slug'], 'region_slug': data['region_slug'], 'city_slug': data['city_slug'], 'suburb_slug': data['suburb_slug'], 'slug': data['slug'], 'layout': 'MOBILE', 'fm': this.fm, } if (this.num_param_values('referrer') == 1) { cfg['referrer'] = this.get_param_value('referrer') } if (this.num_param_values('pax') == 1) { cfg['pax'] = this.get_param_value('pax') } if (this.num_param_values('date') == 1) { cfg['date'] = this.get_param_value('date') } if (this.num_param_values('time') == 1) { cfg['time'] = this.get_param_value('time') } //reservation_form_container.appendChild(rh2.components.render_reservation_iframe(cfg)) const calendar_view_el = rh2.Booking.render_calendar_view(cfg) this.reservation_form_container.appendChild(calendar_view_el) const _params = this.params; (function() { const href_parts = rh2.utils.get_href_parts() const qd = rh2.utils.get_query_dict(href_parts[3]) let to_scroll_to_booking = false if (qd && qd['referrer']) { const ref = qd['referrer'][0] if (ref === 'tripadvisor' || ref === 'linkshop' || ref === 'eventfinda' && href_parts[3].indexOf('#booknow') > -1 ) { to_scroll_to_booking = true } } if (this.get_param_value('scrollto') == 'BOOKING') { to_scroll_to_booking = true } if (to_scroll_to_booking) { if (this.fm.is_desktop()) { const anchor = this.reservation_form_wrapper_desktop const rect = anchor.getBoundingClientRect() //const anchor_offset_top = rect.top + document.documentElement.scrollTop const anchor_offset_top = rect.top if (rect.height > 0) { document.addEventListener('readystatechange', function() { if (document.readyState === 'complete') { setTimeout(function() { window.scrollTo(0, anchor_offset_top - 160) }, 100) } }) } } else { const anchor = this.reservation_form_wrapper_mobile const rect = anchor.getBoundingClientRect() //const anchor_offset_top = rect.top + document.documentElement.scrollTop //console.log(rect.top, document.documentElement.scrollTop) const anchor_offset_top = rect.top if (rect.height > 0) { document.addEventListener('readystatechange', function() { if (document.readyState === 'complete') { setTimeout(function() { window.scrollTo(0, anchor_offset_top + 440) }, 100) } }) } } } }.bind(this))() } else { this.reservation_form_container.parentNode.classList.add('rh2-hide-on-desktop') this.reservation_form_container.parentNode.classList.add('rh2-hide-on-mobile') this.reservation_form_container.parentNode.removeChild(this.reservation_form_container) } let menu_count = 0 for (let m_uid in data.menu) { menu_count += 1 const m = data.menu[m_uid] const m_el = document.createElement('div') m_el.classList.add('rh2-restaurant-item-menu-m') m_el.setAttribute('data-rh2-restaurant-item-menu-m-uid', m_uid) this.menu_m_container_el.appendChild(m_el) const m_text = document.createElement('div') m_text.classList.add('rh2-restaurant-item-menu-m-text') m_text.innerText = m.name m_el.appendChild(m_text) const _images_m_ar = [] for (let i = 0; i < m.images.length; i++) { const image_id = m.images[i] _images_m_ar.push({ 'url': '/rh2/service/merchant/restaurant/cloudfile-get/' + image_id, 'thumbnail_url': '/rh2/service/merchant/restaurant/cloudfile-get/' + image_id + '/imgproc-thumbnail=96,96', }) } for (let i = 0; i < _images_m_ar.length; i++) { const image = _images_m_ar[i] const m_image_el = document.createElement('div') m_image_el.classList.add('rh2-restaurant-item-menu-m-image-tile') m_image_el.setAttribute('data-rh2-restaurant-item-menu-m-uid', m_uid) m_image_el.style['background-image'] = "url('" + image['thumbnail_url'] this.menu_m_image_row_el.appendChild(m_image_el) m_image_el.addEventListener('click', this.open_image_gallery(_images_m_ar, i)) } for (let mg_uid in m.d) { const mg = m.d[mg_uid] const mg_el = document.createElement('div') mg_el.classList.add('rh2-restaurant-item-menu-mg') mg_el.setAttribute('data-rh2-restaurant-item-menu-m-uid', m_uid) mg_el.setAttribute('data-rh2-restaurant-item-menu-mg-uid', mg_uid) mg_el.innerText = mg.name this.menu_mg_container_el.appendChild(mg_el) const _images_mg_ar = [] for (let j = 0; j < mg.images.length; j++) { const image_id = mg.images[j] _images_mg_ar.push({ 'url': '/rh2/service/merchant/restaurant/cloudfile-get/' + image_id, 'thumbnail_url': '/rh2/service/merchant/restaurant/cloudfile-get/' + image_id + '/imgproc-thumbnail=96,96', }) } for (let j = 0; j < _images_mg_ar.length; j++) { const image = _images_mg_ar[j] const mg_image_el = document.createElement('div') mg_image_el.classList.add('rh2-restaurant-item-menu-mg-image-tile') mg_image_el.setAttribute('data-rh2-restaurant-item-menu-mg-uid', mg_uid) mg_image_el.style['background-image'] = "url('" + image['thumbnail_url'] this.menu_mg_image_row_el.appendChild(mg_image_el) mg_image_el.addEventListener('click', this.open_image_gallery(_images_mg_ar, j)) } for (let mi_uid in mg.d) { const mi = mg.d[mi_uid] const mi_el = document.createElement('div') mi_el.classList.add('rh2-restaurant-item-menu-mi') mi_el.setAttribute('data-rh2-restaurant-item-menu-m-uid', m_uid) mi_el.setAttribute('data-rh2-restaurant-item-menu-mg-uid', mg_uid) mi_el.setAttribute('data-rh2-restaurant-item-menu-mi-uid', mi_uid) const row_0_el = document.createElement('div') row_0_el.classList.add('rh2-restaurant-item-menu-mi-row-0') row_0_el.classList.add('rh2-row') mi_el.appendChild(row_0_el) const name_el = document.createElement('div') name_el.classList.add('rh2-restaurant-item-menu-mi-name') name_el.innerText = mi.name row_0_el.appendChild(name_el) const price_el = document.createElement('div') price_el.classList.add('rh2-restaurant-item-menu-mi-price') price_el.innerText = mi.price row_0_el.appendChild(price_el) const row_1_el = document.createElement('div') row_1_el.classList.add('rh2-restaurant-item-menu-mi-row-1') mi_el.appendChild(row_1_el) const description_el = document.createElement('div') description_el.classList.add('rh2-restaurant-item-menu-mi-description') description_el.innerText = mi.description row_1_el.appendChild(description_el) if (mi.images.length > 0) { const _images_mi_ar = [] for (let k = 0; k < mi.images.length; k++) { const image_id = mi.images[k] _images_mi_ar.push({ 'url': '/rh2/service/merchant/restaurant/cloudfile-get/' + image_id, 'thumbnail_url': '/rh2/service/merchant/restaurant/cloudfile-get/' + image_id + '/imgproc-thumbnail=96,96', }) } for (let k = 0; k < _images_mi_ar.length; k++) { const image = _images_mi_ar[k] const mi_image_el = document.createElement('div') mi_image_el.classList.add('rh2-restaurant-item-menu-mi-image-tile') mi_image_el.setAttribute('data-rh2-restaurant-item-menu-mi-uid', mg_uid) mi_image_el.style['background-image'] = "url('" + image['thumbnail_url'] row_1_el.appendChild(mi_image_el) mi_image_el.addEventListener('click', this.open_image_gallery(_images_mi_ar, k)) } } this.menu_mi_container_el.appendChild(mi_el) } } } if (menu_count == 0) { this.nav_menu_el.style['display'] = 'none' this.menu_section_el.style['display'] = 'none' } const live_coupons = [] const upcoming_coupons = [] for (let i = 0; i < data['coupons'].length; i++) { const coupon_data = data['coupons'][i] const coupon = new rh2.Coupon.CouponStruct() coupon.decode(coupon_data) const av_ar = coupon.get_availability_ar() let is_live = false for (let pair of av_ar) { const av = pair[1] if (av) { is_live = true } } if (is_live) { live_coupons.push(coupon_data) } else { upcoming_coupons.push(coupon_data) } } if (data.specials.length || data.specials_hd.length) { let all_promotions = data.specials.concat(data.specials_hd) all_promotions.sort((a, b) => { return a.ordering - b.ordering }) for (let promotion of all_promotions) { const schedules = [] for (let schedule of promotion.schedules) { if (schedule['is_active'] == false) { continue } const current_date_str = (new Date()).toISOString().substring(0, 10) if (schedule['date_end'] < current_date_str) { continue } schedules.push(schedule) } const promotion_el = rh2.Special.render_card_for_business_item_page(promotion, schedules, data, this) this.promotions_section_body_el.appendChild(promotion_el) } } if (!is_light_weight && data.tripadvisor_id > '' && data.tripadvisor_reviews_active && data.tripadvisor_bookable) { const tripadvisor_iframe_el = document.createElement('iframe') tripadvisor_iframe_el.classList.add('rh2-row') tripadvisor_iframe_el.setAttribute('src', 'https://www.tripadvisor.com/WidgetEmbed-cdspropertydetail?locationId=' + data.slug + '&partnerId=12F55CEAB8ED4BFF9CE6B34F353F9D89&lang=en_AU&display=true') tripadvisor_iframe_el.setAttribute('frameborder', '0') tripadvisor_iframe_el.setAttribute('scrolling', 'auto') this.reviews_section_body_el.appendChild(tripadvisor_iframe_el) } if (data.giftcard_url > '') { const row = document.createElement("div") row.style["display"] = "flex" row.style["flex-direction"] = "row" row.style["align-items"] = "center" this.giftcard_section_el.appendChild(row) const text = document.createElement("span") text.innerText = `${data['name']} sells gift cards. To see the options, follow this link: ` row.appendChild(text) const link = document.createElement("a") link.innerText = "Gift card" link.setAttribute("target", "_blank") link.setAttribute("href", data['giftcard_url']) link.style["margin-left"] = "16px" link.style["padding"] = "16px" link.style["border-radius"] = "8px" link.style["color"] = "white" link.style["background-color"] = "hsla(100, 100%, 25%, 1)" row.appendChild(link) } if (data.delivery_url > '') { const row = document.createElement("div") row.style["display"] = "flex" row.style["flex-direction"] = "row" row.style["align-items"] = "center" this.delivery_section_el.appendChild(row) const text = document.createElement("span") text.innerText = `${data['name']} offers deliveries. To see the options, follow this link: ` row.appendChild(text) const link = document.createElement("a") link.innerText = "Order Online" link.setAttribute("target", "_blank") link.setAttribute("href", data['delivery_url']) link.style["margin-left"] = "16px" link.style["padding"] = "16px" link.style["border-radius"] = "8px" link.style["color"] = "white" link.style["background-color"] = "hsla(200, 100%, 25%, 1)" row.appendChild(link) } this.bind_menu_m_click() this.bind_menu_mg_click() this.click_menu_m() { const href_parts = rh2.utils.get_href_parts() const qd = rh2.utils.get_query_dict(href_parts[3]) if (this.get_param_value('scrollto') == 'COUPON') { //if (this.params.qd['scrollto'] == 'COUPON') { document.addEventListener('readystatechange', function() { if (document.readyState === 'complete') { setTimeout(function() { if (!this.nav_coupons_el.classList.contains('rh2-restaurant-item-nav-row-item-hidden')) { this.nav_coupons_el.click() } }.bind(this), 100) } }.bind(this)) } if (this.get_param_value('scrollto') == 'SPECIAL') { //if (this.params.qd['scrollto'] == 'SPECIAL') { document.addEventListener('readystatechange', function() { if (document.readyState === 'complete' && !!this.nav_specials_el) { setTimeout(function() { if (!this.nav_specials_el.classList.contains('rh2-restaurant-item-nav-row-item-hidden')) { this.nav_specials_el.click() } }.bind(this), 100) } }.bind(this)) } if (this.get_param_value('special') > '') { document.addEventListener('readystatechange', function() { let special_id = this.get_param_value('special').split('?')[0] let $el = $('#' + special_id) if ($el.length > 0) { $('html, body').animate({ scrollTop: $el.offset().top - 100 }, 300) } }.bind(this)) } } const seo_crawler = document.body.getAttribute('data-rh2-seo-crawler') if (seo_crawler != '') { const h2_li = document.body.getElementsByTagName('h2') for (let i = 0; i < h2_li.length; i++) { const h2 = h2_li[i] h2.innerText = data['name'] + ' ' + h2.innerText } } } fragment.open_image_gallery = function(images, n) { return async function() { n = n || 0 let current_idx = n this.full_screen_overlay.innerHTML = '' this.full_screen_overlay.classList.add('rh2-restaurant-item-full-screen-overlay-active') const overlay_close_button = document.createElement('div') overlay_close_button.classList.add('rh2-restaurant-item-full-screen-overlay-close') this.full_screen_overlay.appendChild(overlay_close_button) overlay_close_button.addEventListener('click', function() { this.full_screen_overlay.classList.remove('rh2-restaurant-item-full-screen-overlay-active') }.bind(this)) this.full_screen_overlay.addEventListener('click', function(e) { if (e.target.classList.contains('rh2-restaurant-item-photo-gallery-display')) { return } if (e.target.classList.contains('rh2-restaurant-item-photo-gallery-display-image')) { return } if (e.target.classList.contains('rh2-restaurant-item-photo-gallery-controller-section')) { return } if (e.target.classList.contains('rh2-restaurant-item-photo-gallery-nav-left')) { return } if (e.target.classList.contains('rh2-restaurant-item-photo-gallery-nav-right')) { return } this.full_screen_overlay.classList.remove('rh2-restaurant-item-full-screen-overlay-active') }.bind(this)) const photo_gallery_container = document.createElement('div') photo_gallery_container.classList.add('rh2-restaurant-item-photo-gallery-container') this.full_screen_overlay.appendChild(photo_gallery_container) const photo_gallery_display_section_el = document.createElement('div') photo_gallery_display_section_el.classList.add('rh2-restaurant-item-photo-gallery-display-section') photo_gallery_container.appendChild(photo_gallery_display_section_el) const photo_gallery_nav_left_el = document.createElement('div') photo_gallery_nav_left_el.classList.add('rh2-restaurant-item-photo-gallery-nav-left') photo_gallery_display_section_el.appendChild(photo_gallery_nav_left_el) photo_gallery_nav_left_el.addEventListener('click', function(e) { if (current_idx == 0) { return } current_idx = current_idx - 1 thumbnail_el_ar[current_idx].click() }) const photo_gallery_nav_right_el = document.createElement('div') photo_gallery_nav_right_el.classList.add('rh2-restaurant-item-photo-gallery-nav-right') photo_gallery_display_section_el.appendChild(photo_gallery_nav_right_el) photo_gallery_nav_right_el.addEventListener('click', function(e) { if (current_idx >= thumbnail_el_ar.length - 1) { return } current_idx = current_idx + 1 thumbnail_el_ar[current_idx].click() }) const photo_gallery_display_el = document.createElement('div') photo_gallery_display_el.classList.add('rh2-restaurant-item-photo-gallery-display') photo_gallery_display_section_el.appendChild(photo_gallery_display_el) const photo_gallery_display_image_el = document.createElement('div') photo_gallery_display_image_el.classList.add('rh2-restaurant-item-photo-gallery-display-image') photo_gallery_display_el.appendChild(photo_gallery_display_image_el) // https://github.com/timmywil/panzoom plugin handles touch, drag, pinch-to-zoom, scroll-to-zoom, etc. let panzoom_loaded = await rh2.utils.wait_objects(['Panzoom'], 15000) if (panzoom_loaded) { const panzoom = Panzoom(photo_gallery_display_image_el, { minScale: 1, maxScale: 2, }) photo_gallery_display_image_el.parentElement.addEventListener('wheel', panzoom.zoomWithWheel) } const display_width = parseInt(window.getComputedStyle(photo_gallery_display_el)['width']) const display_height = parseInt(window.getComputedStyle(photo_gallery_display_el)['height']) let image_scale = 1 let image_left = 0 let image_top = 0 let one_finger_touch_begin = null let one_finger_touch_end = null let two_fingers_touch_distance_begin = null //this.full_screen_overlay.appendChild(touch_info) photo_gallery_display_el.addEventListener('touchmove', function(e) { if (e.touches.length == 1) { if (one_finger_touch_begin == null) { one_finger_touch_begin = e.touches[0] } else { one_finger_touch_end = e.touches[0] modify_image() one_finger_touch_begin = one_finger_touch_end } } if (e.touches.length == 2) { const dist = Math.sqrt(Math.pow((e.touches[0].screenX - e.touches[1].screenX), 2) + Math.pow((e.touches[0].screenY - e.touches[1].screenY), 2)) if (two_fingers_touch_distance_begin == null) { two_fingers_touch_distance_begin = dist } else { const dist_diff = dist - two_fingers_touch_distance_begin image_scale = (image_scale * 200 + dist_diff) / 200 image_scale = Math.min(4, image_scale) image_scale = Math.max(1, image_scale) modify_image() } } }) photo_gallery_display_el.addEventListener('touchstart', function(e) { one_finger_touch_begin = null one_finger_touch_end = null two_fingers_touch_distance_begin = null }) photo_gallery_display_el.addEventListener('touchend', function(e) { one_finger_touch_begin = null one_finger_touch_end = null two_fingers_touch_distance_begin = null }) const display_image = function(url) { photo_gallery_display_image_el.style['background-image'] = "url('" + url + "')" image_scale = 1 image_left = 0 image_top = 0 modify_image() } const modify_image = function() { photo_gallery_display_el.style['transform'] = 'scale(' + image_scale + ',' + image_scale + ')' if (one_finger_touch_begin != null & one_finger_touch_end != null) { const t0 = one_finger_touch_begin const t1 = one_finger_touch_end const diff_x = (t1.screenX - t0.screenX) / image_scale const diff_y = (t1.screenY - t0.screenY) / image_scale image_left = image_left + diff_x image_left = Math.max(Math.abs((display_width * image_scale - display_width) / 2 / image_scale) * -1, image_left) image_left = Math.min(Math.abs((display_width * image_scale - display_width) / 2 / image_scale) * 1, image_left) image_top = image_top + diff_y image_top = Math.max(Math.abs((display_height * image_scale - display_height) / 2 / image_scale) * -1, image_top) image_top = Math.min(Math.abs((display_height * image_scale - display_height) / 2 / image_scale) * 1, image_top) } else { image_left = 0 image_top = 0 } photo_gallery_display_image_el.style['left'] = image_left + 'px' photo_gallery_display_image_el.style['top'] = image_top + 'px' } const photo_gallery_controller_section_el = document.createElement('div') photo_gallery_controller_section_el.classList.add('rh2-restaurant-item-photo-gallery-controller-section') photo_gallery_container.appendChild(photo_gallery_controller_section_el) const photo_gallery_controller_wrapper_el = document.createElement('div') photo_gallery_controller_wrapper_el.classList.add('rh2-restaurant-item-photo-gallery-controller-wrapper') photo_gallery_controller_section_el.appendChild(photo_gallery_controller_wrapper_el) const thumbnail_el_ar = [] for (let i = 0; i < images.length; i++) { const image = images[i] const image_url = image['url'] const thumbnail_url = image['thumbnail_url'] const thumbnail_el = document.createElement('div') thumbnail_el.classList.add('rh2-restaurant-item-photo-thumbnail') thumbnail_el.classList.add('rh2-dbgi') thumbnail_el.setAttribute('data-rh2-restaurant-item-photo-display-url', image_url) rh2.utils.schedule_bgi(thumbnail_el, thumbnail_url, 0) photo_gallery_controller_wrapper_el.appendChild(thumbnail_el) thumbnail_el.addEventListener('click', function(e) { e.stopPropagation() let url = e.target.getAttribute('data-rh2-restaurant-item-photo-display-url') display_image(url) }.bind(this)) thumbnail_el_ar.push(thumbnail_el) } thumbnail_el_ar[current_idx] && thumbnail_el_ar[current_idx].click() photo_gallery_controller_wrapper_el.style['width'] = 140 * thumbnail_el_ar.length + 'px' }.bind(this) } fragment.on_click_menu_image = function(images) { return function(e) { const image_uuid = e.currentTarget.getAttribute('data-rh2-restaurant-item-menu-image-uuid') const idx_total = images.length let current_idx = images.indexOf(image_uuid) const sizes = ["100%", "200%", "300%", "400%"] let current_size = "100%" const overlay_el = document.createElement('div') overlay_el.classList.add('rh2-restaurant-item-menu-image-overlay') document.body.appendChild(overlay_el) const image_container = document.createElement('div') image_container.classList.add('rh2-restaurant-item-menu-image-image-container') overlay_el.appendChild(image_container) image_container.addEventListener('click', function(e) { e.stopPropagation() overlay_el.parentNode.removeChild(overlay_el) }) const image = document.createElement('div') image.classList.add('rh2-restaurant-item-menu-image-image') image.classList.add('rh2-restaurant-item-menu-image-image-1x') image_container.appendChild(image) image.addEventListener('click', function(e) { e.stopPropagation() }) const control_row_wrapper = document.createElement('div') control_row_wrapper.classList.add('rh2-restaurant-item-menu-image-control-row-wrapper') overlay_el.appendChild(control_row_wrapper) const control_row_left_padding = document.createElement('div') control_row_left_padding.classList.add('rh2-restaurant-item-menu-image-control-row-left-padding') control_row_wrapper.appendChild(control_row_left_padding) const control_row = document.createElement('div') control_row.classList.add('rh2-restaurant-item-menu-image-control-row') control_row_wrapper.appendChild(control_row) const control_row_right_padding = document.createElement('div') control_row_right_padding.classList.add('rh2-restaurant-item-menu-image-control-row-right-padding') control_row_wrapper.appendChild(control_row_right_padding) const control_row_col_left = document.createElement('div') control_row_col_left.classList.add('rh2-restaurant-item-menu-image-control-row-left-col') control_row.appendChild(control_row_col_left) const icon_close = document.createElement('div') icon_close.classList.add('rh2-restaurant-item-menu-image-control-row-icon') icon_close.style['background-image'] = "url('/rh2/static/icon/material/navigation/2x_web/ic_close_black_36dp.png')" control_row_col_left.appendChild(icon_close) icon_close.addEventListener('click', function(e) { e.stopPropagation() overlay_el.parentNode.removeChild(overlay_el) }) const control_row_col_middle = document.createElement('div') control_row_col_middle.classList.add('rh2-restaurant-item-menu-image-control-row-middle-col') control_row.appendChild(control_row_col_middle) const icon_smaller = document.createElement('div') icon_smaller.classList.add('rh2-restaurant-item-menu-image-control-row-icon') icon_smaller.style['background-image'] = "url('/rh2/static/icon/material/content/2x_web/ic_remove_black_36dp.png')" control_row_col_middle.appendChild(icon_smaller) icon_smaller.addEventListener('click', function(e) { e.stopPropagation() if (current_size == "200%") { go_to_size("100%"); return; } if (current_size == "300%") { go_to_size("200%"); return; } if (current_size == "400%") { go_to_size("300%"); return; } }) const size_span = document.createElement('span') size_span.classList.add('rh2-restaurant-item-menu-image-control-row-icon') control_row_col_middle.appendChild(size_span) const icon_larger = document.createElement('div') icon_larger.classList.add('rh2-restaurant-item-menu-image-control-row-icon') icon_larger.style['background-image'] = "url('/rh2/static/icon/material/content/2x_web/ic_add_black_36dp.png')" control_row_col_middle.appendChild(icon_larger) icon_larger.addEventListener('click', function(e) { e.stopPropagation() if (current_size == "100%") { go_to_size("200%"); return; } if (current_size == "200%") { go_to_size("300%"); return; } if (current_size == "300%") { go_to_size("400%"); return; } }) const control_row_col_right = document.createElement('div') control_row_col_right.classList.add('rh2-restaurant-item-menu-image-control-row-right-col') control_row.appendChild(control_row_col_right) const icon_prev = document.createElement('div') icon_prev.classList.add('rh2-restaurant-item-menu-image-control-row-icon') icon_prev.style['background-image'] = "url('/rh2/static/icon/material/navigation/2x_web/ic_arrow_back_black_36dp.png')" control_row_col_right.appendChild(icon_prev) icon_prev.addEventListener('click', function(e) { e.stopPropagation() if (current_idx > 0) { go_to_idx(current_idx - 1) } }) const idx_span = document.createElement('span') idx_span.classList.add('rh2-restaurant-item-menu-image-control-row-icon') control_row_col_right.appendChild(idx_span) const icon_next = document.createElement('div') icon_next.classList.add('rh2-restaurant-item-menu-image-control-row-icon') icon_next.style['background-image'] = "url('/rh2/static/icon/material/navigation/2x_web/ic_arrow_forward_black_36dp.png')" control_row_col_right.appendChild(icon_next) icon_next.addEventListener('click', function(e) { e.stopPropagation() if (current_idx < idx_total - 1) { go_to_idx(current_idx + 1) } }) const go_to_idx = function(idx) { current_idx = idx idx_span.innerText = (current_idx + 1) + " / " + idx_total const image_uuid = images[current_idx] image.style['background-image'] = "url('/rh2/service/merchant/restaurant/cloudfile-get/" + image_uuid + '/imgproc-maxsize=1000/' } const go_to_size = function(size) { current_size = size size_span.innerText = current_size if (current_size == "100%") { image.classList.add('rh2-restaurant-item-menu-image-image-1x') image.classList.remove('rh2-restaurant-item-menu-image-image-2x') image.classList.remove('rh2-restaurant-item-menu-image-image-3x') image.classList.remove('rh2-restaurant-item-menu-image-image-4x') } if (current_size == "200%") { image.classList.remove('rh2-restaurant-item-menu-image-image-1x') image.classList.add('rh2-restaurant-item-menu-image-image-2x') image.classList.remove('rh2-restaurant-item-menu-image-image-3x') image.classList.remove('rh2-restaurant-item-menu-image-image-4x') } if (current_size == "300%") { image.classList.remove('rh2-restaurant-item-menu-image-image-1x') image.classList.remove('rh2-restaurant-item-menu-image-image-2x') image.classList.add('rh2-restaurant-item-menu-image-image-3x') image.classList.remove('rh2-restaurant-item-menu-image-image-4x') } if (current_size == "400%") { image.classList.remove('rh2-restaurant-item-menu-image-image-1x') image.classList.remove('rh2-restaurant-item-menu-image-image-2x') image.classList.remove('rh2-restaurant-item-menu-image-image-3x') image.classList.add('rh2-restaurant-item-menu-image-image-4x') } } go_to_idx(current_idx) go_to_size(current_size) } } fragment.prepare_map = async function(map_container_el) { let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } const marker_text = map_container_el.getAttribute('data-rh2-restaurant-item-map-restaurant-name') const latitude = map_container_el.getAttribute('data-rh2-restaurant-item-map-latitude') const longitude = map_container_el.getAttribute('data-rh2-restaurant-item-map-longitude') if (latitude && longitude && window.google) { const latlon = new google.maps.LatLng(parseFloat(latitude), parseFloat(longitude)) const options = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, center: latlon, mapTypeControl: false, streetViewControl: false, mapId: 'business_item', } const map = new google.maps.Map(map_container_el, options) const marker = new google.maps.marker.AdvancedMarkerElement({ position: latlon, map: map, title: marker_text, }) } else { map_container_el.style['display'] = 'none' } } // fragment.prepare_facebook = function() { // if (this.fb_root_el && this.fb_script_el && window.FB) { // FB.XFBML.parse() // return // } // const fb_root_el = this.fb_root_el = document.createElement('div') // fb_root_el.setAttribute('id', 'fb-root') // document.body.appendChild(fb_root_el) // const fb_script_el = this.fb_script_el = document.createElement('script') // fb_script_el.setAttribute('async', true) // fb_script_el.setAttribute('defer', true) // fb_script_el.setAttribute('crossorigin', 'anonymous') // fb_script_el.setAttribute('src', 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v19.0&appId=706608999777126') // document.body.appendChild(fb_script_el) // } // fragment.embed_instagram = function(instagram_id) { // const iframe = document.createElement('iframe') // const url = 'https://www.instagram.com/' + instagram_id + '/embed' // iframe.setAttribute('src', url) // iframe.setAttribute('width', 340) // iframe.setAttribute('height', 420) // iframe.setAttribute('scrolling', 'no') // iframe.setAttribute('frameborder', '0') // iframe.setAttribute('allowtransparency', 'true') // this.instagram_el.appendChild(iframe) // } fragment.bind_images_thumbnail_click = function() { const els = this.el.getElementsByClassName('rh2-restaurant-item-images-thumbnails-item') for (let i = 0; i < els.length; i++) { els[i].addEventListener('click', function(e) { let url = e.target.getAttribute('data-rh2-restaurant-item-images-image-display-url') rh2.utils.schedule_bgi(this.images_display_el, url, 0) }.bind(this)) } } fragment.bind_menu_m_click = function() { const menu_m_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-m') for (let i = 0; i < menu_m_els.length; i++) { const menu_m_el = menu_m_els[i] menu_m_el.addEventListener('click', function(e) { const el = e.currentTarget const m_uid = el.getAttribute('data-rh2-restaurant-item-menu-m-uid') const _m_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-m') for (let j = 0; j < _m_els.length; j++) { const _m_el = _m_els[j] if (_m_el.getAttribute('data-rh2-restaurant-item-menu-m-uid') === m_uid) { _m_el.classList.add('rh2-restaurant-item-menu-m-selected') } else { _m_el.classList.remove('rh2-restaurant-item-menu-m-selected') } } const image_tile_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-m-image-tile') for (let j = 0; j < image_tile_els.length; j++) { const image_tile = image_tile_els[j] if (image_tile.getAttribute('data-rh2-restaurant-item-menu-m-uid') === m_uid) { image_tile.classList.remove('rh2-display-none') } else { image_tile.classList.add('rh2-display-none') } } const mg_image_tile_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mg-image-tile') for (let j = 0; j < mg_image_tile_els.length; j++) { mg_image_tile_els[j].classList.add('rh2-display-none') } const mi_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mi') for (let j = 0; j < mi_els.length; j++) { mi_els[j].classList.add('rh2-display-none') } const _mg_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mg') let _mg_clicked = false for (let j = 0; j < _mg_els.length; j++) { const _mg_el = _mg_els[j] if (_mg_el.getAttribute('data-rh2-restaurant-item-menu-m-uid') === m_uid) { _mg_el.classList.remove('rh2-display-none') if (!_mg_clicked) { _mg_el.click() _mg_clicked = true } } else { _mg_el.classList.add('rh2-display-none') } } }.bind(this)) } } fragment.bind_menu_mg_click = function() { const menu_mg_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mg') for (let i = 0; i < menu_mg_els.length; i++) { const menu_mg_el = menu_mg_els[i] menu_mg_el.addEventListener('click', function(e) { const el = e.target const mg_uid = el.getAttribute('data-rh2-restaurant-item-menu-mg-uid') const _mg_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mg') for (let j = 0; j < _mg_els.length; j++) { const _mg_el = _mg_els[j] if (_mg_el.getAttribute('data-rh2-restaurant-item-menu-mg-uid') === mg_uid) { _mg_el.classList.add('rh2-restaurant-item-menu-mg-selected') } else { _mg_el.classList.remove('rh2-restaurant-item-menu-mg-selected') } } const _mi_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mi') let _mi_clicked = false for (let j = 0; j < _mi_els.length; j++) { const _mi_el = _mi_els[j] if (_mi_el.getAttribute('data-rh2-restaurant-item-menu-mg-uid') === mg_uid) { _mi_el.classList.remove('rh2-display-none') if (!_mi_clicked) { _mi_el.click() _mi_clicked = true } } else { _mi_el.classList.add('rh2-display-none') } } const image_tile_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-mg-image-tile') for (let j = 0; j < image_tile_els.length; j++) { const image_tile = image_tile_els[j] if (image_tile.getAttribute('data-rh2-restaurant-item-menu-mg-uid') === mg_uid) { image_tile.classList.remove('rh2-display-none') } else { image_tile.classList.add('rh2-display-none') } } }.bind(this)) } } fragment.click_menu_m = function() { const menu_m_els = this.el.getElementsByClassName('rh2-restaurant-item-menu-m') for (let i = 0; i < menu_m_els.length; i++) { menu_m_els[i].click() break } } })()</script> <script>// # site-1-booking ; (function() { let today = rh2.utils.get_today_str() let var_business_slug = null let var_date = null let var_pax = 2 let var_time = null let av_time = null let var_first_name = '' let var_last_name = '' let var_email_address = '' let var_phone_number = '' let var_br_rh_uuid = null let var_eveve_reference = null let cc_required = null let var_is_closed = false // selected promotion object let var_promotion = null // selected promotion uuid let var_special = null // currently available promotions let var_promotions = [] let var_dates = [] let var_times = { is_closed: true, options: [], slots: [] } let var_rota_messages = [] let var_session_to_show = null // 0 for breakfast, 1 for lunch, 2 for dinner let session_buttons = [] let business_info = { name: '', logo_image_url: '', } let business_setup = { book_interval: 30, pax_options: [], book_options: [], guest_options: [], does_accept_notes: false, dates_closed: [], } let book_option_inputs = [] let guest_option_inputs = [] let page_ref = '' let page_http_referer = '' let stripe = null let stripe_elements = null let stripe_form_required = false let stripe_form_filled = false // Hot Deal prices per person (discount: cents) const prices_hd = rh2.Promotion.prices_hd const Fragment = function() { this.search_params = new Map() this.filters = [] } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'Booking' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eats/in-region/([\\w-_]+)/in-city/([\\w-_]+)/in-suburb/([\\w-_]+)/([\\w-_]+)\\/booking/?$'), ] for (let i = 0; i < path_re_list.length; i++) { const mo = path_re_list[i].exec(href_path) if (mo) { return mo } } return false } fragment.get_current_url = function() { return [ '/rh2/eats/in-region/', this.get_param_value('region'), '/in-city/', this.get_param_value('city'), '/in-suburb/', this.get_param_value('suburb'), '/', this.get_param_value('slug'), '/', 'booking/', ].join('') } rh2.fragment_manager.register(fragment) fragment._initialize = function() { if (!this.params.__LANDING__) { return } const href_parts = rh2.utils.get_href_parts() const mo = this.match_current_url(href_parts) const region = mo[1] this.set_param_value('region', region) const city = mo[2] this.set_param_value('city', city) const suburb = mo[3] this.set_param_value('suburb', suburb) const slug = mo[4] this.set_param_value('slug', slug) var_business_slug = slug const querystring = href_parts[3] const qd = rh2.utils.get_query_dict(querystring) if (qd.ref && qd.ref.length > 0) { this.params.referrer = qd.ref } if (qd.referrer && qd.referrer.length > 0) { this.params.referrer = qd.referrer } if (qd.av_pax && qd.av_pax.length > 0) { var_pax = qd.av_pax[0] } if (qd.av_date && qd.av_date.length > 0) { var_date = qd.av_date[0] } if (qd.special && qd.special.length > 0) { var_special = qd.special[0] } if (!var_special) { let last_promotion_uuid = localStorage.getItem('last_promotion_uuid') if (last_promotion_uuid) { var_special = last_promotion_uuid } } } fragment._render = function() { this.el.innerHTML = '' if (this.fm.is_desktop()) { this.el.classList.add('rh2-fragment-booking-desktop') } else { this.el.classList.add('rh2-fragment-booking-mobile') } this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const full_screen_overlay = this.full_screen_overlay = document.createElement('div') full_screen_overlay.classList.add('rh2-booking-full-screen-overlay') this.el.appendChild(full_screen_overlay) full_screen_overlay.addEventListener('touchbegin', function(e) { e.stopPropagation() }) full_screen_overlay.addEventListener('touchend', function(e) { e.stopPropagation() }) full_screen_overlay.addEventListener('touchmove', function(e) { e.stopPropagation() }) const full_screen_overlay_translucent = this.full_screen_overlay_translucent = document.createElement('div') full_screen_overlay_translucent.classList.add('rh2-booking-full-screen-overlay-translucent') this.el.appendChild(full_screen_overlay_translucent) const page_fw_el = document.createElement('div') page_fw_el.classList.add('rh2-row-fw') this.el.appendChild(page_fw_el) const page_pw_el = this.page_pw_el = document.createElement('div') page_pw_el.classList.add('rh2-row-pw') page_fw_el.appendChild(page_pw_el) this._render_booking_screen() } fragment._render_booking_screen = function() { this.page_pw_el.innerHTML = '' const heading_row = this.heading_row = document.createElement('div') heading_row.classList.add('rh2-booking-heading') heading_row.innerText = 'Book a table at ' this.page_pw_el.appendChild(heading_row) const body_row = document.createElement('div') if (this.fm.is_desktop()) { body_row.classList.add('rh2-booking-body-desktop') } else { body_row.classList.add('rh2-booking-body-mobile') } this.page_pw_el.appendChild(body_row) const left_column = document.createElement('div') if (this.fm.is_desktop()) { left_column.classList.add('rh2-booking-left-column-desktop') } else { left_column.classList.add('rh2-booking-left-column-mobile') } body_row.appendChild(left_column) const middle_column = document.createElement('div') if (this.fm.is_desktop()) { middle_column.classList.add('rh2-booking-middle-column-desktop') } else { middle_column.classList.add('rh2-booking-middle-column-mobile') } body_row.appendChild(middle_column) const right_column = document.createElement('div') if (this.fm.is_desktop()) { right_column.classList.add('rh2-booking-right-column-desktop') } else { right_column.classList.add('rh2-booking-right-column-mobile') } body_row.appendChild(right_column) const pdt_area = this.pdt_area = document.createElement('div') pdt_area.classList.add('rh2-booking-pdt') left_column.appendChild(pdt_area) this.render_pdt_area() const special_area = this.special_area = document.createElement('div') special_area.classList.add('rh2-booking-special-area') if (this.fm.is_desktop()) { right_column.appendChild(special_area) } else { left_column.appendChild(special_area) } { const heading_row = document.createElement('div') if (this.fm.is_desktop()) { heading_row.classList.add('rh2-booking-special-heading-row') } else { heading_row.classList.add('rh2-booking-special-heading-row-mobile') } heading_row.innerText = 'Select specials that are of interest' special_area.appendChild(heading_row) } const special_dish_section = this.special_dish_section = document.createElement('div') special_area.appendChild(special_dish_section) const special_regular_section = this.special_regular_section = document.createElement('div') special_area.appendChild(special_regular_section) const special_conditions_section = this.special_conditions_section = document.createElement('div') special_conditions_section.classList.add('rh2-booking-special-conditions') special_area.appendChild(special_conditions_section) const stripe_area = document.createElement('div') stripe_area.classList.add('rh2-booking-stripe-area') if (this.fm.is_desktop()) { right_column.appendChild(stripe_area) } else { left_column.appendChild(stripe_area) } const stripe_title = document.createElement('div') stripe_title.classList.add('rh2-booking-stripe-title') stripe_title.innerText = '' stripe_area.appendChild(stripe_title) const stripe_form = document.createElement('div') stripe_form.classList.add('rh2-booking-stripe-form') stripe_area.appendChild(stripe_form) const stripe_form_payment = document.createElement('div') stripe_form_payment.classList.add('rh2-booking-stripe-form-payment') stripe_form.appendChild(stripe_form_payment) const stripe_form_msg = document.createElement('div') stripe_form_msg.classList.add('rh2-booking-stripe-msg') stripe_form.appendChild(stripe_form_msg) this.init_stripe_form() const details_area = this.details_area = document.createElement('div') details_area.classList.add('rh2-booking-details-area') left_column.appendChild(details_area) this.render_details_area() const options_area = this.options_area = document.createElement('div') options_area.classList.add('rh2-booking-options-area') left_column.appendChild(options_area) const confirm_area_fw = document.createElement('div') confirm_area_fw.classList.add('rh2-row-fw') if (this.fm.is_desktop()) { confirm_area_fw.classList.add('rh2-booking-confirm-area-fw-desktop') } else { confirm_area_fw.classList.add('rh2-booking-confirm-area-fw-mobile') } this.page_pw_el.appendChild(confirm_area_fw) const confirm_area_pw = this.confirm_area_pw = document.createElement('div') confirm_area_pw.classList.add('rh2-row-pw') if (this.fm.is_desktop()) { confirm_area_pw.classList.add('rh2-booking-confirm-area-pw-desktop') } else { confirm_area_pw.classList.add('rh2-booking-confirm-area-pw-mobile') } confirm_area_fw.appendChild(confirm_area_pw) this.render_confirm_area() rh2.Booking.call_service_initial(this.params.slug, function(resp) { const data = resp.data today = data.today business_setup = data.setup let is_pax_valid = false for (let option of business_setup.pax_options) { if (var_pax == option.value) { is_pax_valid = true } } if (is_pax_valid == false) { for (let option of business_setup.pax_options) { var_pax = option.value break } this.render_pdt_area() } this.render_options_area() const info = data.info business_info.name = info.name business_info.logo_image_url = info.logo_image_url this.heading_row.innerText = 'Book a table at ' + resp.data.info.name if (var_date == null) { // just to load promotions rh2.Booking.call_service_times(var_business_slug, var_pax, today, null, false, function(resp) { var_times = resp.data.times var_is_closed = var_times.is_closed var_promotions = resp.data.promotions var_rota_messages = resp.data.rota_messages this.open_date_dialogue() }.bind(this)) } else { rh2.Booking.call_service_times(var_business_slug, var_pax, var_date, this.grid_el, false, function(resp) { var_times = resp.data.times var_is_closed = var_times.is_closed var_promotions = resp.data.promotions var_rota_messages = resp.data.rota_messages this.render_grid() this.display_rota_messages() }.bind(this)) } }.bind(this)) this.update_confirm_button() rh2.Booking.fire_event_add_to_cart(var_pax) } fragment.render_pdt_area = function() { const area = this.pdt_area area.innerHTML = '' session_buttons = [] const pdt_overlay = document.createElement('div') pdt_overlay.classList.add('rh2-booking-pax-overlay') pdt_overlay.addEventListener('click', function(e) { pdt_overlay.classList.remove('rh2-booking-pax-overlay-active') }) area.appendChild(pdt_overlay) const pdt_bar = document.createElement('div') pdt_bar.classList.add('rh2-booking-pdt-bar') area.appendChild(pdt_bar) const date_note_row = document.createElement('div') date_note_row.classList.add('rh2-booking-pdt-date-note-row') area.appendChild(date_note_row) const pdt_pax_col = document.createElement('div') pdt_pax_col.classList.add('rh2-booking-pdt-pax-col') pdt_bar.appendChild(pdt_pax_col) const pdt_pax_icon = document.createElement('div') pdt_pax_icon.classList.add('rh2-booking-pdt-pax-icon') pdt_pax_col.appendChild(pdt_pax_icon) const pdt_pax_span = document.createElement('div') pdt_pax_span.classList.add('rh2-booking-pdt-pax-span') pdt_pax_span.innerText = var_pax pdt_pax_col.appendChild(pdt_pax_span) pdt_pax_col.addEventListener('click', function(e) { pdt_overlay.classList.add('rh2-booking-pax-overlay-active') pdt_overlay.innerHTML = '' const pdt_overlay_content_area = document.createElement('div') pdt_overlay_content_area.classList.add('rh2-booking-pax-overlay-content-area') pdt_overlay_content_area.classList.add('rh2-booking-pax-overlay-content-area-pax') pdt_overlay_content_area.addEventListener('click', function(e) { e.stopPropagation() }) pdt_overlay.appendChild(pdt_overlay_content_area) let selected_row = null const options = business_setup.pax_options for (let i = 0; i < options.length; i++) { const option = options[i] const value = option.value const is_selected = option.is_selected const pax_row = document.createElement('div') pax_row.classList.add('rh2-booking-overlay-pax-row') if (var_pax != null && value == var_pax) { pax_row.classList.add('rh2-booking-overlay-pax-row-selected') selected_row = pax_row } pax_row.innerText = value pax_row.addEventListener('click', function() { pdt_overlay.classList.remove('rh2-booking-pax-overlay-active') var_pax = value this.update_stripe_amount(var_pax) pdt_pax_span.innerText = var_pax rh2.Booking.call_service_times(var_business_slug, var_pax, var_date, this.grid_el, false, function(resp) { var_times = resp.data.times var_is_closed = var_times.is_closed var_promotions = resp.data.promotions var_rota_messages = resp.data.rota_messages this.render_grid() }.bind(this)) }.bind(this)) pdt_overlay_content_area.appendChild(pax_row) } if (selected_row != null) { const offset_top = selected_row.offsetTop const scroll_top = Math.max(offset_top - 96, 0) pdt_overlay_content_area.scrollTop = scroll_top } }.bind(this)) const pdt_date_col = document.createElement('div') pdt_date_col.classList.add('rh2-booking-pdt-date-col') pdt_bar.appendChild(pdt_date_col) const pdt_date_icon = document.createElement('div') pdt_date_icon.classList.add('rh2-booking-pdt-date-icon') pdt_date_col.appendChild(pdt_date_icon) const pdt_date_span = document.createElement('div') pdt_date_span.classList.add('rh2-booking-pdt-date-span') pdt_date_span.innerText = rh2.utils.repr_date(var_date || today) pdt_date_col.appendChild(pdt_date_span) pdt_date_col.addEventListener('click', function(e) { this.open_date_dialogue() }.bind(this)) const session_row = document.createElement('div') session_row.classList.add('rh2-booking-pdt-session-row') area.appendChild(session_row) const session_values = [ 'Breakfast', 'Lunch', 'Dinner', ] for (let i = 0; i < session_values.length; i++) { const session_value = session_values[i] const session_item = document.createElement('div') session_item.classList.add('rh2-booking-pdt-session-row-item') session_item.innerText = session_value session_item.addEventListener('click', function(e) { var_session_to_show = i this.show_session() }.bind(this)) session_row.appendChild(session_item) session_buttons.push(session_item) } const grid_el = this.grid_el = document.createElement('div') grid_el.classList.add('rh2-booking-pdt-grid') const loader_gif = this.loader_gif_el = el('span') loader_gif.classList.add('rh2-booking-confirm-loader') loader_gif.style.display = 'block' loader_gif.style.margin = '20px auto' grid_el.appendChild(loader_gif) area.appendChild(grid_el) const time_note_row = document.createElement('div') time_note_row.classList.add('rh2-booking-pdt-time-note-row') area.appendChild(time_note_row) return area } fragment.show_session = function() { for (let i = 0; i < session_buttons.length; i++) { const session_button = session_buttons[i] if (i == var_session_to_show) { session_button.classList.add('rh2-booking-pdt-session-row-item-showing') } else { session_button.classList.remove('rh2-booking-pdt-session-row-item-showing') } } this.render_grid(true) this.display_rota_messages() } fragment.render_grid = function(called_by_show_session) { this.grid_el.innerHTML = '' let preferred_slot = null if (var_time) { for (let i = 0; i < var_times.slots.length; i++) { const slot = var_times.slots[i] if (!slot.av) { continue } if (slot.h == var_time.h && slot.m == var_time.m) { preferred_slot = slot break } } } if (var_times && preferred_slot == null && var_special) { for (let slot of var_times.slots) { if (!slot.av) { continue } if (slot.promotions.indexOf(var_special) > -1) { preferred_slot = slot break } } } if (var_times && preferred_slot == null) { for (let i = 0; i < var_times.slots.length; i++) { const slot = var_times.slots[i] if (!slot.av) { continue } if (!preferred_slot) { preferred_slot = slot } // prioritize Dinner, if available if (slot.h >= 15) { preferred_slot = slot break } } } if (!called_by_show_session) { if (preferred_slot != null) { if (preferred_slot.h < 11) { var_session_to_show = 0 } else if (preferred_slot.h < 15) { var_session_to_show = 1 } else { var_session_to_show = 2 } this.show_session() return } } var_time = preferred_slot let has_selected = false let button_slot_ar = [] for (let slot of var_times.slots) { if (slot.av != true) { continue } if (var_session_to_show == 0) { if (slot.h >= 11) { continue } } else if (var_session_to_show == 1) { if (slot.h < 11 || slot.h >= 15) { continue } } else { if (slot.h < 15) { continue } } const timestr = rh2.utils.format_time_24(slot) const is_available = slot.av let has_promotions = false let has_promotions_hd = false for (let pid of slot.promotions) { let promo = var_promotions.find(p => (p.uuid == pid)) if (promo) { if (promo.structure == 'TABLE_DISCOUNT_HOT_DEAL') { // to show as separate blue star has_promotions_hd = true } else { // any other specials, old pink star has_promotions = true } } } const btn = document.createElement('div') btn.innerText = timestr btn.setAttribute('rh2-bf-timestr', timestr) btn.setAttribute('rh2-bf-av', is_available.toString()) btn.classList.add('rh2-booking-pdt-grid-button') if (preferred_slot != null && slot.h == preferred_slot.h && slot.m == preferred_slot.m) { btn.classList.add('rh2-booking-pdt-grid-button-selected') // this.render_special_area() has_selected = true } if (!is_available) { btn.classList.add('rh2-booking-pdt-grid-button-unavailable') } else { btn.classList.add('rh2-booking-pdt-grid-button-available') btn.addEventListener('click', function(e) { var_time = slot this.render_grid() // this.render_special_area() this.update_confirm_button() }.bind(this)) } if (has_promotions) { const star = document.createElement('div') star.classList.add('rh2-booking-pdt-grid-button-star') btn.appendChild(star) } if (has_promotions_hd) { const star = document.createElement('div') star.classList.add('rh2-booking-pdt-grid-button-star-hd') btn.appendChild(star) } this.grid_el.appendChild(btn) button_slot_ar.push([btn, slot]) } if (!has_selected) { if (button_slot_ar.length > 0) { const tuple = button_slot_ar[0] const button = tuple[0] const slot = tuple[1] button.classList.add('rh2-booking-pdt-grid-button-selected') var_time = slot // this.render_special_area() has_selected = true } } if (button_slot_ar.length == 0) { // this.render_special_area(true) const msg = document.createElement('div') msg.classList.add('rh2-booking-message-row-red') msg.innerText = 'No available time during this session, choose another session if available, or try another day.' if (var_is_closed) { msg.innerText = 'The restaurant is closed on this day. Please choose another date.' } this.grid_el.appendChild(msg) } this.render_special_area() this.update_confirm_button() return } fragment.display_rota_messages = function(av_time) { const date_note_row = document.getElementsByClassName('rh2-booking-pdt-date-note-row')[0] const time_note_row = document.getElementsByClassName('rh2-booking-pdt-time-note-row')[0] date_note_row.innerHTML = '' time_note_row.innerHTML = '' if (var_time) { av_time = var_time.h + (var_time.m / 60) } for (let rota_message of var_rota_messages) { // rota message on whole rota for selected date if (rota_message.rel == 'date') { let p = document.createElement('p') p.innerHTML = rota_message.message date_note_row.appendChild(p) } // session message, depends on selected time if (rota_message.rel == 'time') { if (av_time !== undefined && rota_message.time_start <= av_time && av_time <= rota_message.time_end) { let p = document.createElement('p') p.innerHTML = rota_message.message time_note_row.appendChild(p) } } } } fragment.render_special_area = function(clear_area) { // console.log('render_special_area:', clear_area ? 'clear' : 'no clear') if (var_is_closed) { // this is not very correct but it's the easiest fix // if the restaurant is closed on selected date we should not render specials // otherwise they can appear as available and selectable var_promotions = [] } if (!var_time) { // skip rendering specials if no time selected var_promotions = [] } if (clear_area) { this.special_dish_section.innerHTML = '' this.special_regular_section.innerHTML = '' return } this.special_dish_section.innerHTML = '' this.special_regular_section.innerHTML = '' let selected_uuid = null // +1 additional iteration is for default option: Regular booking for (let i = 0; i < var_promotions.length + 1; i++) { let promotion = var_promotions[i] || null; let available_on_time = false if (promotion && var_time.promotions.indexOf(promotion.uuid) > -1) { available_on_time = true } let unavail_reason = null if (var_time) { for (let unavail of var_time.promotions_unavail) { if (promotion && promotion.uuid == unavail.uuid) { unavail_reason = unavail.reason } } } const row = document.createElement('div') row.classList.add('rh2-booking-special-item') const control_el = document.createElement('input') row.appendChild(control_el) const star_el = document.createElement('div') row.appendChild(star_el) const title_el = document.createElement('div') row.appendChild(title_el) if (promotion) { if (!promotion.is_active) { continue } row.setAttribute('rh2-booking-promotion-uuid', promotion.uuid) let promotion_title = rh2.Promotion.get_promotion_title(promotion) if (!available_on_time) { row.classList.add('rh2-booking-special-item-inactive') } else { if (promotion.uuid === var_special) { selected_uuid = var_special var_promotion = promotion control_el.checked = true this.show_conditions(promotion) if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { this.toggle_stripe_form(true) } } } control_el.classList.add('rh2-booking-special-item-control') if (promotion.structure.indexOf('DISH_') == 0) { control_el.setAttribute('type', 'checkbox') } else { control_el.setAttribute('type', 'radio') } let star_class = (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') ? 'rh2-booking-special-item-star-hd' : 'rh2-booking-special-item-star' star_el.classList.add(star_class) title_el.classList.add('rh2-booking-special-item-title') title_el.innerText = promotion_title if (unavail_reason > '') { const reason_el = document.createElement('div') reason_el.classList.add('rh2-booking-special-unavail-reason') const reason_icon = document.createElement('div') reason_icon.classList.add('reason-icon') reason_icon.title = unavail_reason reason_el.appendChild(reason_icon) row.appendChild(reason_el) let lock_event = false reason_icon.addEventListener('click', () => { if (lock_event) { // prevent repeated clicks return } lock_event = true title_el.innerText = unavail_reason title_el.style.color = 'black' row.style.opacity = 1 setTimeout(() => { lock_event = false title_el.innerText = promotion_title title_el.style.color = '' row.style.opacity = '' }, 2500) }) } this.special_dish_section.appendChild(row) } // default option: Regular Booking if (i == var_promotions.length) { row.classList.add('rh2-booking-special-item') row.classList.add('rh2-booking-special-item-regular') control_el.classList.add('rh2-booking-special-item-control') control_el.setAttribute('type', 'radio') title_el.classList.add('rh2-booking-special-item-title') title_el.innerText = 'Regular booking' this.special_regular_section.appendChild(row) if (selected_uuid == null) { control_el.checked = true this.show_conditions(false) this.toggle_stripe_form(false) } } control_el.addEventListener('click', function(e) { e.stopPropagation() if (row.classList.contains('rh2-booking-special-item-inactive')) { e.preventDefault() return } if (i < var_promotions.length) { var_promotion = promotion var_special = promotion.uuid localStorage.setItem('last_promotion_uuid', var_special) this.show_conditions(promotion) if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { // toggle stripe form and update amount this.toggle_stripe_form(true) this.update_stripe_amount(var_pax) } if (['TABLE_DISCOUNT_RECURRING', 'TABLE_DISCOUNT_HOT_DEAL'].indexOf(promotion.structure) > -1) { const rows = this.special_area.getElementsByClassName('rh2-booking-special-item') for (let j = 0; j < rows.length; j++) { const _row = rows[j] if (_row != row) { const control = _row.getElementsByTagName('input')[0] control.checked = false } } if (promotion.structure !== 'TABLE_DISCOUNT_HOT_DEAL') { this.toggle_stripe_form(false) } } else if (promotion.structure.indexOf('DISH_') == 0) { this.toggle_stripe_form(false) const rows = this.special_area.getElementsByClassName('rh2-booking-special-item') let is_any_dish_special_selected = false is_any_dish_special_selected = is_any_dish_special_selected || control_el.checked for (let j = 0; j < rows.length; j++) { const _row = rows[j] if (_row != row) { const control = _row.getElementsByTagName('input')[0] if (control.getAttribute('type') != 'checkbox') { control.checked = false } else { is_any_dish_special_selected = is_any_dish_special_selected || control.checked } } } if (is_any_dish_special_selected == false) { const _row = rows[rows.length - 1] const control = _row.getElementsByTagName('input')[0] control.checked = true this.show_conditions(false) } } } else { // Regular booking (no special selected) this.toggle_stripe_form(false) this.show_conditions(false) const rows = this.special_area.getElementsByClassName('rh2-booking-special-item') for (let j = 0; j < rows.length; j++) { const _row = rows[j] if (_row != row) { const control = _row.getElementsByTagName('input')[0] control.checked = false var_promotion = null var_special = null localStorage.setItem('last_promotion_uuid', null) } } } }.bind(this)) row.addEventListener('click', function(e) { e.stopPropagation() control_el.click() }.bind(this)) } } fragment.show_conditions = function(promotion) { this.special_conditions_section.innerHTML = '' if (!promotion) { // do not render anything return } const row_condition_title = document.createElement('div') row_condition_title.classList.add('bold') row_condition_title.innerText = 'Terms & Conditions' this.special_conditions_section.appendChild(row_condition_title) const row_condition_list = document.createElement('ul') this.special_conditions_section.appendChild(row_condition_list) const row_condition_0 = document.createElement('li') row_condition_0.innerHTML = "Not to be used in conjunction with any other offer." row_condition_list.appendChild(row_condition_0) const row_condition_01 = document.createElement('li') row_condition_01.innerHTML = "Excludes public holidays and special dates." row_condition_list.appendChild(row_condition_01) if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { const row_condition_02 = document.createElement('li') row_condition_02.innerHTML = "Booking Fee is non refundable." row_condition_list.appendChild(row_condition_02) } const row_condition_03 = document.createElement('li') row_condition_01.innerHTML = 'Dine-in ONLY. Booking is essential' row_condition_list.appendChild(row_condition_01) if (promotion.value_str_1) { const row_condition_1 = document.createElement('li') row_condition_1.innerText = promotion['value_str_1'] row_condition_list.appendChild(row_condition_1) } if (promotion.value_str_2) { const row_condition_2 = document.createElement('li') row_condition_2.innerText = promotion['value_str_2'] row_condition_list.appendChild(row_condition_2) } } fragment.init_stripe_form = async function() { let stripe_loaded = await rh2.utils.wait_objects(['Stripe'], 15000) if (!stripe_loaded) { console.error('Stripe main script load failed after 6 seconds') return } stripe = Stripe(window.rh2.config.stripe_public_key) // stripe amount in cents (x100), $2.50 = 250, $5.00 = 500 let stripe_amount = 500 await initialize() let show_form = false if (var_special && var_promotion) { for (let promotion of var_promotions) { if (promotion.uuid == var_special && promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { show_form = true break } } } this.toggle_stripe_form(show_form) // Fetches a payment intent and captures the client secret async function initialize() { const appearance = { theme: 'flat', variables: { colorPrimary: '#ec5809', colorBackground: '#ffffff', colorText: '#000000', }, } const options = { mode: 'payment', amount: stripe_amount, currency: 'nzd', // Fully customizable with appearance API. appearance: appearance, } // Set up Stripe.js and Elements to use in checkout form stripe_elements = stripe.elements(options) // Create and mount the Payment Element const paymentElementOptions = { layout: 'tabs', terms: { card: 'always' }, fields: { billingDetails: { address: { country: 'never' } } } } const paymentElement = stripe_elements.create('payment', paymentElementOptions) paymentElement.on('change', (event) => { stripe_form_filled = event.complete fragment.update_confirm_button() }) paymentElement.mount('.rh2-booking-stripe-form-payment') } } fragment.toggle_stripe_form = function(show) { // console.log('toggle_stripe_form:', show ? 'show' : 'hide') const stripe_area_el = document.querySelector('.rh2-booking-stripe-area') const stripe_title_el = document.querySelector('.rh2-booking-stripe-title') if (show) { stripe_form_required = true stripe_area_el.style.display = 'block' const stripe_price = rh2.Promotion.get_price_hd(var_promotion) const stripe_price_total = stripe_price * var_pax const stripe_title = `Selected promotion "${var_promotion.title}" requires payment with a credit card.` + `<br>The total of <span class="bold">$${stripe_price_total} NZD</span> ($${stripe_price} NZD per person) will be charged from your card.` stripe_title_el.innerHTML = stripe_title } else { stripe_form_required = false stripe_area_el.style.display = 'none' stripe_title_el.innerText = '' } } fragment.update_stripe_amount = function(var_pax) { if (!var_promotion || !var_pax) { return null } if (var_promotion.structure !== 'TABLE_DISCOUNT_HOT_DEAL') { return null } const discount = var_promotion.value_int_0 const bd_price = prices_hd[discount] const amount = bd_price * var_pax stripe_elements.update({ amount: amount }) // console.log('stripe payment amount:', amount, 'nzd') return amount } fragment.submit_stripe = async function() { // collect customer info to pass as billing details const name = document.querySelector('.rh2-booking-details-first-name-input').value + ' ' + document.querySelector('.rh2-booking-details-last-name-input').value const email = document.querySelector('.rh2-booking-details-email-address-input').value const phone = document.querySelector('.rh2-booking-details-phone-number-input').value // return false document.querySelector('.rh2-booking-stripe-msg').innerText = '' const submit = await stripe_elements.submit() // console.log('stripe_elements.submit', result) if (submit.error) { return false } const amount = this.update_stripe_amount(var_pax) const payment_intent = await fetch('/rh2/service/booking-form/stripe-payment-intent-post/', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ amount: amount }), }) payment_intent_data = await payment_intent.json() if (payment_intent_data.error) { return false } // console.log('payment_intent_data', payment_intent_data) const client_secret = payment_intent_data.client_secret const confirm = await stripe.confirmPayment({ elements: stripe_elements, clientSecret: client_secret, confirmParams: { return_url: document.location.href, payment_method_data: { billing_details: { name: name, email: email, phone: phone, address: { country: 'NZ' } } } }, redirect: 'if_required', }) // console.log('stripe.confirmPayment', confirm) if (confirm.error) { document.querySelector('.rh2-booking-stripe-msg').innerText = confirm.error.message console.error(confirm.error) return false } if (confirm.paymentIntent.status !== 'succeeded') { console.error('stripe.confirmPayment failed') return false } return true } fragment.render_details_area = async function() { const area = this.details_area const user_account = { 'first_name': '', 'last_name': '', 'email_address': '', 'phone_number': '', } const form = document.createElement('form') area.appendChild(form) const name_row = document.createElement('div') name_row.classList.add('rh2-booking-details-name-row') form.appendChild(name_row) { const first_name_col = document.createElement('div') first_name_col.classList.add('rh2-booking-details-first-name-col') name_row.appendChild(first_name_col) const label_row = document.createElement('div') label_row.classList.add('rh2-booking-details-label-row') label_row.innerText = 'First name' first_name_col.appendChild(label_row) const first_name_input = this.first_name_input = document.createElement('input') first_name_input.setAttribute('required', true) first_name_input.setAttribute('name', 'first_name') first_name_input.classList.add('rh2-booking-text-input') first_name_input.classList.add('rh2-booking-details-first-name-input') first_name_input.value = user_account.first_name first_name_input.addEventListener('keyup', function() { this.update_confirm_button() }.bind(this)) first_name_col.appendChild(first_name_input) } { const last_name_col = document.createElement('div') last_name_col.classList.add('rh2-booking-details-last-name-col') name_row.appendChild(last_name_col) const label_row = document.createElement('div') label_row.classList.add('rh2-booking-details-label-row') label_row.innerText = 'Last name' last_name_col.appendChild(label_row) const last_name_input = this.last_name_input = document.createElement('input') last_name_input.setAttribute('required', true) last_name_input.setAttribute('name', 'last_name') last_name_input.classList.add('rh2-booking-text-input') last_name_input.classList.add('rh2-booking-details-last-name-input') last_name_input.value = user_account.last_name last_name_input.addEventListener('keyup', function() { this.update_confirm_button() }.bind(this)) last_name_col.appendChild(last_name_input) } { const label_row = document.createElement('div') label_row.classList.add('rh2-booking-details-label-row') label_row.innerText = 'Email address' form.appendChild(label_row) } const email_address_input = this.email_address_input = document.createElement('input') email_address_input.setAttribute('required', true) email_address_input.setAttribute('name', 'email_address') email_address_input.classList.add('rh2-booking-text-input') email_address_input.classList.add('rh2-booking-details-email-address-input') email_address_input.setAttribute('type', 'email') email_address_input.value = user_account.email_address email_address_input.addEventListener('keyup', function() { this.update_confirm_button() }.bind(this)) form.appendChild(email_address_input) { const label_row = document.createElement('div') label_row.classList.add('rh2-booking-details-label-row') label_row.innerText = 'Phone number' form.appendChild(label_row) } const phone_number_input = this.phone_number_input = document.createElement('input') phone_number_input.setAttribute('required', true) phone_number_input.setAttribute('inputmode', 'numeric') phone_number_input.setAttribute('name', 'phone_number') phone_number_input.classList.add('rh2-booking-text-input') phone_number_input.classList.add('rh2-booking-details-phone-number-input') phone_number_input.value = user_account.phone_number phone_number_input.addEventListener('keyup', function(e) { const cleaned = e.target.value.replace(/[^\d\+]/g, '') e.target.value = cleaned this.update_confirm_button() }.bind(this)) form.appendChild(phone_number_input) { const label_row = document.createElement('div') label_row.classList.add('rh2-booking-details-label-row') label_row.innerText = 'Booking notes (optional)' form.appendChild(label_row) } const notes_input = this.booking_notes_input = document.createElement('textarea') notes_input.setAttribute('name', 'booking_notes') notes_input.setAttribute('rows', 6) notes_input.setAttribute('maxlength', 500) notes_input.classList.add('rh2-booking-text-input') notes_input.classList.add('rh2-booking-notes-input') form.appendChild(notes_input) const user_response = await fetch('/rh2/service/account/details-get/') const user = await user_response.json() if (user && user.data) { this.first_name_input.value = user.data.first_name this.last_name_input.value = user.data.last_name this.email_address_input.value = user.data.email_address this.phone_number_input.value = user.data.phone_number } return area } fragment.render_options_area = function() { const area = this.options_area area.innerHTML = '' const heading_el = document.createElement('div') heading_el.classList.add('rh2-booking-options-area-heading') heading_el.innerText = 'Options' area.appendChild(heading_el) const book_options_area = this.book_options_area = document.createElement('div') area.appendChild(book_options_area) const guest_options_area = this.guest_options_area = document.createElement('div') area.appendChild(guest_options_area) for (let i = 0; i < business_setup.book_options.length; i++) { const option = business_setup.book_options[i] if (option.type == 'checkbox') { const row = document.createElement('div') row.classList.add('rh2-booking-options-row') book_options_area.appendChild(row) const input = document.createElement('input') input.setAttribute('type', 'checkbox') input.setAttribute('name', option.label) input.value = option.uid book_option_inputs.push(input) if (option.default_value == true) { input.checked = true } if (option.values.indexOf(false) == -1) { input.setAttribute('disabled', true) } const label = document.createElement('label') label.appendChild(input) const span = document.createElement('span') span.innerText = option.label label.appendChild(span) row.appendChild(label) } } for (let i = 0; i < business_setup.guest_options.length; i++) { const option = business_setup.guest_options[i] if (option.type == 'checkbox') { const row = document.createElement('div') row.classList.add('rh2-booking-options-row') guest_options_area.appendChild(row) const input = document.createElement('input') input.setAttribute('type', 'checkbox') input.setAttribute('name', option.label) input.value = option.uid guest_option_inputs.push(input) if (option.default_value == true) { input.checked = true } if (option.values.indexOf(false) == -1) { input.setAttribute('disabled', true) } const label = document.createElement('label') label.appendChild(input) const span = document.createElement('span') span.innerText = option.label label.appendChild(span) row.appendChild(label) } } if (book_option_inputs.length == 0 && guest_option_inputs.length == 0) { area.innerHTML = '' } return area } fragment.render_confirm_area = function() { const area = this.confirm_area_pw const agree_row = document.createElement('div') if (this.fm.is_desktop()) { agree_row.classList.add('rh2-booking-confirm-area-agree-row-desktop') } else { agree_row.classList.add('rh2-booking-confirm-area-agree-row-mobile') } area.appendChild(agree_row) { const subscribe_row = document.createElement('div') subscribe_row.classList.add('rh2-booking-confirm-area-subscribe-row') agree_row.appendChild(subscribe_row) const label = document.createElement('label') subscribe_row.appendChild(label) subscribe_input = this.subscribe_input = document.createElement('input') subscribe_input.setAttribute('type', 'checkbox') subscribe_input.setAttribute('checked', 'true') subscribe_input.addEventListener('change', function(e) { this.update_confirm_button() }.bind(this)) label.appendChild(subscribe_input) const subscribe_text_0 = document.createElement('span') subscribe_text_0.innerText = "Subscribe to our newsletters for latest news and offers of NZ's best restaurants" label.appendChild(subscribe_text_0) } { const agreement_row = document.createElement('div') agreement_row.classList.add('rh2-booking-confirm-area-agreement-row') agree_row.appendChild(agreement_row) const label = document.createElement('label') agreement_row.appendChild(label) agreement_input = this.agreement_input = document.createElement('input') agreement_input.setAttribute('type', 'checkbox') agreement_input.setAttribute('checked', 'true') agreement_input.addEventListener('change', function() { this.update_confirm_button() }.bind(this)) label.appendChild(agreement_input) const agreement_text_0 = document.createElement('span') agreement_text_0.innerText = 'To complete the booking you agree to our ' label.appendChild(agreement_text_0) const agreement_link_0 = document.createElement('a') agreement_link_0.setAttribute('target', '_blank') agreement_link_0.setAttribute('href', 'https://www.restauranthub.co.nz/terms-and-conditions') agreement_link_0.innerText = 'Terms and Conditions' label.appendChild(agreement_link_0) const agreement_text_1 = document.createElement('span') agreement_text_1.innerText = ' and ' label.appendChild(agreement_text_1) const agreement_link_1 = document.createElement('a') agreement_link_1.setAttribute('target', '_blank') agreement_link_1.setAttribute('href', 'https://www.restauranthub.co.nz/privacy-policy') agreement_link_1.innerText = 'Privacy Policy' label.appendChild(agreement_link_1) } const confirm_row = document.createElement('div') if (this.fm.is_desktop()) { confirm_row.classList.add('rh2-booking-confirm-area-confirm-row-desktop') } else { confirm_row.classList.add('rh2-booking-confirm-area-confirm-row-mobile') } area.appendChild(confirm_row) const confirm_loader = document.createElement('span') confirm_loader.classList.add('rh2-booking-confirm-loader') confirm_loader.innerHTML = ' ' confirm_row.appendChild(confirm_loader) const confirm_button = this.confirm_button = document.createElement('div') confirm_button.classList.add('rh2-booking-confirm-button') confirm_button.innerText = 'Confirm Booking' confirm_row.appendChild(confirm_button) confirm_button.addEventListener('click', async function() { if (this.confirm_button.classList.contains('rh2-booking-confirm-button-disabled')) { return } this.confirm_button.classList.add('rh2-booking-confirm-button-disabled') confirm_loader.style.display = 'inline-block' if (stripe_form_required) { let submit_stripe = await fragment.submit_stripe() if (!submit_stripe) { this.confirm_button.classList.remove('rh2-booking-confirm-button-disabled') confirm_loader.style.display = 'none' return } } var_first_name = this.first_name_input.value var_last_name = this.last_name_input.value var_email_address = this.email_address_input.value var_phone_number = this.phone_number_input.value var_booking_notes = this.booking_notes_input.value const to_subscribe = this.subscribe_input.checked const promotions = [] const rows = this.special_area.getElementsByClassName('rh2-booking-special-item') for (let j = 0; j < rows.length; j++) { const row = rows[j] const control = row.getElementsByTagName('input')[0] if (control.checked) { let promotion_uuid = row.getAttribute('rh2-booking-promotion-uuid') promotions.push(promotion_uuid) } } const book_option_matrix = [] { for (let i = 0; i < book_option_inputs.length; i++) { const input = book_option_inputs[i] book_option_matrix.push([input.value, input.checked, input.getAttribute('name')]) } } const guest_option_matrix = [] { for (let i = 0; i < guest_option_inputs.length; i++) { const input = guest_option_inputs[i] guest_option_matrix.push([input.value, input.checked, input.getAttribute('name')]) } } rh2.Booking.call_service_reserve( var_business_slug, var_pax, var_date, var_time, var_first_name, var_last_name, var_email_address, var_phone_number, to_subscribe, promotions, book_option_matrix, guest_option_matrix, var_booking_notes, this.get_param_value('referrer'), function(resp) { rh2.Booking.fire_event_purchase(var_pax, var_br_rh_uuid, var_business_slug, resp.data) this._render_result_screen(resp) }.bind(this), function() { this._render_result_screen(resp) }.bind(this), ) }.bind(this)) } fragment.load = function() { let slug = this.get_param_value('slug') if (slug == undefined) { return } } fragment.update_confirm_button = function() { let is_active = true if (var_time == null) { is_active = false } if (var_date == null) { is_active = false } if (!this.agreement_input.checked) { is_active = false } if (this.first_name_input.value == '') { is_active = false } if (this.last_name_input.value == '') { is_active = false } if (!rh2.utils.is_email_address_valid(this.email_address_input.value)) { is_active = false } if (!rh2.utils.is_phone_number_valid(this.phone_number_input.value)) { is_active = false } if (stripe_form_required && !stripe_form_filled) { is_active = false } if (is_active == true) { this.confirm_button.classList.remove('rh2-booking-confirm-button-disabled') } else { this.confirm_button.classList.add('rh2-booking-confirm-button-disabled') } } fragment.open_date_dialogue = function() { this.full_screen_overlay_translucent.innerHTML = '' this.full_screen_overlay_translucent.classList.add('rh2-booking-full-screen-overlay-translucent-active') this.full_screen_overlay_translucent.addEventListener('click', function(e) { this.full_screen_overlay_translucent.classList.remove('rh2-booking-full-screen-overlay-translucent-active') }.bind(this)) const cfg = { 'business_slug': var_business_slug, 'date': var_date, 'pax': var_pax, 'special': null, 'fm': this.fm, 'continue': function(data) { var_date = data.date var_pax = data.pax this.full_screen_overlay_translucent.classList.remove('rh2-booking-full-screen-overlay-translucent-active') this.render_pdt_area() rh2.Booking.call_service_times(var_business_slug, var_pax, var_date, this.grid_el, false, function(resp) { var_times = resp.data.times var_is_closed = var_times.is_closed var_promotions = resp.data.promotions var_rota_messages = resp.data.rota_messages var_session_to_show = null this.render_grid() this.display_rota_messages() }.bind(this)) }.bind(this) } const dialogue_container = rh2.Booking.render_calendar_view(cfg) document.querySelector('.rh2-booking-full-screen-overlay-translucent').appendChild(dialogue_container) } fragment._render_result_screen = function(resp) { this.page_pw_el.innerHTML = '' if (resp) { // after booking if (resp.errcode == 0) { cc_required = resp.data.cc_required || null EF.conversion({ offer_id: 3, amount: var_pax, }) if (cc_required) { if (stripe_form_required) { // display notice in modal dialog, redirect to confirm page on close // skip the actual eveve CC form, user must confirm using emailed link this.display_email_reminder_dialog(resp.data.booking_details_url) } else { // send to eveve CC form document.location.href = resp.data.eveve_ccform_url } } else { // no card required, redirect to confirm page document.location.href = resp.data.booking_details_url } } else { this._render_result_screen_error(resp) } } } fragment.display_email_reminder_dialog = function(redirect_url) { const dialog_el = document.createElement('dialog') dialog_el.classList.add('rh2-booking-email-reminder-dialog') dialog_el.innerHTML = `<p>Reservation created.</p> <p>The restaurant requires to register a credit card to secure your reservation in the event of a no-show.</p> <p>Please check your email and follow the instructions to confirm your reservation.</p> <p class="center"><span class="rh2-booking-email-reminder-dialog-close">Confirm</span></p> ` document.body.appendChild(dialog_el) const dialog_close_el = document.querySelector('.rh2-booking-email-reminder-dialog-close') dialog_close_el.addEventListener('click', function(e) { dialog_el.close() document.location.href = redirect_url }) dialog_el.showModal() } fragment._render_result_screen_error = function(resp) { let message = '' message += 'Error Code: ' + resp.errcode this.page_pw_el.innerHTML = '' const heading_row = this.heading_row = document.createElement('div') heading_row.classList.add('rh2-booking-heading') heading_row.innerText = '' this.page_pw_el.appendChild(heading_row) const body_row = document.createElement('div') body_row.classList.add('rh2-booking-body') this.page_pw_el.appendChild(body_row) const left_column = document.createElement('div') if (this.fm.is_desktop()) { left_column.classList.add('rh2-booking-left-column-desktop') } else { left_column.classList.add('rh2-booking-left-column-mobile') } body_row.appendChild(left_column) const message_label_row = document.createElement('div') message_label_row.classList.add('rh2-booking-result-error-message-label-row') message_label_row.innerText = 'An error has occurred' left_column.appendChild(message_label_row) if (resp) { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-result-error-message-value-row') info_row.classList.add('bold') info_row.innerText = resp.errmsg left_column.appendChild(info_row) } { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-result-error-message-value-row') info_row.innerText = 'We apologize for the inconvenience.' left_column.appendChild(info_row) } { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-result-error-message-value-row') info_row.innerText = 'Please try again later.' left_column.appendChild(info_row) } } fragment._render_stripe_screen = function() { this.page_pw_el.innerHTML = '' const heading_row = this.heading_row = document.createElement('div') heading_row.classList.add('rh2-booking-heading') heading_row.innerText = 'Add a Credit Card' this.page_pw_el.appendChild(heading_row) const body_row = document.createElement('div') body_row.classList.add('rh2-booking-body') this.page_pw_el.appendChild(body_row) const left_column = document.createElement('div') if (this.fm.is_desktop()) { left_column.classList.add('rh2-booking-left-column-desktop') } else { left_column.classList.add('rh2-booking-left-column-mobile') } body_row.appendChild(left_column) { const message_row = document.createElement('p') message_row.classList.add('rh2-booking-message-row') message_row.innerText = 'A credit card is required to secure your reservation.' left_column.appendChild(message_row) } const ccform_iframe = document.createElement('iframe') ccform_iframe.classList.add('rh2-booking-ccform') ccform_iframe.setAttribute('width', '100%') ccform_iframe.setAttribute('height', '350') ccform_iframe.setAttribute('scrolling', 'no') const iframe_src = resp.data.eveve_ccform_url ccform_iframe.setAttribute('src', iframe_src) left_column.appendChild(ccform_iframe) { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-message-row') info_row.innerText = '* Your card details will only be used in exchange for a single-use token, which will then be held by the restaurant.' left_column.appendChild(info_row) } { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-message-row') info_row.innerText = '* The restaurant will only charge you with that token in the event of No-Show.' left_column.appendChild(info_row) } { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-message-row') info_row.innerText = '* If you no longer need the table, please cancel your reservation to avoid penalties. To do that, follow the link in the confirmation email of this reservation.' left_column.appendChild(info_row) } { const info_row = document.createElement('div') info_row.classList.add('rh2-booking-message-row') info_row.innerText = '* Neither Restaurant Hub nor the restaurant stores your credit card details.' left_column.appendChild(info_row) } } })()</script> <script>// #BookingDetails ; (function() { const Fragment = function() {} Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'BookingDetails' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/booking-details/([\\w\\-]+)/?$'), ] for (let i = 0; i < path_re_list.length; i++) { if (path_re_list[i].exec(href_path)) { return true } } return false } fragment.get_current_url = function() { return document.location.pathname } fragment._render = function() { this.el.innerHTML = '' if (this.fm.is_desktop()) { this.el.classList.add('rh2-fragment-booking-desktop') } else { this.el.classList.add('rh2-fragment-booking-mobile') } this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_desktop: true, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const full_screen_overlay = this.full_screen_overlay = document.createElement('div') full_screen_overlay.classList.add('rh2-booking-full-screen-overlay') this.el.appendChild(full_screen_overlay) full_screen_overlay.addEventListener('touchbegin', function(e) { e.stopPropagation() }) full_screen_overlay.addEventListener('touchend', function(e) { e.stopPropagation() }) full_screen_overlay.addEventListener('touchmove', function(e) { e.stopPropagation() }) const full_screen_overlay_translucent = this.full_screen_overlay_translucent = document.createElement('div') full_screen_overlay_translucent.classList.add('rh2-booking-full-screen-overlay-translucent') this.el.appendChild(full_screen_overlay_translucent) const page_fw_el = document.createElement('div') page_fw_el.classList.add('rh2-row-fw') this.el.appendChild(page_fw_el) const page_pw_el = this.page_pw_el = document.createElement('div') page_pw_el.classList.add('rh2-row-pw') page_fw_el.appendChild(page_pw_el) this._render_result_screen_success() } fragment.render_details = function(booking) { } fragment._render_result_screen_success = function() { this.page_pw_el.innerHTML = '' const heading_row = this.heading_row = document.createElement('div') heading_row.classList.add('rh2-booking-heading') heading_row.innerText = '' this.page_pw_el.appendChild(heading_row) const body_row = document.createElement('div') body_row.classList.add('rh2-booking-body') this.page_pw_el.appendChild(body_row) const left_column = document.createElement('div') if (this.fm.is_desktop()) { left_column.classList.add('rh2-booking-left-column-desktop') } else { left_column.classList.add('rh2-booking-left-column-mobile') } body_row.appendChild(left_column) const middle_column = document.createElement('div') if (this.fm.is_desktop()) { middle_column.classList.add('rh2-booking-middle-column-desktop') } else { middle_column.classList.add('rh2-booking-middle-column-mobile') } body_row.appendChild(middle_column) let right_column = document.createElement('div') if (this.fm.is_desktop()) { right_column.classList.add('rh2-booking-right-column-desktop') } else { right_column.classList.add('rh2-booking-right-column-mobile') } body_row.appendChild(right_column) if (this.fm.is_mobile()) { right_column = left_column right_column.classList.add('rh2-booking-result-success-mobile') } const icon_row = document.createElement('div') icon_row.classList.add('rh2-booking-result-success-icon-row') left_column.appendChild(icon_row) const icon = document.createElement('div') icon.classList.add('rh2-booking-result-success-icon') icon_row.appendChild(icon) const title_row = document.createElement('div') title_row.classList.add('rh2-booking-result-success-title-row') title_row.innerText = "Booking Confirmed" left_column.appendChild(title_row) const email_label_row = document.createElement('div') email_label_row.classList.add('rh2-booking-result-success-email-label-row') email_label_row.innerText = "Confirmation email sent to" left_column.appendChild(email_label_row) const email_value_row = document.createElement('div') email_value_row.classList.add('rh2-booking-result-success-email-value-row') email_value_row.innerText = booking_data.email left_column.appendChild(email_value_row) const business_name_row = document.createElement('div') business_name_row.classList.add('rh2-booking-result-success-business-name-row') business_name_row.innerText = booking_data.vendor_name right_column.appendChild(business_name_row) const details_table = document.createElement('table') details_table.classList.add('rh2-booking-result-success-details-table') right_column.appendChild(details_table) { const details_tbody = document.createElement('tbody') details_tbody.classList.add('rh2-booking-result-success-details-tbody') details_table.appendChild(details_tbody) { const tr = document.createElement('tr') tr.classList.add('rh2-booking-result-success-details-tr') details_tbody.appendChild(tr) const th = document.createElement('th') th.classList.add('rh2-booking-result-success-details-th') th.innerText = 'Guests' tr.appendChild(th) const td = document.createElement('td') td.classList.add('rh2-booking-result-success-details-td') td.innerText = booking_data.number_of_people tr.appendChild(td) } { const tr = document.createElement('tr') tr.classList.add('rh2-booking-result-success-details-tr') details_tbody.appendChild(tr) const th = document.createElement('th') th.classList.add('rh2-booking-result-success-details-th') th.innerText = 'Date' tr.appendChild(th) const td = document.createElement('td') td.classList.add('rh2-booking-result-success-details-td') td.innerText = booking_data.booking_date tr.appendChild(td) } { const tr = document.createElement('tr') tr.classList.add('rh2-booking-result-success-details-tr') details_tbody.appendChild(tr) const th = document.createElement('th') th.classList.add('rh2-booking-result-success-details-th') th.innerText = 'Time' tr.appendChild(th) const td = document.createElement('td') td.classList.add('rh2-booking-result-success-details-td') td.innerText = booking_data.booking_time tr.appendChild(td) } } } rh2.fragment_manager.register(fragment) })()</script> <script>// #SpecialItem ; (function() { const Fragment = function() { this.search_params = new Map() } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'SpecialItem' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eats/in-region/([\\w-_]+)/in-city/([\\w-_]+)/in-suburb/([\\w-_]+)/([\\w-_]+)\\/special/([\\w-_]+)/?$'), ] for (let i = 0; i < path_re_list.length; i++) { const mo = path_re_list[i].exec(href_path) if (mo) { return mo } } return false } fragment.get_current_url = function() { return [ "/rh2/eats/in-region/", this.params['region'], "/in-city/", this.params['city'], "/in-suburb/", this.params['suburb'], "/", this.params['slug'], "/", "special/", this.params['special_id'], "/", ].join('') } rh2.fragment_manager.register(fragment) fragment._initialize = function() { if (!this.params.__LANDING__) { return } const href_parts = rh2.utils.get_href_parts() const mo = this.match_current_url(href_parts) const region = mo[1] this.params['region'] = region const city = mo[2] this.params['city'] = city const suburb = mo[3] this.params['suburb'] = suburb const slug = mo[4] this.params['slug'] = [slug] const special_id = mo[5] this.params['special_id'] = [special_id] const querystring = href_parts[3] const qd = rh2.utils.get_query_dict(querystring) if (qd['ref'] && qd['ref'].length > 0) { this.params['referrer'] = qd['ref'] } if (qd['referrer'] && qd['referrer'].length > 0) { this.params['referrer'] = qd['referrer'] } } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-special-item') this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const page_fw_el = document.createElement('div') page_fw_el.classList.add('rh2-row-fw') this.el.appendChild(page_fw_el) const page_pw_el = this.page_pw_el = document.createElement('div') page_pw_el.classList.add('rh2-row-pw') page_fw_el.appendChild(page_pw_el) const heading_row = this.heading_row = document.createElement('div') heading_row.classList.add('rh2-special-item-heading') heading_row.innerText = 'Bookable Special' this.page_pw_el.appendChild(heading_row) if (this.fm.is_mobile()) { heading_row.classList.add('rh2-special-item-heading-mobile') } if (this.fm.is_mobile()) { const section_image = document.createElement('div') section_image.classList.add('rh2-special-item-section-image-mobile') this.page_pw_el.appendChild(section_image) const image = this.image = document.createElement('div') image.classList.add('rh2-special-item-section-image-image') section_image.appendChild(image) } if (this.fm.is_mobile()) { const section_nav = document.createElement('div') section_nav.classList.add('rh2-special-item-section-nav') this.page_pw_el.appendChild(section_nav) const item_special = this.section_nav_item_special = document.createElement('div') item_special.classList.add('rh2-special-item-section-nav-item-special') item_special.innerText = 'Bookable Special' section_nav.appendChild(item_special) item_special.addEventListener('click', function(e) { e.stopPropagation() item_special.classList.add('rh2-special-item-section-nav-item-special-active') item_location.classList.remove('rh2-special-item-section-nav-item-location-active') this.left_column.classList.remove('rh2-special-item-left-column-mobile-hidden') this.right_column.classList.add('rh2-special-item-right-column-mobile-hidden') }.bind(this)) { const padding = document.createElement('div') padding.classList.add('rh2-special-item-section-nav-padding') section_nav.appendChild(padding) } const item_location = this.section_nav_item_location = document.createElement('div') item_location.classList.add('rh2-special-item-section-nav-item-location') item_location.innerText = 'Location' section_nav.appendChild(item_location) item_location.addEventListener('click', function(e) { e.stopPropagation() item_special.classList.remove('rh2-special-item-section-nav-item-special-active') item_location.classList.add('rh2-special-item-section-nav-item-location-active') this.left_column.classList.add('rh2-special-item-left-column-mobile-hidden') this.right_column.classList.remove('rh2-special-item-right-column-mobile-hidden') }.bind(this)) { const padding = document.createElement('div') padding.classList.add('rh2-special-item-section-nav-padding') section_nav.appendChild(padding) } } const body_row = document.createElement('div') body_row.classList.add('rh2-special-item-body') this.page_pw_el.appendChild(body_row) const left_column = this.left_column = document.createElement('div') if (this.fm.is_desktop()) { left_column.classList.add('rh2-special-item-left-column-desktop') } else { left_column.classList.add('rh2-special-item-left-column-mobile') } body_row.appendChild(left_column) const middle_column = document.createElement('div') if (this.fm.is_desktop()) { middle_column.classList.add('rh2-special-item-middle-column-desktop') } else { middle_column.classList.add('rh2-special-item-middle-column-mobile') } body_row.appendChild(middle_column) const right_column = this.right_column = document.createElement('div') if (this.fm.is_desktop()) { right_column.classList.add('rh2-special-item-right-column-desktop') } else { right_column.classList.add('rh2-special-item-right-column-mobile') } body_row.appendChild(right_column) if (this.fm.is_desktop()) { const section_image = document.createElement('div') section_image.classList.add('rh2-special-item-section-image-desktop') this.left_column.appendChild(section_image) const image = this.image = document.createElement('div') image.classList.add('rh2-special-item-section-image-image') section_image.appendChild(image) } const title_row = this.title_row = document.createElement('div') title_row.classList.add('rh2-special-item-title-row') this.left_column.appendChild(title_row) const title_star = this.title_star = document.createElement('div') title_star.classList.add('rh2-special-item-title-star') title_row.appendChild(title_star) const title_text = this.title_text = document.createElement('div') title_text.classList.add('rh2-special-item-title-text') title_row.appendChild(title_text) const description_row = this.description_row = document.createElement('div') description_row.classList.add('rh2-special-item-description-row') this.left_column.appendChild(description_row) const schedule_row = this.schedule_row = document.createElement('div') schedule_row.classList.add('rh2-special-item-schedule-row') this.left_column.appendChild(schedule_row) const condition_row = this.condition_row = document.createElement('div') condition_row.classList.add('rh2-special-item-condition-row') this.left_column.appendChild(condition_row) const guide_row = this.guide_row = document.createElement('div') guide_row.classList.add('rh2-special-item-guide-row') this.left_column.appendChild(guide_row) const guide_title = this.guide_title = document.createElement('div') guide_title.classList.add('rh2-special-item-guide-title') guide_title.innerText = 'How does it work?' guide_row.appendChild(guide_title) { const guide_item = this.guide_item = document.createElement('div') guide_item.classList.add('rh2-special-item-guide-item') guide_item.innerText = "To secure a fantasic restaurant special, click the 'Book Special' button to book a table now." guide_row.appendChild(guide_item) } { const guide_item = this.guide_item = document.createElement('div') guide_item.classList.add('rh2-special-item-guide-item') guide_item.innerText = "You'll receive a table booking confirmation email." guide_row.appendChild(guide_item) } const business_basic_row = this.business_basic_row = document.createElement('div') business_basic_row.classList.add('rh2-special-item-business-basic-row') this.right_column.appendChild(business_basic_row) const business_logo_col = this.business_logo_col = document.createElement('div') business_logo_col.classList.add('rh2-special-item-business-logo-col') business_basic_row.appendChild(business_logo_col) const business_attr_col = this.business_attr_col = document.createElement('div') business_attr_col.classList.add('rh2-special-item-business-attr-col') business_basic_row.appendChild(business_attr_col) const business_title_row = this.business_title_row = document.createElement('a') business_title_row.classList.add('rh2-special-item-business-title-row') business_attr_col.appendChild(business_title_row) const business_cuisine_row = this.business_cuisine_row = document.createElement('div') business_cuisine_row.classList.add('rh2-special-item-business-cuisine-row') business_attr_col.appendChild(business_cuisine_row) const business_review_row = this.business_review_row = document.createElement('div') business_review_row.classList.add('rh2-special-item-business-review-row') business_attr_col.appendChild(business_review_row) const business_photos_row = this.business_photos_row = document.createElement('div') business_photos_row.classList.add('rh2-special-item-business-photos-row') this.right_column.appendChild(business_photos_row) this.business_photos = [] { const item = document.createElement('a') item.classList.add('rh2-special-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-photos-row-item-more') item.innerText = '>' business_photos_row.appendChild(item) this.business_photos.push(item) } const business_section_links_row = this.business_section_links_row = document.createElement('div') business_section_links_row.classList.add('rh2-special-item-business-section-links-row') this.right_column.appendChild(business_section_links_row) this.business_section_links = [] { const item = document.createElement('a') item.classList.add('rh2-special-item-business-section-links-row-item') item.innerText = 'Overview' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-section-links-row-item') item.innerText = 'Menus' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-section-links-row-item') item.innerText = 'Hours' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-section-links-row-item') item.innerText = 'Reviews' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-special-item-business-section-links-row-item') item.innerText = '>' business_section_links_row.appendChild(item) this.business_section_links.push(item) } const business_location_title_row = this.business_location_title_row = document.createElement('div') business_location_title_row.classList.add('rh2-special-item-business-location-title-row') business_location_title_row.innerText = 'Location' this.right_column.appendChild(business_location_title_row) const business_address_row = this.business_address_row = document.createElement('div') business_address_row.classList.add('rh2-special-item-business-address-row') this.right_column.appendChild(business_address_row) const business_map_row = this.business_map_row = document.createElement('div') business_map_row.classList.add('rh2-special-item-business-map-row') this.right_column.appendChild(business_map_row) const business_other_specials_row = this.business_other_specials_row = document.createElement('div') business_other_specials_row.classList.add('rh2-special-item-business-other-specials-row') this.right_column.appendChild(business_other_specials_row) const business_other_specials_title = this.business_other_specials_title = document.createElement('div') business_other_specials_title.classList.add('rh2-special-item-business-other-specials-title') business_other_specials_title.innerText = 'Other Specials' business_other_specials_row.appendChild(business_other_specials_title) const footer = rh2.Footer.build() this.el.appendChild(footer) if (this.fm.is_mobile()) { this.section_nav_item_special.click() } } fragment.load = function() { let promotion_id = this.get_param_value('special_id') if (promotion_id == undefined) { return } rh2.Special.call_service_special_item(promotion_id, function(resp) { const data = resp['data'] const promotion = data['promotion'] this.load_promotion_callback(promotion) }.bind(this)) let url = '/rh2/service/business/business_item_get/' + this.get_param_value('slug') + '/' let xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const data = rtn.data if (rtn.errcode === 404) { window.location.assign('/rh2/generic-404/') return } const business = data this.load_business_callback(business) }.bind(this)) xhr.open("GET", url) xhr.send() } fragment.load_promotion_callback = function(promotion) { const image_url = rh2.Promotion.get_promotion_image_url(promotion) this.image.style['background-image'] = "url('" + image_url + "')" if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { this.title_star.classList.add('hotdeal') } const title = rh2.Promotion.get_promotion_title(promotion) this.title_text.innerText = title this.description_row.innerText = promotion['description'] for (let i = 0; i < promotion['schedules'].length; i++) { const schedule = promotion['schedules'][i] if (schedule['is_active'] != true) { continue } let text = [ schedule['time_begin'].substring(0, 5), ' - ', schedule['time_end'].substring(0, 5), ', ', schedule['date_days_of_week'] ].join('') const item = document.createElement('div') item.classList.add('rh2-special-item-schedule-item') item.innerText = text this.schedule_row.appendChild(item) if (this.fm.is_mobile()) { item.classList.add('rh2-special-item-schedule-item-mobile') } } if (promotion['schedules'].length > 0) { const url = [ "/rh2/eats/in-region/", this.get_param_value('region'), "/in-city/", this.get_param_value('city'), "/in-suburb/", this.get_param_value('suburb'), "/", this.get_param_value('slug'), "/", "booking/", ].join('') const book_button_row = document.createElement('div') book_button_row.classList.add('rh2-special-item-book-button-row') const book_button = document.createElement('a') book_button.classList.add('rh2-special-item-book-button') book_button.innerText = 'Book Special' book_button.setAttribute('href', url) book_button_row.appendChild(book_button) this.schedule_row.appendChild(book_button_row) if (this.fm.is_mobile()) { book_button_row.classList.add('mobile') } } for (let i = 0; i < 3; i++) { let text = promotion['value_str_' + i] if (i == 0) { text = `* Not to be used in conjunction with any other offer.<br> * Excludes public holidays and special dates.<br>` if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { text += '* Booking Fee is non refundable.<br>' } text += '* Dine-in ONLY. Booking is essential.' } if (text != '') { const row = document.createElement('div') row.innerHTML = text this.condition_row.appendChild(row) } } } fragment.load_business_callback = function(business) { this.business_logo_col.style['background-image'] = 'url(' + business['logo_image_url'] + ')' this.business_title_row.innerText = business['name'] this.business_title_row.setAttribute('href', business['item_page_url']) let cuisine_text = business['cuisine_vals'].slice(0, 3).join(' · ') this.business_cuisine_row.innerText = cuisine_text if (business['ta_rating'] && business['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-special-item-business-review-row-review-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + business['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") this.business_review_row.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-special-item-business-review-row-review-number') ta_num_reviews_el.innerText = business['ta_num_reviews'] + ' Reviews' this.business_review_row.appendChild(ta_num_reviews_el) } if (business['price_level']) { const price_el = document.createElement('div') price_el.classList.add('rh2-special-item-business-review-row-price-col') this.business_review_row.appendChild(price_el) const price_level = business['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-special-item-business-review-row-price-col-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-special-item-business-review-row-price-col-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) } for (let i = 0; i < 5; i++) { if (i < 4) { const image = business['images'][i] if (image) { this.business_photos[i].style['background-image'] = 'url(' + image['tile_url'] + ')' } } this.business_photos[i].setAttribute('href', business['item_page_url']) } for (let i = 0; i < 5; i++) { this.business_section_links[i].setAttribute('href', business['item_page_url']) } this.business_address_row.innerText = business['address'] this.business_map_row.setAttribute('data-rh2-special-item-business-map-name', business['name']) this.business_map_row.setAttribute('data-rh2-special-item-business-map-latitude', business['geo_latitude']) this.business_map_row.setAttribute('data-rh2-special-item-business-map-longitude', business['geo_longitude']) this.prepare_map(this.business_map_row) function render_promotion_other(promotion) { if (promotion['is_active'] != true) { return } if (promotion['manifestation'] != 'EVEVE') { return } if (promotion['uuid'] == fragment.get_param_value('special_id')) { return } const title = rh2.Promotion.get_promotion_title(promotion) const url = business['item_page_url'] + 'special/' + promotion['uuid'] + '/' const item = document.createElement('div') item.classList.add('rh2-special-item-business-other-specials-item') item.innerText = title if (promotion.structure == 'TABLE_DISCOUNT_HOT_DEAL') { item.classList.add('hotdeal') } fragment.business_other_specials_row.appendChild(item) const icon = document.createElement('div') icon.classList.add('rh2-special-item-business-other-specials-icon') $(item).prepend(icon) const link = document.createElement('a') link.classList.add('rh2-special-link-business-other-specials-link') link.innerText = 'See details' link.setAttribute('href', url) item.appendChild(link) } for (let promotion of business.specials_hd) { render_promotion_other(promotion) } for (let promotion of business.specials) { render_promotion_other(promotion) } } fragment.prepare_map = async function(map_container_el) { let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } const marker_text = map_container_el.getAttribute('data-rh2-special-item-business-map-name') const latitude = map_container_el.getAttribute('data-rh2-special-item-business-map-latitude') const longitude = map_container_el.getAttribute('data-rh2-special-item-business-map-longitude') if (latitude && longitude && window.google) { const latlon = new google.maps.LatLng(parseFloat(latitude), parseFloat(longitude)) const options = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, center: latlon, mapTypeControl: false, streetViewControl: false, mapId: 'special_item', } const map = new google.maps.Map(map_container_el, options) const marker = new google.maps.marker.AdvancedMarkerElement({ position: latlon, map: map, title: marker_text, }) } else { map_container_el.style['display'] = 'none' } } })()</script> <script>// #CouponItem ; (function() { const Fragment = function() { this.search_params = new Map() this.promotion = null this.business = null } Fragment.prototype = Object.create(rh2.Fragment.prototype) const fragment = new Fragment() fragment.get_name = function() { return 'CouponItem' } fragment.match_current_url = function(href_parts) { const href_path = href_parts[2] const path_re_list = [ new RegExp('^/rh2/eats/in-region/([\\w-_]+)/in-city/([\\w-_]+)/in-suburb/([\\w-_]+)/([\\w-_]+)\\/coupon/([\\w-_]+)/?$'), ] for (let i = 0; i < path_re_list.length; i++) { const mo = path_re_list[i].exec(href_path) if (mo) { return mo } } return false } fragment.get_current_url = function() { return [ "/rh2/eats/in-region/", this.params['region'], "/in-city/", this.params['city'], "/in-suburb/", this.params['suburb'], "/", this.params['slug'], "/", "coupon/", this.params['coupon_id'], "/", ].join('') } rh2.fragment_manager.register(fragment) fragment._initialize = function() { if (!this.params.__LANDING__) { return } const href_parts = rh2.utils.get_href_parts() const mo = this.match_current_url(href_parts) const region = mo[1] this.params['region'] = region const city = mo[2] this.params['city'] = city const suburb = mo[3] this.params['suburb'] = suburb const slug = mo[4] this.params['slug'] = [slug] const coupon_id = mo[5] this.params['coupon_id'] = [coupon_id] const querystring = href_parts[3] const qd = rh2.utils.get_query_dict(querystring) if (qd['ref'] && qd['ref'].length > 0) { this.params['referrer'] = qd['ref'] } if (qd['referrer'] && qd['referrer'].length > 0) { this.params['referrer'] = qd['referrer'] } } fragment._render = function() { this.el.innerHTML = '' this.el.classList.add('rh2-fragment-coupon-item') this.el.classList.add('rh2-fragment-padding-for-appbar-desktop') const appbar = this.appbar = new rh2.AppBar({ f: this, fm: this.fm, hide_search_on_mobile: true, }) const appbar_el = appbar.render() this.el.appendChild(appbar_el) const full_screen_overlay = this.full_screen_overlay = document.createElement('div') full_screen_overlay.classList.add('rh2-full-screen-overlay') this.el.appendChild(full_screen_overlay) const full_screen_overlay_translucent = this.full_screen_overlay_translucent = document.createElement('div') full_screen_overlay_translucent.classList.add('rh2-full-screen-overlay-translucent') this.el.appendChild(full_screen_overlay_translucent) const page_fw_el = document.createElement('div') page_fw_el.classList.add('rh2-row-fw') this.el.appendChild(page_fw_el) const page_pw_el = this.page_pw_el = document.createElement('div') page_pw_el.classList.add('rh2-row-pw') page_fw_el.appendChild(page_pw_el) const heading_row = this.heading_row = document.createElement('div') heading_row.classList.add('rh2-coupon-item-heading') heading_row.innerText = 'Coupon' this.page_pw_el.appendChild(heading_row) if (this.fm.is_mobile()) { heading_row.classList.add('rh2-coupon-item-heading-mobile') } if (this.fm.is_mobile()) { const section_image = document.createElement('div') section_image.classList.add('rh2-coupon-item-section-image-mobile') this.page_pw_el.appendChild(section_image) const image = this.image = document.createElement('div') image.classList.add('rh2-coupon-item-section-image-image') section_image.appendChild(image) } if (this.fm.is_mobile()) { const section_nav = document.createElement('div') section_nav.classList.add('rh2-coupon-item-section-nav') this.page_pw_el.appendChild(section_nav) const item_coupon = this.section_nav_item_coupon = document.createElement('div') item_coupon.classList.add('rh2-coupon-item-section-nav-item-coupon') item_coupon.innerText = 'Coupon' section_nav.appendChild(item_coupon) item_coupon.addEventListener('click', function() { item_coupon.classList.add('rh2-coupon-item-section-nav-item-coupon-active') item_location.classList.remove('rh2-coupon-item-section-nav-item-location-active') this.left_column.classList.remove('rh2-coupon-item-left-column-mobile-hidden') this.right_column.classList.add('rh2-coupon-item-right-column-mobile-hidden') }.bind(this)) { const padding = document.createElement('div') padding.classList.add('rh2-coupon-item-section-nav-padding') section_nav.appendChild(padding) } const item_location = this.section_nav_item_location = document.createElement('div') item_location.classList.add('rh2-coupon-item-section-nav-item-location') item_location.innerText = 'Location' section_nav.appendChild(item_location) item_location.addEventListener('click', function() { item_coupon.classList.remove('rh2-coupon-item-section-nav-item-coupon-active') item_location.classList.add('rh2-coupon-item-section-nav-item-location-active') this.left_column.classList.add('rh2-coupon-item-left-column-mobile-hidden') this.right_column.classList.remove('rh2-coupon-item-right-column-mobile-hidden') }.bind(this)) { const padding = document.createElement('div') padding.classList.add('rh2-coupon-item-section-nav-padding') section_nav.appendChild(padding) } } const body_row = document.createElement('div') body_row.classList.add('rh2-coupon-item-body') this.page_pw_el.appendChild(body_row) const left_column = this.left_column = document.createElement('div') if (this.fm.is_desktop()) { left_column.classList.add('rh2-coupon-item-left-column-desktop') } else { left_column.classList.add('rh2-coupon-item-left-column-mobile') } body_row.appendChild(left_column) const middle_column = document.createElement('div') if (this.fm.is_desktop()) { middle_column.classList.add('rh2-coupon-item-middle-column-desktop') } else { middle_column.classList.add('rh2-coupon-item-middle-column-mobile') } body_row.appendChild(middle_column) const right_column = this.right_column = document.createElement('div') if (this.fm.is_desktop()) { right_column.classList.add('rh2-coupon-item-right-column-desktop') } else { right_column.classList.add('rh2-coupon-item-right-column-mobile') } body_row.appendChild(right_column) if (this.fm.is_desktop()) { const section_image = document.createElement('div') section_image.classList.add('rh2-coupon-item-section-image-desktop') this.left_column.appendChild(section_image) const image = this.image = document.createElement('div') image.classList.add('rh2-coupon-item-section-image-image') section_image.appendChild(image) } const title_row = this.title_row = document.createElement('div') title_row.classList.add('rh2-coupon-item-title-row') this.left_column.appendChild(title_row) const description_row = this.description_row = document.createElement('div') description_row.classList.add('rh2-coupon-item-description-row') this.left_column.appendChild(description_row) const schedule_row = this.schedule_row = document.createElement('div') schedule_row.classList.add('rh2-coupon-item-schedule-row') this.left_column.appendChild(schedule_row) const action_row = this.action_row = document.createElement('div') action_row.classList.add('rh2-coupon-item-action-row') this.left_column.appendChild(action_row) const condition_row = this.condition_row = document.createElement('div') condition_row.classList.add('rh2-coupon-item-condition-row') this.left_column.appendChild(condition_row) const guide_row = this.guide_row = document.createElement('div') guide_row.classList.add('rh2-coupon-item-guide-row') this.left_column.appendChild(guide_row) const guide_title = this.guide_title = document.createElement('div') guide_title.classList.add('rh2-coupon-item-guide-title') guide_title.innerText = 'How does it work?' guide_row.appendChild(guide_title) { const guide_item = this.guide_item = document.createElement('div') guide_item.classList.add('rh2-coupon-item-guide-item') guide_item.innerText = "Claim a FREE Takeaway Coupon" guide_row.appendChild(guide_item) } { const guide_item = this.guide_item = document.createElement('div') guide_item.classList.add('rh2-coupon-item-guide-item') guide_item.innerText = "Show the confirmation email to redeem." guide_row.appendChild(guide_item) } const business_basic_row = this.business_basic_row = document.createElement('div') business_basic_row.classList.add('rh2-coupon-item-business-basic-row') this.right_column.appendChild(business_basic_row) const business_logo_col = this.business_logo_col = document.createElement('div') business_logo_col.classList.add('rh2-coupon-item-business-logo-col') business_basic_row.appendChild(business_logo_col) const business_attr_col = this.business_attr_col = document.createElement('div') business_attr_col.classList.add('rh2-coupon-item-business-attr-col') business_basic_row.appendChild(business_attr_col) const business_title_row = this.business_title_row = document.createElement('a') business_title_row.classList.add('rh2-coupon-item-business-title-row') business_attr_col.appendChild(business_title_row) const business_cuisine_row = this.business_cuisine_row = document.createElement('div') business_cuisine_row.classList.add('rh2-coupon-item-business-cuisine-row') business_attr_col.appendChild(business_cuisine_row) const business_review_row = this.business_review_row = document.createElement('div') business_review_row.classList.add('rh2-coupon-item-business-review-row') business_attr_col.appendChild(business_review_row) const business_photos_row = this.business_photos_row = document.createElement('div') business_photos_row.classList.add('rh2-coupon-item-business-photos-row') this.right_column.appendChild(business_photos_row) this.business_photos = [] { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-photos-row-item') business_photos_row.appendChild(item) this.business_photos.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-photos-row-item-more') item.innerText = '>' business_photos_row.appendChild(item) this.business_photos.push(item) } const business_section_links_row = this.business_section_links_row = document.createElement('div') business_section_links_row.classList.add('rh2-coupon-item-business-section-links-row') this.right_column.appendChild(business_section_links_row) this.business_section_links = [] { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-section-links-row-item') item.innerText = 'Overview' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-section-links-row-item') item.innerText = 'Menus' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-section-links-row-item') item.innerText = 'Hours' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-section-links-row-item') item.innerText = 'Reviews' business_section_links_row.appendChild(item) this.business_section_links.push(item) } { const item = document.createElement('a') item.classList.add('rh2-coupon-item-business-section-links-row-item') item.innerText = '>' business_section_links_row.appendChild(item) this.business_section_links.push(item) } const business_location_title_row = this.business_location_title_row = document.createElement('div') business_location_title_row.classList.add('rh2-coupon-item-business-location-title-row') business_location_title_row.innerText = 'Location' this.right_column.appendChild(business_location_title_row) const business_address_row = this.business_address_row = document.createElement('div') business_address_row.classList.add('rh2-coupon-item-business-address-row') this.right_column.appendChild(business_address_row) const business_map_row = this.business_map_row = document.createElement('div') business_map_row.classList.add('rh2-coupon-item-business-map-row') this.right_column.appendChild(business_map_row) const business_other_coupons_row = this.business_other_coupons_row = document.createElement('div') business_other_coupons_row.classList.add('rh2-coupon-item-business-other-coupons-row') this.right_column.appendChild(business_other_coupons_row) const business_other_coupons_title = this.business_other_coupons_title = document.createElement('div') business_other_coupons_title.classList.add('rh2-coupon-item-business-other-coupons-title') business_other_coupons_title.innerText = 'Other Coupons' business_other_coupons_row.appendChild(business_other_coupons_title) const footer = rh2.Footer.build() this.el.appendChild(footer) if (this.fm.is_mobile()) { this.section_nav_item_coupon.click() } } fragment.load = function() { let promotion_id = this.get_param_value('coupon_id') if (promotion_id == undefined) { return } rh2.Coupon.call_service_coupon_item(promotion_id, function(resp) { const data = resp['data'] const promotion = data['promotion'] this.promotion = promotion this.load_promotion_callback(promotion) }.bind(this)) let url = '/rh2/service/business/business_item_get/' + this.get_param_value('slug') + '/' let xhr = new XMLHttpRequest() xhr.addEventListener("load", function(e) { const s = e.target.responseText const rtn = JSON.parse(s) const data = rtn.data if (rtn.errcode === 404) { window.location.assign('/rh2/generic-404/') return } const business = data this.business = business this.load_business_callback(business) }.bind(this)) xhr.open("GET", url) xhr.send() } fragment.load_promotion_callback = function(promotion) { const image_url = rh2.Promotion.get_promotion_image_url(promotion) this.image.style['background-image'] = "url('" + image_url + "')" const title = rh2.Promotion.get_promotion_title(promotion) this.title_row.innerText = title this.description_row.innerText = promotion['description'] for (let i = 0; i < promotion['schedules'].length; i++) { const schedule = promotion['schedules'][i] if (schedule['is_active'] != true) { continue } let text = [ schedule['time_begin'].substring(0, 5), ' - ', schedule['time_end'].substring(0, 5), ', ', schedule['date_days_of_week'] ].join('') const item = document.createElement('div') item.classList.add('rh2-coupon-item-schedule-item') item.innerText = text this.schedule_row.appendChild(item) if (this.fm.is_mobile()) { item.classList.add('rh2-coupon-item-schedule-item-mobile') } } for (let i = 0; i < 3; i++) { let text = promotion['value_str_' + i] if (i == 0) { text = 'Not to be used in conjunction with any other offer.' } if (text != '') { text = '· ' + text const row = document.createElement('div') row.innerText = text this.condition_row.appendChild(row) } } if (this.promotion != null && this.business != null) { this.render_action_row() } } fragment.load_business_callback = function(business) { this.set_param_value('restaurant_name', business['name']) this.set_param_value('restaurant_uuid', business['rh2_uuid']) this.business_logo_col.style['background-image'] = 'url(' + business['logo_image_url'] + ')' this.business_title_row.innerText = business['name'] this.business_title_row.setAttribute('href', business['item_page_url']) let cuisine_text = business['cuisine_vals'].slice(0, 3).join(' · ') this.business_cuisine_row.innerText = cuisine_text if (business['ta_rating'] && business['ta_num_reviews']) { const ta_image_el = document.createElement('div') ta_image_el.classList.add('rh2-coupon-item-business-review-row-review-image') const ta_image_url = '/rh2/static/image/tripadvisor/' + business['ta_rating'].toFixed(1) + '-56699-2.png' ta_image_el.setAttribute('style', "background-image: url('" + ta_image_url + "')") this.business_review_row.appendChild(ta_image_el) const ta_num_reviews_el = document.createElement('div') ta_num_reviews_el.classList.add('rh2-coupon-item-business-review-row-review-number') ta_num_reviews_el.innerText = business['ta_num_reviews'] + ' Reviews' this.business_review_row.appendChild(ta_num_reviews_el) } if (business['price_level']) { const price_el = document.createElement('div') price_el.classList.add('rh2-coupon-item-business-review-row-price-col') this.business_review_row.appendChild(price_el) const price_level = business['price_level'] const price_on_text = "$".repeat(Math.min(price_level, 4)) const price_off_text = "$".repeat(Math.max(4 - price_level, 0)) const price_on_el = document.createElement('div') price_on_el.classList.add('rh2-coupon-item-business-review-row-price-col-on') price_on_el.innerText = price_on_text price_el.appendChild(price_on_el) const price_off_el = document.createElement('div') price_off_el.classList.add('rh2-coupon-item-business-review-row-price-col-off') price_off_el.innerText = price_off_text price_el.appendChild(price_off_el) } for (let i = 0; i < 5; i++) { if (i < 4) { const image = business['images'][i] if (image) { this.business_photos[i].style['background-image'] = 'url(' + image['tile_url'] + ')' } } this.business_photos[i].setAttribute('href', business['item_page_url']) } for (let i = 0; i < 5; i++) { this.business_section_links[i].setAttribute('href', business['item_page_url']) } this.business_address_row.innerText = business['address'] this.business_map_row.setAttribute('data-rh2-coupon-item-business-map-name', business['name']) this.business_map_row.setAttribute('data-rh2-coupon-item-business-map-latitude', business['geo_latitude']) this.business_map_row.setAttribute('data-rh2-coupon-item-business-map-longitude', business['geo_longitude']) this.prepare_map(this.business_map_row) for (let i = 0; i < business['coupons'].length; i++) { const promotion = business['coupons'][i] if (promotion['is_active'] != true) { continue } if (promotion['manifestation'] != 'COUPON') { continue } if (promotion['uuid'] == this.get_param_value('coupon_id')) { continue } const title = rh2.Promotion.get_promotion_title(promotion) const url = business['item_page_url'] + 'coupon/' + promotion['uuid'] + '/' const item = document.createElement('div') item.classList.add('rh2-coupon-item-business-other-coupons-item') item.innerText = title this.business_other_coupons_row.appendChild(item) const link = document.createElement('a') link.classList.add('rh2-coupon-link-business-other-coupons-link') link.innerText = 'See details' item.appendChild(link) link.setAttribute('href', url) } if (this.promotion != null && this.business != null) { this.render_action_row() } } fragment.render_action_row = function() { const coupon = new rh2.Coupon.CouponStruct() coupon.decode(this.promotion) const action_row = rh2.Coupon.render_action_row(coupon, this.business, this) this.action_row.appendChild(action_row) } fragment.prepare_map = async function(map_container_el) { let map_loaded = await rh2.utils.load_google_maps() if (!map_loaded) { console.error('google maps not loaded in 5 seconds') return } const marker_text = map_container_el.getAttribute('data-rh2-coupon-item-business-map-name') const latitude = map_container_el.getAttribute('data-rh2-coupon-item-business-map-latitude') const longitude = map_container_el.getAttribute('data-rh2-coupon-item-business-map-longitude') if (latitude && longitude && window.google) { const latlon = new google.maps.LatLng(parseFloat(latitude), parseFloat(longitude)) const options = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, center: latlon, mapTypeControl: false, streetViewControl: false, mapId: 'coupon_item', } const map = new google.maps.Map(map_container_el, options) const marker = new google.maps.marker.AdvancedMarkerElement({ position: latlon, map: map, title: marker_text, }) } else { map_container_el.style['display'] = 'none' } } })()</script> <script src="https://apis.google.com/js/platform.js" async defer crossorigin="anonymous"> </script> <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"> </script> <script> window.fbAsyncInit = function() { FB.init({ appId: '706608999777126', xfbml: true, version: 'v19.0' }); };</script> <script>!function (w, d, t) { w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie","holdConsent","revokeConsent","grantConsent"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for( var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var r="https://analytics.tiktok.com/i18n/pixel/events.js",o=n&&n.partner;ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=r,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};n=document.createElement("script") ;n.type="text/javascript",n.async=!0,n.src=r+"?sdkid="+e+"&lib="+t;e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e)}; ttq.load('CRB4533C77U42T4E2G1G'); ttq.page(); }(window, document, 'ttq');</script> <script> //load TrackerJS !function(t,n,e,o,a){function d(t){var n=~~(Date.now()/3e5),o=document.createElement(e);o.async=!0,o.src=t+"?ts="+n;var a=document.getElementsByTagName(e)[0];a.parentNode.insertBefore(o,a)}t.MooTrackerObject=a,t[a]=t[a]||function(){return t[a].q?void t[a].q.push(arguments):void(t[a].q=[arguments])},window.attachEvent?window.attachEvent("onload",d.bind(this,o)):window.addEventListener("load",d.bind(this,o),!1)}(window,document,"script","//cdn.stat-track.com/statics/moosend-tracking.min.js","mootrack"); //tracker has to be initialized otherwise it will generate warnings and wont sendtracking events mootrack('init', '7609debb-6cc4-4c9c-8a5d-734d713e24d2'); </script> <script src="https://js.hs-scripts.com/6532496.js" async defer id="hs-script-loader"> </script> <script src="//secure-nz.imrworldwide.com/v60.js" async defer> </script> <script src="https://click.linktrack.co.nz/scripts/sdk/everflow.js" crossorigin="anonymous" async defer> </script> <script> (async () => { let EF_loaded = await rh2.utils.wait_objects(['EF']) if (EF_loaded && document.location.search.indexOf('_ef_transaction_id') > -1) { EF.click({ offer_id: EF.urlParameter('oid'), affiliate_id: EF.urlParameter('affid'), sub1: EF.urlParameter('sub1'), sub2: EF.urlParameter('sub2'), sub3: EF.urlParameter('sub3'), sub4: EF.urlParameter('sub4'), sub5: EF.urlParameter('sub5'), uid: EF.urlParameter('uid'), source_id: EF.urlParameter('source_id'), transaction_id: EF.urlParameter('_ef_transaction_id'), }); } })() </script> <script> (function(h,o,t,j,a,r){ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; h._hjSettings={hjid:5176064,hjsv:6}; a=o.getElementsByTagName('head')[0]; r=o.createElement('script');r.async=1; r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; a.appendChild(r); })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); </script> </body> </html>