diff --git a/web/app/assets/javascripts/jk2021/jk2021.js b/web/app/assets/javascripts/jk2021/jk2021.js
index bb294de36..215372817 100644
--- a/web/app/assets/javascripts/jk2021/jk2021.js
+++ b/web/app/assets/javascripts/jk2021/jk2021.js
@@ -1,13 +1,100 @@
-//= require ./jquery-3.5.1.min
+//= require bluebird
+//= require babel/polyfill
+//= require bugsnag
+//= require bind-polyfill
+//= require jquery
+//= require jquery.monkeypatch
//= require jquery_ujs
+
//= require ./bootstrap.min
//= require ./bootstrap.bundle.min
-//= require AAC_underscore
-//= require utils
-//= require jam_rest
+//= require jquery.ui.draggable
+//= require jquery.queryparams
+//= require jquery.hoverIntent
+//= require jquery.cookie
+//= require clipboard
+//= require jquery.easydropdown
+//= require jquery.carousel-1.1
+//= require jquery.mousewheel-3.1.9
+//= require jquery.timeago
+//= require jquery.dotdotdot
+//= require jquery.listenbroadcast
+//= require jquery.listenRecording
+//= require jquery.browser
+//= require jquery.custom-protocol
+//= require jquery.ba-bbq
+//= require jquery.icheck
+//= require jquery.bt
+//= require jquery.exists
+//= require jquery.visible
+//= require jquery.lessonSessionActions
+//= require jquery.jamblasterOptions
+//= require jquery.manageVsts
+//= require jquery.scrollTo
+//= require jquery.pulse
+//= require howler.core.js
+//= require jstz
+//= require ResizeSensor
+//= require AAA_Log
+//= require AAC_underscore
+//= require alert
+//= require globals
+//= require AAB_message_factory
+//= require facebook_helper
+//= require twitter_helper
+//= require google_helper
+//= require ../web/signup_helper
+//= require ../web/signin_helper
+//= require extras
+//= require tickDuration
+//= require feed_item_recording
+//= require feed_item_session
+//= require hoverMusician
+//= require hoverFan
+//= require hoverBand
+//= require hoverSession
+//= require hoverRecording
+//= require layout
+//= require user_dropdown
//= require jamkazam
+//= require utils
+//= require subscription_utils
+//= require ui_helper
+//= require custom_controls
+//= require jam_rest
//= require ga
+//= require session_utils
+//= require recording_utils
+//= require helpBubbleHelper
+//= require facebook_rest
+//= require jam_track_preview
+//= require ../landing/init
+//= require ../landing/signup
+//= require ../recordingModel
+//= require ../web/downloads2021
+//= require ../web/congratulations
+//= require ../web/sessions
+//= require ../web/session_info
+//= require ../web/recordings
+//= require ../web/home
+//= require ../web/tracking
+//= require ../web/individual_jamtrack
+//= require ../web/individual_jamtrack_v1
+//= require ../web/individual_jamtrack_band_v1
+//= require ../web/affiliate_program
+//= require ../web/affiliate_links
+//= require fakeJamClient
+//= require fakeJamClientMessages
+//= require fakeJamClientRecordings
+//= require JamServer
+//= require_directory ../dialog
+//= require everywhere/everywhere
+//= require classnames
+//= require reflux
+//= require react
+//= require react_ujs
+//= require react-init
+//= require react-components
//= require ../landing/signup
-//= require ../web/downloads
diff --git a/web/app/assets/javascripts/web/downloads.js b/web/app/assets/javascripts/web/downloads.js
index c7e1ea191..598c8edde 100644
--- a/web/app/assets/javascripts/web/downloads.js
+++ b/web/app/assets/javascripts/web/downloads.js
@@ -10,6 +10,7 @@
var rest = context.JK.Rest();
function selectPlatform(selectedPlatform) {
+ //console.log("selectedPlatform", selectedPlatform);
var platformName; // mac, windows, linux
var platformDisplay; // Mac, Windows, Linux
var platform = selectedPlatform; //MacOSX, Win32, Unix
@@ -83,6 +84,7 @@
});
$('a', blurb).click(function() {
+ //console.log("download clicked");
var clicked = $(this);
var href = clicked.attr('href');
if(href != "#") {
@@ -127,6 +129,7 @@
}
}
+
function listClients(congratulations, friend) {
isCongratulations = congratulations;
@@ -143,6 +146,7 @@
rest.getClientDownloads()
.done(function(data) {
+ //console.log('getClientDownloads', data);
removeSpinner();
$.each(data, function(key, item) {
@@ -158,6 +162,8 @@
.always(function() {
selectPlatform(currentOS == null ? 'Win32' : currentOS);
});
+
+ //console.log('downloadUris', downloadUris);
}
downloads.listClients = listClients;
diff --git a/web/app/assets/javascripts/web/downloads2021.js b/web/app/assets/javascripts/web/downloads2021.js
new file mode 100644
index 000000000..9711e73ea
--- /dev/null
+++ b/web/app/assets/javascripts/web/downloads2021.js
@@ -0,0 +1,195 @@
+(function(context,$) {
+
+ "use strict";
+
+ context.JK = context.JK || {};
+
+ var downloads = {};
+ var isCongratulations;
+ var downloadUris = {}; // map of platform > uri
+ var rest = context.JK.Rest();
+
+ function selectPlatform(selectedPlatform) {
+ //console.log("selectedPlatform", selectedPlatform);
+ var platformName; // mac, windows, linux
+ var platformDisplay; // Mac, Windows, Linux
+ var platform = selectedPlatform; //MacOSX, Win32, Unix
+ var platformName1, platformName2, platform1, platform2, platformDisplay1, platformDisplay2;
+ var uri = downloadUris[selectedPlatform];
+
+ // prepare template varaibles
+ if (selectedPlatform == "Unix") {
+ platformName = "linux";
+ platformDisplay = "Linux"
+ platformName1 = "mac";
+ platformDisplay1 = "Mac";
+ platformName2 = "windows";
+ platformDisplay2 = "Windows";
+ platform1 = "MacOSX";
+ platform2 = "Win32"
+ } else if(selectedPlatform == "Win32") {
+ platformName = "windows";
+ platformDisplay = "Windows";
+ platformName1 = "mac";
+ platformDisplay1 = "Mac";
+ platformName2 = "linux"
+ platformDisplay2 = "Linux";
+ platform1 = "MacOSX";
+ platform2 = "Unix";
+ } else if(selectedPlatform == "MacOSX") {
+ platformName = "mac";
+ platformDisplay = "Mac";
+ platformName1 = "windows";
+ platformDisplay1 = "Windows";
+ platformName2 = "linux";
+ platformDisplay2 = "Linux";
+ platform1 = "Win32";
+ platform2 = "Unix";
+ }
+ else {
+ alert("unknown platform: " + selectedPlatform);
+ }
+
+ var options = {
+ platform : platform,
+ platformName : platformName,
+ platformDisplay : platformDisplay,
+ platformName1 : platformName1,
+ platformDisplay1 : platformDisplay1,
+ platformName2 : platformName2,
+ platformDisplay2 : platformDisplay2,
+ platform1: platform1,
+ platform2: platform2,
+ uri : uri ? uri : '#',
+ isCongratulations : isCongratulations
+ };
+
+ var blurb = $(context._.template($('#client-download-blurb-contents').html(), options, { variable: 'data' }));
+
+ // isolate active image for blurb
+ $('div.hidden-images img[data-purpose=' + platformName + ']', blurb).remove().appendTo($('a.current-os-download', blurb));
+
+ var selectOthers = $(context._.template($('#client-download-select-others').html(), options, { variable: 'data' }));
+
+ // isolate active images for selectOthers
+ $('div.hidden-images img[data-purpose=' + platformName1 + ']', selectOthers).remove().appendTo($('a[data-order=1]', selectOthers));
+ $('div.hidden-images img[data-purpose=' + platformName2 + ']', selectOthers).remove().appendTo($('a[data-order=2]', selectOthers));
+
+
+ // install click handler for change selection
+ $('a', selectOthers).click(function() {
+ var platform = $(this).attr('data-platform');
+ selectPlatform(platform);
+ return false;
+ });
+
+ $('a', blurb).click(function() {
+ //console.log("download clicked");
+ var clicked = $(this);
+ var href = clicked.attr('href');
+ // if(platform == "MacOSX" || platform == "Win32"){
+ // openModal();
+ // }
+ if(href != "#") {
+ context.JK.GA.trackDownload(clicked.attr('data-platform'));
+ rest.userDownloadedClient().always(function() {
+ $('body').append('')
+ });
+ //open download instructions modal
+ if(platform == "MacOSX" || platform == "Win32"){
+ openModal();
+ }
+
+ }
+ else {
+ // if there is no download available, apologize to the user
+ alert("Sorry, this download is not currently available.");
+ return false;
+ }
+
+ return false;
+ });
+
+ // update blurb
+ $('body.web .downloads-blurb').empty().append(blurb);
+ // update the 'download other platforms' buttons
+ $('body.web .downloads-container').empty().append(selectOthers);
+ // update system requirements
+ if($('#client-download-system-requirements').length){
+ var systemRequirements = $(context._.template($('#client-download-system-requirements').html(), options, { variable: 'data' }));
+ $('body.web .system-requirements').empty().append(systemRequirements);
+ }
+ $('body.web .system-requirements ul').hide();
+ $('body.web .system-requirements ul.' + platformName + '-requirements').show();
+ $('body.web .system-requirements').show();
+
+ var downloadInstructions = $(context._.template($('#client-download-instructions').html(), options, { variable: 'data' }));
+ $('body.web .download-instructions').empty().append(downloadInstructions);
+
+ //close download instructions modal
+ $('.jk-modal .btn-close').on('click', closeModal);
+ }
+
+ function openModal() {
+ $('#overlay').fadeIn(300);
+ }
+
+ function closeModal() {
+ $('#overlay').fadeOut(300);
+ }
+
+ function removeSpinner() {
+ $('body.web .spinner-large').remove();
+ }
+
+ function flashCongratulations(friend) {
+ if(friend) {
+ context.JK.flash('Congratulations!
Soon you can play with ' + friend + '!', {hide:20})
+ }
+ else {
+ context.JK.flash('Congratulations!
Your account is ready.', {hide:20})
+ }
+
+ }
+
+ function listClients(congratulations, friend) {
+ isCongratulations = congratulations;
+
+ if(isCongratulations) {
+ flashCongratulations(friend);
+ }
+ else {
+ //flashCongratulations();
+ }
+
+ var rest = context.JK.Rest();
+ var currentOS = context.JK.detectOS();
+ var downloads = $('.downloads');
+
+ rest.getClientDownloads()
+ .done(function(data) {
+ //console.log('getClientDownloads', data);
+ removeSpinner();
+
+ $.each(data, function(key, item) {
+ var platform = key.substring('JamClient/'.length);
+
+ downloadUris[platform] = item.uri;
+ });
+ })
+ .fail(function(jqXHR) {
+ removeSpinner();
+ context.JK.app.notify({text: "Currently unable to list client software downloads due to error."});
+ })
+ .always(function() {
+ selectPlatform(currentOS == null ? 'Win32' : currentOS);
+ });
+
+ //console.log('downloadUris', downloadUris);
+ }
+
+ downloads.listClients = listClients;
+
+ context.JK.Downloads = downloads;
+
+})(window, jQuery)
\ No newline at end of file
diff --git a/web/app/assets/stylesheets/jk2021/jk2021.css b/web/app/assets/stylesheets/jk2021/jk2021.css
index 4e5d4c535..cd359b23d 100644
--- a/web/app/assets/stylesheets/jk2021/jk2021.css
+++ b/web/app/assets/stylesheets/jk2021/jk2021.css
@@ -1,6 +1,7 @@
/**
*= require ./bootstrap.min
+*= require ../client/flash
*= require ./landing
*/
\ No newline at end of file
diff --git a/web/app/assets/stylesheets/jk2021/landing.css b/web/app/assets/stylesheets/jk2021/landing.css
index d51a39767..fffac4f74 100644
--- a/web/app/assets/stylesheets/jk2021/landing.css
+++ b/web/app/assets/stylesheets/jk2021/landing.css
@@ -10,6 +10,9 @@
font-family: "Zilla Slab";
font-weight: 600;
}
+ h3.larger {
+ font-size:2rem;
+ }
body, div, p {
font-family: "Open Sans";
font-weight: 500;
@@ -18,6 +21,9 @@
.main {
background-image: linear-gradient(180deg,#007582 0%,#22a39c 100%);
}
+ .mt-3 {
+
+ }
.container {
padding: 40px 15px;
diff --git a/web/app/controllers/users_controller.rb b/web/app/controllers/users_controller.rb
index 09e3bd774..bff2b300d 100644
--- a/web/app/controllers/users_controller.rb
+++ b/web/app/controllers/users_controller.rb
@@ -112,9 +112,8 @@ class UsersController < ApplicationController
@user.last_name = @fb_signup.last_name
@user.gender = @fb_signup.gender
end
-
- #render :layout => 'jk2021'
- _render('new')
+ rend = _render('new')
+ render rend[:template], :layout => rend[:layout]
end
def create
@@ -191,7 +190,8 @@ class UsersController < ApplicationController
timezone: current_timezone,
origin: origin_cookie,
desired_plan_code: desired_plan_code )
-
+
+ rend = _render('new')
# check for errors
if @user.errors.any?
# render any @user.errors on error
@@ -199,14 +199,15 @@ class UsersController < ApplicationController
gon.signup_errors = true
gon.musician_instruments = instruments
gon.plan_code = desired_plan_code
- #render "new", :layout => 'jk2021'
- _render('new')
+ render rend[:template], :layout => rend[:layout]
else
sign_in @user
new_user(@user, signup_hint) # sets a cookie used for GA analytics (one-time new user stuff in JavaScript)
- destination = @user.musician ? :congratulations_musician : :congratulations_fan
- redirect_url = handle_signup_hint(@user, signup_hint, {:action => destination, friend: @invited_user.nil? ? nil : @invited_user.sender.name})
+ #destination = @user.musician ? :congratulations_musician : :congratulations_fan
+ redirect_params = { friend: @invited_user.nil? ? nil : @invited_user.sender.name }
+ destination = rend[:template] == 'new2021' ? landing_client_downloads_path(redirect_params) : congratulations_musician_path(redirect_params)
+ redirect_url = handle_signup_hint(@user, signup_hint, destination)
redirect_to redirect_url
end
end
@@ -224,8 +225,12 @@ class UsersController < ApplicationController
def downloads
@no_user_dropdown = true
@page_context = 'standalone'
- #render :layout => "jk2021"
- _render('downloads')
+ rend = _render('downloads')
+ render rend[:template], :layout => rend[:layout]
+ end
+
+ def downloads2021
+ render :downloads2021, layout: 'jk2021'
end
# DO NOT USE CURRENT_USER IN THIS ROUTINE UNLESS REDIRECTING. IT'S CACHED FOR THE WHOLE SITE
@@ -440,13 +445,12 @@ JS
private
def _render(action)
- layout_template = case action
+ case action
when 'new'
- request.path == '/landing/general/signup' ? ['jk2021', 'new2021'] : ['web', 'new']
+ request.path == '/landing/general/signup' ? { layout: 'jk2021', template: 'new2021' } : { layout: 'web', template: 'new' }
when 'downloads'
- request.path == '/landing/general/downloads' ? ['jk2021', 'downloads2021'] : ['web', 'downloads']
+ request.path == '/landing/general/downloads' ? { layout: 'jk2021', template: 'downloads2021' } : { layout: 'web', template: 'downloads' }
end
- render layout_template[1], :layout => layout_template[0]
end
def is_native_client
diff --git a/web/app/views/layouts/jk2021.html.erb b/web/app/views/layouts/jk2021.html.erb
index f777c0436..770368e55 100644
--- a/web/app/views/layouts/jk2021.html.erb
+++ b/web/app/views/layouts/jk2021.html.erb
@@ -32,13 +32,13 @@