diff --git a/website/config/routes.js b/website/config/routes.js index c616e656b3..ea6e9797a8 100644 --- a/website/config/routes.js +++ b/website/config/routes.js @@ -108,7 +108,8 @@ module.exports.routes = { 'GET /customers/new-license': { action: 'customers/view-new-license', locals: { - layout: 'layouts/layout-customer', + hideHeaderLinks: true, + hideFooterLinks: true, pageTitleForMeta: 'Get Fleet Premium | Fleet', pageDescriptionForMeta: 'Generate your quote and start using Fleet Premium today.', } @@ -116,7 +117,8 @@ module.exports.routes = { 'GET /customers/register': { action: 'entrance/view-signup', locals: { - layout: 'layouts/layout-customer', + hideHeaderLinks: true, + hideFooterLinks: true, pageTitleForMeta: 'Sign up | Fleet', pageDescriptionForMeta: 'Sign up for a Fleet Premium license.', } @@ -124,7 +126,8 @@ module.exports.routes = { 'GET /customers/login': { action: 'entrance/view-login', locals: { - layout: 'layouts/layout-customer', + hideHeaderLinks: true, + hideFooterLinks: true, pageTitleForMeta: 'Log in | Fleet', pageDescriptionForMeta: 'Log in to the Fleet customer portal.', } @@ -132,7 +135,8 @@ module.exports.routes = { 'GET /customers/dashboard': { action: 'customers/view-dashboard', locals: { - layout: 'layouts/layout-customer', + hideHeaderLinks: true, + hideFooterLinks: true, pageTitleForMeta: 'Customer dashboard | Fleet', pageDescriptionForMeta: 'View and edit information about your Fleet Premium license.', } @@ -140,7 +144,8 @@ module.exports.routes = { 'GET /customers/forgot-password': { action: 'entrance/view-forgot-password', locals: { - layout: 'layouts/layout-customer', + hideHeaderLinks: true, + hideFooterLinks: true, pageTitleForMeta: 'Forgot password | Fleet', pageDescriptionForMeta: 'Recover the password for your Fleet customer account.', } @@ -148,7 +153,8 @@ module.exports.routes = { 'GET /customers/new-password': { action: 'entrance/view-new-password', locals: { - layout: 'layouts/layout-customer', + hideHeaderLinks: true, + hideFooterLinks: true, pageTitleForMeta: 'New password | Fleet', pageDescriptionForMeta: 'Change the password for your Fleet customer account.', } @@ -159,14 +165,13 @@ module.exports.routes = { locals: { pageTitleForMeta: 'State of device management | Fleet', pageDescriptionForMeta: 'We surveyed 200+ security practitioners to discover the state of device management in 2022. Click here to learn about their struggles and best practices.', - headerCTAHidden: true, } }, 'GET /try-fleet/register': { action: 'try-fleet/view-register', locals: { - layout: 'layouts/layout-sandbox', + hideFooterLinks: true, pageTitleForMeta: 'Try Fleet | Fleet', pageDescriptionForMeta: 'Get up and running in minutes to try out Fleet.', } @@ -175,7 +180,7 @@ module.exports.routes = { 'GET /try-fleet/login': { action: 'try-fleet/view-sandbox-login', locals: { - layout: 'layouts/layout-sandbox', + hideFooterLinks: true, pageTitleForMeta: 'Sign in | Fleet', pageDescriptionForMeta: 'Log in to Fleet.', } @@ -200,7 +205,8 @@ module.exports.routes = { 'GET /admin/email-preview': { action: 'admin/view-email-templates', locals: { - layout: 'layouts/layout-customer' + hideFooterLinks: true, + showAdminLinks: true, }, }, @@ -208,14 +214,16 @@ module.exports.routes = { action: 'admin/view-email-template-preview', skipAssets: true, locals: { - layout: 'layouts/layout-customer' + hideFooterLinks: true, + showAdminLinks: true, }, }, 'GET /admin/sandbox-waitlist': { action: 'admin/view-sandbox-waitlist', locals: { - layout: 'layouts/layout-customer' + hideFooterLinks: true, + showAdminLinks: true, }, }, @@ -229,23 +237,18 @@ module.exports.routes = { 'GET /admin/generate-license': { action: 'admin/view-generate-license', locals: { - layout: 'layouts/layout-customer' + hideFooterLinks: true, + showAdminLinks: true, } }, 'GET /connect-vanta': { action: 'view-connect-vanta', - locals: { - layout: 'layouts/layout-sandbox', - } }, 'GET /vanta-authorization': { action: 'view-vanta-authorization', - locals: { - layout: 'layouts/layout-sandbox', - } }, 'GET /device-management': { diff --git a/website/views/layouts/layout-customer.ejs b/website/views/layouts/layout-customer.ejs deleted file mode 100644 index fd6fa86b69..0000000000 --- a/website/views/layouts/layout-customer.ejs +++ /dev/null @@ -1,364 +0,0 @@ -<% - // In case we're displaying the 404 or 500 page and relevant code in the "custom" hook was not able to run, - // we make sure certain view locals exist that are commonly used in this layout.ejs file. This ensures we - // don't have to do `typeof` checks below. - var me; - var isHomepage; -%> - - - <%= typeof pageTitleForMeta !== 'undefined' ? pageTitleForMeta : 'Fleet | Open-source device management' %> - - - <% /* Viewport tag for sensible mobile support */ %> - - <%// Twitter meta tags%> - - - - - - <%// Meta tags for other social previews %> - - - - <% /* Script tags should normally be included further down the page- but any - scripts that load fonts (e.g. Fontawesome ≥v5) are special exceptions to the - rule. (Include them up here along with any hard-coded «link» tags for Typekit, - Google Fonts, etc. - above the «body» to prevent the page flickering when fonts - load.) */ %> - - <% /* Certain scripts, normally analytics tools like Google Tag Manager and - Google Analytics, should only be included in production: */ - if (sails.config.environment === 'production') { %> - <% /* Rollbar */%> - - <% /* Google Analytics, Google Tag Manager, Snitcher etc. */ %> - <% /* Global site tag (gtag.js) - Google Analytics */%> - - - <% /* Google Tag Manager */ %> - - <% /* Meta pixel code */ %> - - - <% /* Hotjar code */ %> - - <% /* Heap analytics code */ %> - - <% /* Snitcher analytics code */ %> - - <% /* HubSpot Embed Code */ %> - - <% } - /* Otherwise, any such scripts are excluded, and we instead inject a - robots/noindex meta tag to help prevent any unwanted visits from search engines. */ - else { %> - - <% } %> - <% /* - Stylesheets - ======================== - - Stylesheets can be hard-coded as «link» tags, automatically injected - by the asset pipeline between "STYLES" and "STYLES END", or both. - (https://sailsjs.com/docs/concepts/assets/task-automation) - */ %> - - <% /* Auto-injected «link» tags: */ %> - - - - - - - - <% /* Google Tag Manager (noscript) */ %> - - <%/* End Google Tag Manager (noscript) */%> -
- -
-
-
- - Fleet logo - -
- Log out -
-
- <%if(me && me.isSuperAdmin) {%> - - <%} %> -
-
- - <%- body %> - -
-
-
- Creative Commons Licence CC BY-SA 4.0 -
- © <%= (new Date()).getFullYear() %> Fleet Device Management Inc. - Privacy -
-
-
-
- -
- - <% /* - Client-side JavaScript - ======================== - - Scripts can be hard-coded as «script» tags, automatically injected - by the asset pipeline between "SCRIPTS" and "SCRIPTS END", or both. - (https://sailsjs.com/docs/concepts/assets/task-automation) - */ %> - <% /* Cookie consent banner */ %> - - - <%/* Stripe.js */%> - - - <% /* Delete the global `self` to help avoid client-side bugs. - (see https://developer.mozilla.org/en-US/docs/Web/API/Window/self) */ %> - - - <%/* bowser.js (for browser detection) -- included inline to avoid issues with minification that could affect the unsupported browser overlay */%> - - - <% /* Auto-injected «script» tags: */ %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% /* Display an overlay if the current browser is not supported. - (Relies on `bowser`, which is loaded inline above.) */ %> - - - <% /* Keep footer hidden until the document is ready (prevents flicker that is especially unattractive on mobile) */ %> - - - - diff --git a/website/views/layouts/layout-sandbox.ejs b/website/views/layouts/layout-sandbox.ejs deleted file mode 100644 index 343716d674..0000000000 --- a/website/views/layouts/layout-sandbox.ejs +++ /dev/null @@ -1,483 +0,0 @@ -<% - // In case we're displaying the 404 or 500 page and relevant code in the "custom" hook was not able to run, - // we make sure certain view locals exist that are commonly used in this layout.ejs file. This ensures we - // don't have to do `typeof` checks below. - var me; - var optimizeForAppleWebview;// For hiding the header and footer, and disabling papercups chat. - var headerCTAHidden; -%> - - - <%= typeof pageTitleForMeta !== 'undefined' ? pageTitleForMeta : 'Fleet | Open-source device management' %> - - - <% /* Viewport tag for sensible mobile support */ %> - - <%// Twitter meta tags%> - - - - - - <%// Meta tags for other social previews %> - - - - <% /* Script tags should normally be included further down the page- but any - scripts that load fonts (e.g. Fontawesome ≥v5) are special exceptions to the - rule. (Include them up here along with any hard-coded «link» tags for Typekit, - Google Fonts, etc. - above the «body» to prevent the page flickering when fonts - load.) */ %> - - <% /* Certain scripts, normally analytics tools like Google Tag Manager and - Google Analytics, should only be included in production: */ - if (sails.config.environment === 'production') { %> - <% /* Rollbar */%> - - <% /* Google Analytics, Google Tag Manager, Snitcher etc. */ %> - <% /* Global site tag (gtag.js) - Google Analytics */%> - - - <% /* Google Tag Manager */ %> - - <% /* Meta pixel code */ %> - - - <% /* Hotjar code */ %> - - <% /* Heap analytics code */ %> - - <% /* Snitcher analytics code */ %> - - <% /* HubSpot Embed Code */ %> - - <% } - /* Otherwise, any such scripts are excluded, and we instead inject a - robots/noindex meta tag to help prevent any unwanted visits from search engines. */ - else { %> - - <% } %> - <% /* - Stylesheets - ======================== - - Stylesheets can be hard-coded as «link» tags, automatically injected - by the asset pipeline between "STYLES" and "STYLES END", or both. - (https://sailsjs.com/docs/concepts/assets/task-automation) - */ %> - - <% /* Auto-injected «link» tags: */ %> - - - - - - - - <% /* Google Tag Manager (noscript) */ %> - - <%/* End Google Tag Manager (noscript) */%> -
-
-
- <%// Page header%> -
- - Fleet logo - - <%/* Mobile Navigation menu */%> -
- -
- - <%/* Desktop Navigation bar */%> - -
-
-
- - <%- body %> - -
-
-
- Creative Commons Licence CC BY-SA 4.0 -
- © <%= (new Date()).getFullYear() %> Fleet Device Management Inc. - Privacy -
-
-
-
- -
- - <% /* - Client-side JavaScript - ======================== - - Scripts can be hard-coded as «script» tags, automatically injected - by the asset pipeline between "SCRIPTS" and "SCRIPTS END", or both. - (https://sailsjs.com/docs/concepts/assets/task-automation) - */ %> - <% /* Cookie consent banner */ %> - - - <%/* Stripe.js */%> - - - <% /* Delete the global `self` to help avoid client-side bugs. - (see https://developer.mozilla.org/en-US/docs/Web/API/Window/self) */ %> - - - <%/* bowser.js (for browser detection) -- included inline to avoid issues with minification that could affect the unsupported browser overlay */%> - - - <% /* Auto-injected «script» tags: */ %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% /* Display an overlay if the current browser is not supported. - (Relies on `bowser`, which is loaded inline above.) */ %> - - - <% /* Keep footer hidden until the document is ready (prevents flicker that is especially unattractive on mobile) */ %> - - - - diff --git a/website/views/layouts/layout.ejs b/website/views/layouts/layout.ejs index 976d6400b2..48631764ee 100644 --- a/website/views/layouts/layout.ejs +++ b/website/views/layouts/layout.ejs @@ -4,8 +4,10 @@ // don't have to do `typeof` checks below. var me; var isHomepage; - var headerCTAHidden; var currentSection; + var hideHeaderLinks;// Hides the header navigation links. + var hideFooterLinks;// Hides footer links, reduces the height of the footer to 60px; + var showAdminLinks;// Shows links to admin pages to admin users. %> @@ -132,142 +134,168 @@ height="0" width="0" style="display:none;visibility:hidden"> <%/* End Google Tag Manager (noscript) */%> -
+
<%// Page header%>
-
- - Fleet logo - - <%/* Mobile Navigation menu */%> -
- -
-