alpha the list of FTUE instruments VRFS-4172
This commit is contained in:
parent
8793c77033
commit
e449139b63
|
|
@ -0,0 +1,30 @@
|
|||
ActiveAdmin.register JamRuby::User, :as => 'UserSource' do
|
||||
|
||||
menu :label => 'User Campaigns', :parent => 'Users'
|
||||
|
||||
config.sort_order = 'created_at DESC'
|
||||
config.batch_actions = false
|
||||
config.clear_action_items!
|
||||
config.filters = false
|
||||
|
||||
index do
|
||||
column "Email" do |user|
|
||||
user.email
|
||||
end
|
||||
column "Bought TestDrive" do |user|
|
||||
!user.most_recent_test_drive_purchase.nil? ? "Yes" : "No"
|
||||
end
|
||||
column "UTM Source" do |user|
|
||||
user.origin_utm_source
|
||||
end
|
||||
column "UTM Medium" do |user|
|
||||
user.origin_utm_medium
|
||||
end
|
||||
column "UTM Campaign" do |user|
|
||||
user.origin_utm_campaign
|
||||
end
|
||||
column "Referrer" do |user|
|
||||
user.origin_referrer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -2090,7 +2090,7 @@ module JamRuby
|
|||
LessonBooking.unprocessed(self).where(lesson_type: LessonBooking::LESSON_TYPE_PAID).first
|
||||
end
|
||||
|
||||
def most_recent_test_drive_purchase
|
||||
def most_recent_test_drive_purchase
|
||||
lesson_purchases.where('lesson_package_type_id in (?)', LessonPackageType.test_drive_package_ids).order('created_at desc').first
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@
|
|||
"Electric Guitar": { "client_id": 50, "server_id": "electric guitar" },
|
||||
"Keyboard": { "client_id": 60, "server_id": "keyboard" },
|
||||
"Piano": { "client_id": 61, "server_id": "piano" },
|
||||
"Upright Bass": { "client_id": 62, "server_id": "upright bass" },
|
||||
"Upright Bass": { "client_id": 62, "server_id": "double bass" },
|
||||
"Voice": { "client_id": 70, "server_id": "voice" },
|
||||
"Flute": { "client_id": 80, "server_id": "flute" },
|
||||
"Clarinet": { "client_id": 90, "server_id": "clarinet" },
|
||||
|
|
@ -250,6 +250,9 @@
|
|||
"Other": { "client_id": 250, "server_id": "other" }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
context.JK.client_to_server_instrument_map = {
|
||||
10: { "server_id": "acoustic guitar" },
|
||||
20: { "server_id": "bass guitar" },
|
||||
|
|
@ -259,7 +262,7 @@
|
|||
50: { "server_id": "electric guitar" },
|
||||
60: { "server_id": "keyboard" },
|
||||
61: { "server_id": "piano"} ,
|
||||
62: { "server_id": "upright bass"} ,
|
||||
62: { "server_id": "double bass"} ,
|
||||
70: { "server_id": "voice" },
|
||||
80: { "server_id": "flute" },
|
||||
90: { "server_id": "clarinet" },
|
||||
|
|
@ -283,10 +286,21 @@
|
|||
|
||||
context.JK.instrument_id_to_instrument = {};
|
||||
|
||||
context.JK.server_to_client_instrument_alpha = [];
|
||||
|
||||
(function() {
|
||||
$.each(context.JK.server_to_client_instrument_map, function(key, value) {
|
||||
context.JK.instrument_id_to_instrument[value.server_id] = { client_id: value.client_id, display: key }
|
||||
context.JK.server_to_client_instrument_alpha.push({ client_id: value.client_id, display: key, server_id: value.server_id })
|
||||
});
|
||||
|
||||
context.JK.server_to_client_instrument_alpha.sort(function(a, b){
|
||||
if ( a.display < b.display )
|
||||
return -1;
|
||||
if ( a.display > b.display )
|
||||
return 1;
|
||||
return 0;
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ ConfigureTracksStore = @ConfigureTracksStore
|
|||
|
||||
instruments = []
|
||||
instruments.push(`<option key="" value="">Select the instrument for this track</option>`)
|
||||
for displayName, value of context.JK.server_to_client_instrument_map
|
||||
instruments.push(`<option key={value.server_id} value={value.server_id}>{displayName}</option>`)
|
||||
for instrument in context.JK.server_to_client_instrument_alpha
|
||||
instruments.push(`<option key={instrument.server_id} value={instrument.server_id}>{instrument.display}</option>`)
|
||||
|
||||
vsts = []
|
||||
|
||||
|
|
@ -134,8 +134,8 @@ ConfigureTracksStore = @ConfigureTracksStore
|
|||
midiInstruments = []
|
||||
|
||||
instruments = []
|
||||
for displayName, value of context.JK.server_to_client_instrument_map
|
||||
instruments.push(`<option key={value.server_id} value={value.server_id}>{displayName}</option>`)
|
||||
for instrument in context.JK.server_to_client_instrument_alpha
|
||||
instruments.push(`<option key={instrument.server_id} value={instrument.server_id}>{instrument.display}</option>`)
|
||||
|
||||
selectedMidiInterface = ''
|
||||
selectedInstrument = context.JK.client_to_server_instrument_map[50].server_id # default to electric guitar
|
||||
|
|
|
|||
Loading…
Reference in New Issue