From c8a111f5f5babbe826f70cc3e12424b3dcd1f8ed Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 1 Sep 2023 16:32:57 -0500 Subject: [PATCH] Beta download page --- ...etaDownloadLandingBottomPage.js.jsx.coffee | 49 ++++++++++++ .../BetaDownloadLandingPage.js.jsx.coffee | 61 +++++++++++++++ .../assets/stylesheets/landing/landing.css | 3 +- .../stylesheets/landings/beta_download.scss | 27 +++++++ web/app/controllers/landings_controller.rb | 14 ++++ .../views/landings/beta_download.html.slim | 77 +++++++++++++++++++ web/config/routes.rb | 1 + 7 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 web/app/assets/javascripts/react-components/landing/BetaDownloadLandingBottomPage.js.jsx.coffee create mode 100644 web/app/assets/javascripts/react-components/landing/BetaDownloadLandingPage.js.jsx.coffee create mode 100644 web/app/assets/stylesheets/landings/beta_download.scss create mode 100644 web/app/views/landings/beta_download.html.slim diff --git a/web/app/assets/javascripts/react-components/landing/BetaDownloadLandingBottomPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/BetaDownloadLandingBottomPage.js.jsx.coffee new file mode 100644 index 000000000..b9ade40b3 --- /dev/null +++ b/web/app/assets/javascripts/react-components/landing/BetaDownloadLandingBottomPage.js.jsx.coffee @@ -0,0 +1,49 @@ +context = window + +@BetaDownloadLandingBottomPage = React.createClass({ + + render: () -> + `
+
+

Updating to the JamKazam BETA App

+ +

The JamKazam BETA app installs exactly the same as the previous versions of JamKazam. By using this version + of the client, you will be able to play with other beta users, as well as users still on the current + production version. If at any time you want to go back to the current (non-BETA) version of the application, + just install the version of JamKazam found on our downloads. +

+
+

Below are the typical installation instructions:

+ +
+
+
+

1
Download the application.

+

+ Download the application by choosing your platform in the above section. +

+

+
+
+
+
+

2
Run the installer

+

+ On Windows, double-click the .msi file and follow all the prompts to update your JamKazam application to + the BETA version. On Mac OS, double-click the .dmg file, and drag the JamKazam icon to the Application + folder in the window that opens, and selecting 'Replace' if prompted. +

+

+
+
+
+
+

3
Launch the application

+

+ Launch the application exactly as you did before! +

+

+
+
+
` +}) diff --git a/web/app/assets/javascripts/react-components/landing/BetaDownloadLandingPage.js.jsx.coffee b/web/app/assets/javascripts/react-components/landing/BetaDownloadLandingPage.js.jsx.coffee new file mode 100644 index 000000000..caaa77d99 --- /dev/null +++ b/web/app/assets/javascripts/react-components/landing/BetaDownloadLandingPage.js.jsx.coffee @@ -0,0 +1,61 @@ +context = window +rest = context.JK.Rest() + +@BetaDownloadLandingPage = React.createClass({ + + render: () -> + + if this.state.done + ctaButtonText10 = 'sending you in...' + ctaButtonText20 = 'sending you in...' + else if this.state.processing + ctaButtonText10 = 'hold on...' + ctaButtonText20 = 'hold on...' + else + ctaButtonText10 = `ADD $10 CARD
TO CART
` + ctaButtonText20 = `ADD $20 CARD
TO CART
` + + + + `
+
+ +
+
+

+ The JamKazam BETA app is now ready for download!

We've updated the client to support Windows 10, Windows 11, Mac M1/M2, and Mac Intel.
All JamKazam internals are completely upgraded, resulting in better video, clearer backing tracks & JamTracks, and countless other improvements. +

+
+
` + + getInitialState: () -> + {processing:false} + + componentDidMount:() -> + $root = $(this.getDOMNode()) + +# add item to cart, create the user if necessary, and then place the order to get the free JamTrack. + ctaClick: (card_type, e) -> + e.preventDefault() + + return if @state.processing + + loggedIn = context.JK.currentUserId? + + rest.addGiftCardToShoppingCart({id: card_type}).done((response) => + + if loggedIn + @setState({done: true}) + context.location = '/client#/shoppingCart' + else + @setState({done: true}) + context.location = '/client#/shoppingCart' + + ).fail((jqXHR, textStatus, errorMessage) => + if jqXHR.status == 422 + errors = JSON.parse(jqXHR.responseText) + cart_errors = errors?.errors?.cart_id + context.JK.app.ajaxError(jqXHR, textStatus, errorMessage) + @setState({processing:false}) + ) +}) diff --git a/web/app/assets/stylesheets/landing/landing.css b/web/app/assets/stylesheets/landing/landing.css index 3017405c6..060e73268 100644 --- a/web/app/assets/stylesheets/landing/landing.css +++ b/web/app/assets/stylesheets/landing/landing.css @@ -14,4 +14,5 @@ *= require landings/posa_activation *= require landings/simple_jamtracks *= require landings/simple_jamclass -*/ \ No newline at end of file +*= require landings/beta_download +*/ diff --git a/web/app/assets/stylesheets/landings/beta_download.scss b/web/app/assets/stylesheets/landings/beta_download.scss new file mode 100644 index 000000000..76be11c03 --- /dev/null +++ b/web/app/assets/stylesheets/landings/beta_download.scss @@ -0,0 +1,27 @@ +@import "client/common.scss"; + +body.web.individual_jamtrack .row.cta-row { + h2 { + margin-bottom:20px; + } + width:auto; + a.cta-button { + font-size:20px; + border-radius: 7px; + padding:8px; + color:black; + font-weight:bold; + border-color:white; + border-width:2px; + border-style:solid; + margin-right:20px; + } + + a#other-select { + margin-top:20px; + } +} + +body.web .landing-content { + min-height:auto; +} diff --git a/web/app/controllers/landings_controller.rb b/web/app/controllers/landings_controller.rb index 0905ab7f7..a2d5b8076 100644 --- a/web/app/controllers/landings_controller.rb +++ b/web/app/controllers/landings_controller.rb @@ -343,6 +343,20 @@ class LandingsController < ApplicationController render 'buy_gift_card', layout: 'web' end + def beta_download + @no_landing_tag = true + @landing_tag_play_learn_earn = false + @show_after_black_bar_border = true + + @title = 'Download the JamKazam Beta App' + @description = "The JamKazam Beta client app is here! Download it for MacOSX or Windows, and try it out." + clients = ArtifactUpdate.where("product like '%JamClient%' and environment = '#{ArtifactUpdate::DEFAULT_ENVIRONMENT}'").order(:product) + @page_data = {} + gon.clients = clients + + render 'beta_download', layout: 'web' + end + def school_student_register @no_landing_tag = true @landing_tag_play_learn_earn = true diff --git a/web/app/views/landings/beta_download.html.slim b/web/app/views/landings/beta_download.html.slim new file mode 100644 index 000000000..17a5447d3 --- /dev/null +++ b/web/app/views/landings/beta_download.html.slim @@ -0,0 +1,77 @@ +- provide(:page_name, 'landing_page full individual_jamtrack betadownload') +- provide(:description, @description) +- provide(:title, @title) + += react_component 'BetaDownloadLandingPage', @page_data.to_json + +- content_for :after_black_bar do + .row.cta-row + h2 DOWNLOAD THE BETA NOW! + p + .cta-buttons + a#dl-windows.cta-button.hidden Download for Windows + a#dl-mac-intel.cta-button.hidden Download for Mac OS (Intel) + a#dl-mac-m.cta-button.hidden Download Mac OS (M1/M2) + + a#other-select.hidden href='#' Looking for other OS downloads? +- content_for :white_bar do + = react_component 'BetaDownloadLandingBottomPage', @page_data.to_json + +- content_for :red_bar do + .full-row + | Thank you for your continued support of JamKazam! + +div#client_holder *{ "data-client-downloads" => @page_data.to_json } +javascript: + function selectPlatform(selectedPlatform) { + console.log("selectedPlatform", selectedPlatform); + + + var platform = selectedPlatform; //MacOSX, Win32, Unix + + var otherPlatform = "MacOSX" + if(platform == "MacOSX") { + otherPlatform = "Win32" + } + $('#other-select').data('platform', otherPlatform) + + if(platform == 'MacOSX') { + $('#dl-windows').hide(); + $('#dl-mac-intel').show(); + $('#dl-mac-m').show(); + } + else { + $('#dl-mac-intel').hide(); + $('#dl-mac-m').hide(); + $('#dl-windows').show(); + } + $('#other-select').show(); + } + + $(document).on('JAMKAZAM_READY', function(e, data) { + var currentOS = window.JK.detectOS(); + + gon.clients.forEach(function(item){ + console.log("item", item) + if(item.product == "JamClientModern/Win32") { + $('#dl-windows').attr('href', item.uri.url) + } + else if(item.product == "JamClientModern/MacOSX-Intel") { + $('#dl-mac-intel').attr('href', item.uri.url) + } + else if(item.product == "JamClientModern/MacOSX-M") { + $('#dl-mac-m').attr('href', item.uri.url) + } + }); + + $('#other-select').click(function(e) { + e.preventDefault(); + + var platform = $(this).data('platform') + selectPlatform(platform); + + return false; + }) + + selectPlatform(currentOS == null || currentOS == "Unix" ? 'Win32' : currentOS); + }) diff --git a/web/config/routes.rb b/web/config/routes.rb index 13138cd80..aa85799ef 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -64,6 +64,7 @@ Rails.application.routes.draw do get '/landing/jamtracks/v2/:instrument/:plan_code', to: 'landings#individual_jamtrack_v2' get '/landing/jamtracks/:instrument/:plan_code', to: 'landings#individual_jamtrack', as: 'individual_jamtrack_instrument' get '/landing/gift-card', to: 'landings#buy_gift_card', as: 'buy_gift_card' + get '/landing/beta-download', to: 'landings#beta_download', as: 'beta_download' #get '/landing/jamclass/students', to: 'landings#jam_class_students', as: 'jamclass_student_signup' #get '/landing/jamclass/free/students', to: 'landings#jam_class_students_free' #get '/landing/jamclass/teachers', to: 'landings#jam_class_teachers', as: 'jamclass_teacher_signup'