VRFS-3936 merging develop
This commit is contained in:
commit
cd843f300c
|
|
@ -14,42 +14,41 @@ else
|
|||
ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] ||= "true"
|
||||
end
|
||||
|
||||
gem 'rails', '~> 3.2.22'
|
||||
gem 'rails', '> 4.2'
|
||||
gem 'protected_attributes'
|
||||
gem 'rails-observers'
|
||||
|
||||
gem 'bootstrap-sass', '2.0.4'
|
||||
gem 'bcrypt-ruby', '3.0.1'
|
||||
|
||||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
group :assets do
|
||||
gem 'sass-rails', '~> 3.2.3'
|
||||
gem 'coffee-rails', '~> 3.2.1'
|
||||
gem 'sass-rails' #, '~> 3.2.3'
|
||||
gem 'coffee-rails' #, '~> 3.2.1'
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
# gem 'therubyracer', :platforms => :ruby
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
# gem 'therubyracer', :platforms => :ruby
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
|
||||
# this version is pinned due to this: https://github.com/gregbell/active_admin/issues/1939
|
||||
gem 'coffee-script-source', '~> 1.4.0' # ADD THIS LINE, 1.5.0 doesn't compile ActiveAdmin JavaScript files
|
||||
end
|
||||
gem 'kickbox'
|
||||
gem 'devise', '3.3.0'
|
||||
gem 'will_paginate', '3.0.3'
|
||||
gem 'uglifier' #, '>= 1.0.3'
|
||||
gem 'net-ssh'
|
||||
|
||||
# this version is pinned due to this: https://github.com/gregbell/active_admin/issues/1939
|
||||
gem 'coffee-script-source' #, '~> 1.4.0' # ADD THIS LINE, 1.5.0 doesn't compile ActiveAdmin JavaScript files
|
||||
gem 'devise' #, '3.3.0'
|
||||
gem 'will_paginate' #, '3.0.3'
|
||||
gem 'bootstrap-will_paginate', '0.0.6'
|
||||
gem 'carrierwave', '0.9.0'
|
||||
gem 'carrierwave' #, '0.9.0'
|
||||
gem 'carrierwave_direct'
|
||||
gem 'uuidtools', '2.1.2'
|
||||
gem 'jquery-rails' # , '2.3.0' # pinned because jquery-ui-rails was split from jquery-rails, but activeadmin doesn't support this gem yet
|
||||
gem 'jquery-ui-rails', '4.2.1'
|
||||
gem 'rails3-jquery-autocomplete'
|
||||
gem 'activeadmin' #, github: 'activeadmin', branch: '0-6-stable'
|
||||
#gem 'activeadmin', github: 'activeadmin
|
||||
gem 'jquery-ui-rails' #, '4.2.1'
|
||||
gem 'jquery-rails'
|
||||
gem 'rails-jquery-autocomplete' # This is the maintained version of rails3-jquery-autocomplete
|
||||
gem 'activeadmin' , '1.0.0.pre4'# github: 'activeadmin', branch: 'master'
|
||||
gem 'mime-types', '1.25'
|
||||
gem 'meta_search'
|
||||
gem 'fog'
|
||||
#gem 'meta_search'
|
||||
gem 'fog', "~> 1.32.0"
|
||||
gem 'unf', '0.1.3' #optional fog dependency
|
||||
gem 'country-select'
|
||||
gem 'aasm', '3.0.16'
|
||||
gem 'aasm' #, '3.0.16'
|
||||
gem 'postgres-copy', '0.6.0'
|
||||
gem 'aws-sdk', '~> 1'
|
||||
gem 'bugsnag'
|
||||
|
|
@ -62,21 +61,21 @@ gem 'resque-failed-job-mailer'
|
|||
gem 'resque-lonely_job', '~> 1.0.0'
|
||||
gem 'eventmachine', '1.0.4'
|
||||
gem 'amqp', '0.9.8'
|
||||
gem 'logging-rails', :require => 'logging/rails'
|
||||
#gem 'logging-rails', :require => 'logging/rails'
|
||||
gem 'pg_migrate'
|
||||
gem 'ruby-protocol-buffers', '1.2.2'
|
||||
gem 'sendgrid', '1.2.0'
|
||||
gem 'geokit-rails'
|
||||
gem 'postgres_ext', '1.0.0'
|
||||
gem 'postgres_ext' #, '1.0.0'
|
||||
gem 'resque_mailer'
|
||||
gem 'rest-client'
|
||||
gem 'iso-639'
|
||||
gem 'rubyzip'
|
||||
gem 'sanitize'
|
||||
gem 'slim'
|
||||
#gem 'influxdb'
|
||||
gem 'cause' # needed by influxdb
|
||||
gem 'influxdb-rails', '0.1.10'
|
||||
#gem 'influxdb', '0.1.8'
|
||||
#gem 'influxdb-rails', '0.1.10'
|
||||
gem 'influxdb-rails'
|
||||
gem 'recurly'
|
||||
gem 'sendgrid_toolkit', '>= 1.1.1'
|
||||
gem 'stripe'
|
||||
|
|
@ -111,8 +110,8 @@ group :development, :test do
|
|||
gem 'jasmine', '1.3.1'
|
||||
gem 'execjs', '1.4.0'
|
||||
#gem 'therubyracer' #, '0.11.0beta8'
|
||||
gem 'factory_girl_rails', '4.1.0'
|
||||
gem 'database_cleaner', '0.7.0'
|
||||
gem 'factory_girl_rails' # , '4.1.0'
|
||||
gem 'database_cleaner' #, '0.7.0'
|
||||
gem 'launchy'
|
||||
gem 'faker', '1.3.0'
|
||||
gem 'puma'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ ActiveAdmin.register JamRuby::AffiliatePartner, :as => 'Affiliates' do
|
|||
|
||||
index do
|
||||
|
||||
# default_actions # use this for all view/edit/delete links
|
||||
# actions # use this for all view/edit/delete links
|
||||
|
||||
column 'User' do |oo| link_to(oo.partner_user.name, admin_user_path(oo.partner_user.id), {:title => oo.partner_user.name}) end
|
||||
column 'Name' do |oo| oo.partner_name end
|
||||
|
|
@ -29,7 +29,7 @@ ActiveAdmin.register JamRuby::AffiliatePartner, :as => 'Affiliates' do
|
|||
link_to('Mark Paid', mark_paid_admin_affiliate_path(oo.id), :confirm => "Mark this affiliate as PAID?") if oo.unpaid
|
||||
end
|
||||
|
||||
default_actions
|
||||
actions
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ ActiveAdmin.register JamRuby::Connection, :as => 'Connection' do
|
|||
end
|
||||
|
||||
index do
|
||||
default_actions
|
||||
actions
|
||||
column :user_id do |c|
|
||||
c.user ? c.user.name : ''
|
||||
end
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ ActiveAdmin.register JamRuby::EmailBatch, :as => 'Batch Emails' do
|
|||
link_to("Clone", batch_clone_admin_batch_email_path(bb.id))
|
||||
end
|
||||
|
||||
default_actions
|
||||
actions
|
||||
end
|
||||
|
||||
show :title => 'Batch Email' do |obj|
|
||||
|
|
|
|||
|
|
@ -42,12 +42,11 @@ ActiveAdmin.register_page "Fake Purchaser" do
|
|||
end
|
||||
|
||||
content do
|
||||
|
||||
semantic_form_for JamTrackRight.new, :url => admin_fake_purchaser_bulk_jamtrack_purchase_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "Admin User to Fake JamTrack Purchases" do
|
||||
f.input :user, :as => :autocomplete, :url => autocomplete_user_email_admin_users_path, :input_html => { :id_element => "#jam_trak_right_user_id" }, hint: 'All JamTracks in the system will be \'bought\' for this user. No Recurly interaction occurs with this feature.'
|
||||
active_admin_form_for JamTrackRight.new, :url => admin_fake_purchaser_bulk_jamtrack_purchase_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
inputs "Admin User to Fake JamTrack Purchases" do
|
||||
input :user, :as => :autocomplete, :url => autocomplete_user_email_admin_users_path, :input_html => { :id_element => "#jam_trak_right_user_id" }, hint: 'All JamTracks in the system will be \'bought\' for this user. No Recurly interaction occurs with this feature.'
|
||||
end
|
||||
f.actions
|
||||
actions
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ ActiveAdmin.register JamRuby::FraudAlert, :as => 'Fraud Alerts' do
|
|||
scope.joins('INNER JOIN "machine_fingerprints" ON "machine_fingerprints"."id" = "fraud_alerts"."machine_fingerprint_id" LEFT OUTER JOIN "fingerprint_whitelists" ON "fingerprint_whitelists"."fingerprint" = "machine_fingerprints"."fingerprint"').where('fingerprint_whitelists IS NULL')}
|
||||
|
||||
index do
|
||||
default_actions
|
||||
actions
|
||||
|
||||
column :machine_fingerprint
|
||||
column :user
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ ActiveAdmin.register_page "Giftcarduploads" do
|
|||
end
|
||||
|
||||
content do
|
||||
semantic_form_for GiftCard.new, :url => admin_giftcarduploads_upload_giftcards_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
active_admin_form_for GiftCard.new, :url => admin_giftcarduploads_upload_giftcards_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "Upload Gift Cards" do
|
||||
f.input :csv, as: :file, required: true, :label => "A single column CSV that contains ONE type of gift card (5 JamTrack, 10 JamTrack, etc)"
|
||||
f.input :card_type, required:true, as: :select, :collection => JamRuby::GiftCard::CARD_TYPES
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ ActiveAdmin.register_page "Bootstrap" do
|
|||
para "You need to create at least one server template, and one mount template. Click one of the top-left buttons based on your platform"
|
||||
|
||||
elsif IcecastMountTemplate.count == 0
|
||||
semantic_form_for IcecastMountTemplate.new, :url => admin_bootstrap_create_mount_template_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
active_admin_form_for IcecastMountTemplate.new, :url => admin_bootstrap_create_mount_template_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "New Mount Template" do
|
||||
f.input :hostname, :label => "jam-web public hostname:port (such that icecast can reach it)"
|
||||
f.input :default_mime_type, :as => :select, :collection => ["ogg", "mp3"]
|
||||
|
|
@ -228,7 +228,7 @@ ActiveAdmin.register_page "Bootstrap" do
|
|||
f.actions
|
||||
end
|
||||
else
|
||||
semantic_form_for IcecastServer.new, :url => admin_bootstrap_create_server_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
active_admin_form_for IcecastServer.new, :url => admin_bootstrap_create_server_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "New Icecast Server" do
|
||||
f.input :hostname, :hint => "Just the icecast hostname; no port"
|
||||
f.input :template, :hint => "This is the template associated with the server. Not as useful for the 1st server, but subsequent servers can use this same template, and share config"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
ActiveAdmin.register JamRuby::User, :as => 'EducationInterest' do
|
||||
|
||||
menu :label => 'Interested in Education', :parent => 'JamClass'
|
||||
|
||||
config.sort_order = 'created_at desc'
|
||||
config.batch_actions = false
|
||||
config.per_page = 100
|
||||
config.paginate = true
|
||||
config.filters = false
|
||||
|
||||
scope("All", default: true) { |scope| scope.where(education_interest: true) }
|
||||
|
||||
index do
|
||||
column "Name" do |user|
|
||||
span do
|
||||
link_to "#{user.name} (#{user.email})", "#{Rails.application.config.external_root_url}/client#/profile/#{user.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
ActiveAdmin.register JamRuby::User, :as => 'RetailerInterest' do
|
||||
|
||||
menu :label => 'Interested in Retailers', :parent => 'JamClass'
|
||||
|
||||
config.sort_order = 'created_at desc'
|
||||
config.batch_actions = false
|
||||
config.per_page = 100
|
||||
config.paginate = true
|
||||
config.filters = false
|
||||
|
||||
scope("All", default: true) { |scope| scope.where(retailer_interest: true) }
|
||||
|
||||
index do
|
||||
column "Name" do |user|
|
||||
span do
|
||||
link_to "#{user.name} (#{user.email})", "#{Rails.application.config.external_root_url}/client#/profile/#{user.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -17,7 +17,7 @@ ActiveAdmin.register JamRuby::ArtifactUpdate, :as => 'Artifacts' do
|
|||
f.input :uri, :as => :file, :hint => "Upload the artifact from Jenkins"
|
||||
end
|
||||
|
||||
f.buttons
|
||||
f.actions
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ ActiveAdmin.register JamRuby::User, :as => 'Users' do
|
|||
column :session_settings
|
||||
column :can_invite
|
||||
|
||||
# default_actions # use this for all view/edit/delete links
|
||||
# actions # use this for all view/edit/delete links
|
||||
column "Actions" do |user|
|
||||
links = ''.html_safe
|
||||
links << link_to("View", resource_path(user), :class => "member_link view_link")
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ ActiveAdmin.register_page "Harry Fox Request" do
|
|||
|
||||
|
||||
content do
|
||||
semantic_form_for JamTrackHfaRequest.new, :url => admin_harry_fox_request_create_request_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
active_admin_form_for JamTrackHfaRequest.new, :url => admin_harry_fox_request_create_request_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "New Harry Fox Licensing Request" do
|
||||
f.input :name, :hint => "Some sort of name to help us remember what this request was for"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ ActiveAdmin.register JamRuby::JamTrackRight, :as => 'JamTrackRights' do
|
|||
filter :jam_track
|
||||
|
||||
index do
|
||||
default_actions
|
||||
actions
|
||||
|
||||
#column "Order" do |right|
|
||||
#link_to("Place", order_admin_jam_track_right_path(right)) + " | " +
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
|
|||
|
||||
index do
|
||||
|
||||
# default_actions # use this for all view/edit/delete links
|
||||
# actions # use this for all view/edit/delete links
|
||||
column "Actions" do |jam_track|
|
||||
links = ''.html_safe
|
||||
clz = "member_link view_link show_tracks"
|
||||
|
|
@ -35,7 +35,7 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
|
|||
column :name
|
||||
column :onboarding_exceptions do |jam_track|
|
||||
if jam_track.onboarding_exceptions
|
||||
exceptions = JSON.parse(jam_track.onboarding_exceptions)
|
||||
exceptions = jam_track.onboarding_exceptions
|
||||
exceptions.keys.join(',')
|
||||
else
|
||||
''
|
||||
|
|
@ -55,6 +55,7 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
|
|||
column :licensor_royalty_amount
|
||||
column :id
|
||||
|
||||
=begin
|
||||
column :jam_track_tracks do |jam_track|
|
||||
table_for jam_track.jam_track_tracks.order('position ASC') do
|
||||
column :id
|
||||
|
|
@ -77,6 +78,8 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
|
|||
end
|
||||
end
|
||||
end
|
||||
=end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,31 +5,31 @@ ActiveAdmin.register_page "Monthly Stats" do
|
|||
content :title => "Monthly Stats" do
|
||||
h2 "Distinct Users Playing in Sessions"
|
||||
table_for MusicSession.select([:month, :count]).find_by_sql("select date_trunc('month', msuh.created_at)::date as month, count(distinct(user_id)) from music_sessions_user_history msuh group by month order by month desc;") do
|
||||
column "Month", Proc.new { |row| Date.parse(row.month).strftime('%B %Y') }
|
||||
column "Month", Proc.new { |row| row.month.strftime('%B %Y') }
|
||||
column "Users", :count
|
||||
end
|
||||
|
||||
h2 "Music Sessions"
|
||||
table_for MusicSession.select([:month, :count]).find_by_sql("select date_trunc('month', ms.created_at)::date as month, count(id) from music_sessions ms where started_at is not null group by month order by month desc;") do
|
||||
column "Month", Proc.new { |row| Date.parse(row.month).strftime('%B %Y') }
|
||||
column "Month", Proc.new { |row| row.month.strftime('%B %Y') }
|
||||
column "Sessions", :count
|
||||
end
|
||||
|
||||
h2 "Distinct Users Who Played with a JamTrack"
|
||||
table_for MusicSession.select([:month, :count]).find_by_sql("select date_trunc('month', jts.created_at)::date as month, count(distinct(user_id)) from jam_track_sessions jts group by month order by month desc;") do
|
||||
column "Month", Proc.new { |row| Date.parse(row.month).strftime('%B %Y') }
|
||||
column "Month", Proc.new { |row| row.month.strftime('%B %Y') }
|
||||
column "Users", :count
|
||||
end
|
||||
|
||||
h2 "Music Sessions with JamTracks Played"
|
||||
table_for MusicSession.select([:month, :count]).find_by_sql("select date_trunc('month', jts.created_at)::date as month, count(distinct(music_session_id)) from jam_track_sessions jts where session_type = 'session' group by month order by month desc;") do
|
||||
column "Month", Proc.new { |row| Date.parse(row.month).strftime('%B %Y') }
|
||||
column "Month", Proc.new { |row| row.month.strftime('%B %Y') }
|
||||
column "Sessions", :count
|
||||
end
|
||||
|
||||
h2 "JamTrack Web Player Sessions"
|
||||
table_for MusicSession.select([:month, :count]).find_by_sql("select date_trunc('month', jts.created_at)::date as month, count(id) from jam_track_sessions jts where session_type = 'browser' group by month order by month desc;") do
|
||||
column "Month", Proc.new { |row| Date.parse(row.month).strftime('%B %Y') }
|
||||
column "Month", Proc.new { |row| row.month.strftime('%B %Y') }
|
||||
column "Sessions", :count
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
ActiveAdmin.register_page "POSA Card Uploads" do
|
||||
|
||||
menu :label => 'Posa Cards Upload', :parent => 'JamClass'
|
||||
|
||||
page_action :upload_posacards, :method => :post do
|
||||
PosaCard.transaction do
|
||||
|
||||
puts params
|
||||
|
||||
file = params[:jam_ruby_posa_card][:csv]
|
||||
array_of_arrays = CSV.read(file.tempfile.path)
|
||||
array_of_arrays.each do |row|
|
||||
if row.length != 1
|
||||
raise "UKNONWN CSV FORMAT! Must be 1 column"
|
||||
end
|
||||
|
||||
code = row[0]
|
||||
|
||||
posa_card = PosaCard.new
|
||||
posa_card.code = code
|
||||
posa_card.card_type = params[:jam_ruby_posa_card][:card_type]
|
||||
posa_card.origin = file .original_filename
|
||||
posa_card.save!
|
||||
end
|
||||
|
||||
redirect_to admin_posa_card_uploads_path, :notice => "Created #{array_of_arrays.length} POSA cards!"
|
||||
end
|
||||
end
|
||||
|
||||
=begin
|
||||
form :html => {:multipart => true} do |f|
|
||||
f.inputs "Details" do
|
||||
f.input :version, :hint => "Should match Jenkins build number of artifact"
|
||||
f.input :environment, :hint => "Typically just 'public'"
|
||||
f.input :product, :as => :select, :collection => JamRuby::ArtifactUpdate::PRODUCTS
|
||||
end
|
||||
f.inputs "Artifact Upload" do
|
||||
f.input :uri, :as => :file, :hint => "Upload the artifact from Jenkins"
|
||||
end
|
||||
|
||||
f.actions
|
||||
|
||||
end
|
||||
=end
|
||||
|
||||
content do
|
||||
active_admin_form_for PosaCard.new, :url => admin_posa_card_uploads_upload_posacards_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "Upload POSA Cards" do
|
||||
f.input :csv, as: :file, required: true, :label => "A single column CSV that contains ONE type of gift card (5 JamTrack, 10 JamTrack, 4 JamClass etc)"
|
||||
f.input :card_type, required:true, as: :select, :collection => JamRuby::PosaCard::CARD_TYPES
|
||||
|
||||
end
|
||||
f.actions
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ ActiveAdmin.register JamRuby::PromoBuzz, :as => 'Buzz' do
|
|||
column 'State' do |pp| pp.aasm_state end
|
||||
column 'Position' do |pp| pp.position end
|
||||
column 'Updated' do |pp| pp.updated_at end
|
||||
default_actions
|
||||
actions
|
||||
end
|
||||
|
||||
show do
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ ActiveAdmin.register JamRuby::PromoLatest, :as => 'Latest' do
|
|||
column 'State' do |pp| pp.aasm_state end
|
||||
column 'Position' do |pp| pp.position end
|
||||
column 'Updated' do |pp| pp.updated_at end
|
||||
default_actions
|
||||
actions
|
||||
end
|
||||
|
||||
show do
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ ActiveAdmin.register JamRuby::RecurlyTransactionWebHook, :as => 'RecurlyHooks'
|
|||
|
||||
index do
|
||||
|
||||
default_actions
|
||||
actions
|
||||
|
||||
column :transaction_type
|
||||
column :transaction_at
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ ActiveAdmin.register JamRuby::SaleLineItem, :as => 'Sale Line Items' do
|
|||
link_to("#{oo.affiliate_referral.display_name} #{oo.affiliate_referral_fee_in_cents ? "#{oo.affiliate_referral_fee_in_cents}\u00A2" : ''}", oo.affiliate_referral.admin_url, {:title => oo.affiliate_referral.display_name}) if oo.affiliate_referral
|
||||
end
|
||||
column 'User' do |oo|
|
||||
link_to(oo.sale.user.name, admin_user_path(oo.sale.user.id), {:title => oo.sale.user.name})
|
||||
if oo.sale.user
|
||||
link_to(oo.sale.user.name, admin_user_path(oo.sale.user.id), {:title => oo.sale.user.name})
|
||||
end
|
||||
end
|
||||
column 'Source' do |oo|
|
||||
oo.sale.source
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ ActiveAdmin.register_page "Test Jobs" do
|
|||
|
||||
content do
|
||||
|
||||
semantic_form_for LongRunning.new, :url => admin_test_jobs_long_running_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
active_admin_form_for LongRunning.new, :url => admin_test_jobs_long_running_path, :builder => ActiveAdmin::FormBuilder do |f|
|
||||
f.inputs "Queue a long running job" do
|
||||
f.input :time
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
// require jquery.ui.dialog
|
||||
// require jquery.ui.autocomplete
|
||||
//= require cocoon
|
||||
//= require active_admin/application
|
||||
//= require autocomplete-rails
|
||||
//= require active_admin/base
|
||||
//= require jquery-ui/autocomplete
|
||||
// //= require autocomplete-rails
|
||||
//= require base
|
||||
//= require_tree .
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// $sidebar-width: 242px;
|
||||
|
||||
/*
|
||||
*= require jquery.ui.all
|
||||
*= require jquery-ui
|
||||
*= require custom
|
||||
*/
|
||||
// Active Admin's got SASS!
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
* compiled file, but it's generally better to create a new file per style scope.
|
||||
*
|
||||
*= require_self
|
||||
*= require jquery.ui.all
|
||||
*= require jquery-ui
|
||||
*= require_tree .
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class ArtifactsController < ApplicationController
|
|||
ArtifactUpdate.transaction do
|
||||
# VRFS-1071: Postpone client update notification until installer is available for download
|
||||
ArtifactUpdate.connection.execute('SET TRANSACTION ISOLATION LEVEL READ COMMITTED')
|
||||
@artifact = ArtifactUpdate.find_or_create_by_product_and_environment(product, environment)
|
||||
@artifact = ArtifactUpdate.find_or_create_by({product: product, environment: environment})
|
||||
|
||||
@artifact.version = version
|
||||
@artifact.uri = file
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class Cohort < ActiveRecord::Base
|
|||
}
|
||||
|
||||
attr_accessible :all_time, :monthly_start
|
||||
serialize :data_set, JSON
|
||||
#serialize :data_set, JSON
|
||||
|
||||
before_create do
|
||||
self.data_set ||= {}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
= f.input :description, :input_html => { :rows=>5, :maxlength=>1000 }
|
||||
= f.input :plan_code, :label=>'Recurly Plan Code', :required=>true, :hint => 'Must match plan code in Recurly'
|
||||
//= f.input :initial_play_silence, :label => 'Initial Play Silence (seconds)'
|
||||
= f.input :time_signature, collection: JamRuby::JamTrack::TIME_SIGNATURES, include_blank: true
|
||||
= f.input :allow_free, :label => "Allow Free to new Users?"
|
||||
= f.input :status, collection: JamRuby::JamTrack::STATUS, include_blank: false, hint: 'Only set to Production when end users should be able to purchase this JamTrack'
|
||||
= f.input :recording_type, collection: JamRuby::JamTrack::RECORDING_TYPE, include_blank: false
|
||||
= f.input :original_artist, :input_html => { :rows=>1, :maxlength=>1000 }
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ ActiveRecord::Base.establish_connection(YAML::load(File.open('config/database.ym
|
|||
if defined?(Bundler)
|
||||
# If you precompile assets before deploying to production, use this line
|
||||
|
||||
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
||||
Bundler.require(*Rails.groups)
|
||||
# If you want your assets lazily compiled in production, use this line
|
||||
# Bundler.require(:default, :assets, Rails.env)
|
||||
end
|
||||
|
|
@ -22,6 +22,7 @@ Band = JamRuby::Band
|
|||
|
||||
module JamAdmin
|
||||
class Application < Rails::Application
|
||||
config.eager_load = false
|
||||
# Settings in config/environments/* take precedence over those specified here.
|
||||
# Application configuration should go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@ JamAdmin::Application.configure do
|
|||
# Raise exception on mass assignment protection for Active Record models
|
||||
config.active_record.mass_assignment_sanitizer = :strict
|
||||
|
||||
# Log the query plan for queries taking more than this (works
|
||||
# with SQLite, MySQL, and PostgreSQL)
|
||||
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||
|
||||
# Do not compress assets
|
||||
config.assets.compress = false
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
JamAdmin::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
config.eager_load = true
|
||||
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
|
||||
|
|
@ -9,7 +11,7 @@ JamAdmin::Application.configure do
|
|||
config.action_controller.perform_caching = true
|
||||
|
||||
# Disable Rails's static asset server (Apache or nginx will already do this)
|
||||
config.serve_static_assets = false
|
||||
config.serve_static_files = false
|
||||
|
||||
# Compress JavaScripts and CSS
|
||||
config.assets.compress = true
|
||||
|
|
@ -61,10 +63,6 @@ JamAdmin::Application.configure do
|
|||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
# Log the query plan for queries taking more than this (works
|
||||
# with SQLite, MySQL, and PostgreSQL)
|
||||
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||
|
||||
# Set the logging destination(s)
|
||||
config.log_to = %w[file]
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ JamAdmin::Application.configure do
|
|||
config.cache_classes = true
|
||||
|
||||
# Configure static asset server for tests with Cache-Control for performance
|
||||
config.serve_static_assets = true
|
||||
config.serve_static_files = true
|
||||
config.static_cache_control = "public, max-age=3600"
|
||||
|
||||
# Log error messages when you accidentally call methods on nil
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ ActiveAdmin.setup do |config|
|
|||
config.view_factory.footer = Footer
|
||||
|
||||
config.register_javascript 'autocomplete-rails.js'
|
||||
config.register_stylesheet 'jquery.ui.theme.css'
|
||||
config.register_stylesheet 'jquery-ui/theme'
|
||||
|
||||
config.authorization_adapter = "AdminAuthorization"
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ FactoryGirl.define do
|
|||
end
|
||||
|
||||
factory :music_session_user_history, :class => JamRuby::MusicSessionUserHistory do
|
||||
ignore do
|
||||
transient do
|
||||
history nil
|
||||
user nil
|
||||
end
|
||||
|
|
@ -162,7 +162,7 @@ FactoryGirl.define do
|
|||
|
||||
association :creator, factory: :user
|
||||
|
||||
ignore do
|
||||
transient do
|
||||
name "My Music Session"
|
||||
description "Come Music Session"
|
||||
fan_chat true
|
||||
|
|
@ -194,7 +194,7 @@ FactoryGirl.define do
|
|||
end
|
||||
|
||||
factory :latency_tester, :class => JamRuby::LatencyTester do
|
||||
ignore do
|
||||
transient do
|
||||
connection nil
|
||||
make_connection true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Capybara.register_driver :poltergeist do |app|
|
|||
driver = Capybara::Poltergeist::Driver.new(app, { debug: false, phantomjs_logger: File.open('log/phantomjs.out', 'w') })
|
||||
end
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
Capybara.default_wait_time = 10
|
||||
Capybara.default_max_wait_time = 10
|
||||
|
||||
RSpec.configure do |config|
|
||||
# ## Mock Framework
|
||||
|
|
|
|||
11
db/manifest
11
db/manifest
|
|
@ -359,4 +359,13 @@ lesson_time_tracking.sql
|
|||
packaged_test_drive.sql
|
||||
packaged_test_drive2.sql
|
||||
jamclass_report.sql
|
||||
jamblasters_network.sql
|
||||
jamblasters_network.sql
|
||||
immediate_recordings.sql
|
||||
nullable_user_id_jamblaster.sql
|
||||
rails4_migration.sql
|
||||
non_free_jamtracks.sql
|
||||
retailers.sql
|
||||
second_ed.sql
|
||||
second_ed_v2.sql
|
||||
retailers_v2.sql
|
||||
retailer_interest.sql
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE recordings ADD COLUMN immediate BOOLEAN DEFAULT FALSE;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE jam_tracks ADD COLUMN allow_free BOOLEAN DEFAULT TRUE;
|
||||
|
||||
ALTER TABLE lesson_package_purchases DROP CONSTRAINT lesson_package_purchases_lesson_booking_id_fkey;
|
||||
ALTER TABLE lesson_package_purchases ADD CONSTRAINT lesson_package_purchases_lesson_booking_id_fkey FOREIGN KEY (lesson_booking_id) REFERENCES lesson_bookings(id) ON DELETE SET NULL;
|
||||
|
||||
ALTER TABLE lesson_booking_slots DROP CONSTRAINT lesson_booking_slots_lesson_booking_id_fkey;
|
||||
ALTER TABLE lesson_booking_slots ADD CONSTRAINT lesson_booking_slots_lesson_booking_id_fkey FOREIGN KEY (lesson_booking_id) REFERENCES lesson_bookings(id) ON DELETE SET NULL;
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE jamblasters ALTER user_id DROP NOT NULL;
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE music_sessions ALTER COLUMN session_removed_at DROP DEFAULT;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE users ADD COLUMN retailer_interest BOOLEAN DEFAULT FALSE NOT NULL;
|
||||
alter table retailers alter column slug drop not null;
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
CREATE TABLE retailers (
|
||||
id INTEGER PRIMARY KEY,
|
||||
user_id VARCHAR(64) REFERENCES users(id) NOT NULL,
|
||||
name VARCHAR,
|
||||
enabled BOOLEAN DEFAULT TRUE,
|
||||
city VARCHAR,
|
||||
state VARCHAR,
|
||||
slug VARCHAR NOT NULL,
|
||||
encrypted_password VARCHAR NOT NULL DEFAULT uuid_generate_v4(),
|
||||
photo_url VARCHAR(2048),
|
||||
original_fpfile VARCHAR(8000),
|
||||
cropped_fpfile VARCHAR(8000),
|
||||
cropped_s3_path VARCHAR(8000),
|
||||
crop_selection VARCHAR(256),
|
||||
large_photo_url VARCHAR(512),
|
||||
cropped_large_s3_path VARCHAR(512),
|
||||
cropped_large_fpfile VARCHAR(8000),
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE SEQUENCE retailer_key_sequence;
|
||||
ALTER SEQUENCE retailer_key_sequence RESTART WITH 10000;
|
||||
ALTER TABLE retailers ALTER COLUMN id SET DEFAULT nextval('retailer_key_sequence');
|
||||
|
||||
|
||||
CREATE TABLE retailer_invitations (
|
||||
id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id VARCHAR(64) REFERENCES users(id),
|
||||
retailer_id INTEGER REFERENCES retailers(id) NOT NULL,
|
||||
invitation_code VARCHAR(256) NOT NULL UNIQUE,
|
||||
note VARCHAR,
|
||||
email VARCHAR NOT NULL,
|
||||
first_name VARCHAR,
|
||||
last_name VARCHAR,
|
||||
accepted BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE posa_cards (
|
||||
id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
code VARCHAR(64) UNIQUE NOT NULL,
|
||||
user_id VARCHAR (64) REFERENCES users(id) ON DELETE SET NULL,
|
||||
card_type VARCHAR(64) NOT NULL,
|
||||
origin VARCHAR(200),
|
||||
activated_at TIMESTAMP,
|
||||
claimed_at TIMESTAMP,
|
||||
retailer_id INTEGER REFERENCES retailers(id) ON DELETE SET NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX posa_card_user_id_idx ON posa_cards(user_id);
|
||||
|
||||
ALTER TABLE users ADD COLUMN jamclass_credits INTEGER DEFAULT 0;
|
||||
|
||||
|
||||
CREATE TABLE posa_card_types (
|
||||
id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
card_type VARCHAR(64) NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
INSERT INTO posa_card_types (id, card_type) VALUES ('jam_tracks_5', 'jam_tracks_5');
|
||||
INSERT INTO posa_card_types (id, card_type) VALUES ('jam_tracks_10', 'jam_tracks_10');
|
||||
INSERT INTO posa_card_types (id, card_type) VALUES ('jam_class_10', 'jam_class_10');
|
||||
|
||||
CREATE TABLE posa_card_purchases (
|
||||
id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE SET NULL,
|
||||
posa_card_type_id VARCHAR(64) REFERENCES posa_card_types(id) ON DELETE SET NULL,
|
||||
posa_card_id VARCHAR(64) REFERENCES posa_cards(id) ON DELETE SET NULL,
|
||||
recurly_adjustment_uuid VARCHAR(500),
|
||||
recurly_adjustment_credit_uuid VARCHAR(500),
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE sale_line_items ADD COLUMN posa_card_purchase_id VARCHAR(64) REFERENCES posa_card_purchases(id);
|
||||
|
||||
|
||||
ALTER TABLE teachers ADD COLUMN retailer_id INTEGER REFERENCES retailers(id);
|
||||
ALTER TABLE teachers ADD COLUMN joined_retailer_at TIMESTAMP;
|
||||
ALTER TABLE retailers ADD jamkazam_rate NUMERIC (8, 2) DEFAULT 0.25;
|
||||
ALTER TABLE retailers ADD COLUMN affiliate_partner_id INTEGER REFERENCES affiliate_partners(id);
|
||||
ALTER TABLE lesson_bookings ADD COLUMN retailer_id INTEGER REFERENCES retailers(id);
|
||||
ALTER TABLE teacher_payments ADD COLUMN retailer_id INTEGER REFERENCES retailers(id);
|
||||
ALTER TABLE teacher_distributions ADD COLUMN retailer_id INTEGER REFERENCES retailers(id);
|
||||
|
||||
|
||||
ALTER TABLE sales ALTER COLUMN user_id DROP NOT NULL;
|
||||
ALTER TABLE sales ADD COLUMN retailer_id INTEGER REFERENCES retailers(id);
|
||||
ALTER TABLE sale_line_items ADD COLUMN retailer_id INTEGER REFERENCES retailers(id);
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE lesson_bookings ADD COLUMN posa_card_id VARCHAR(64);
|
||||
ALTER TABLE jam_track_rights ADD COLUMN posa_card_id VARCHAR(64);
|
||||
ALTER TABLE lesson_package_purchases ADD COLUMN posa_card_id VARCHAR(64);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE schools ADD COLUMN education BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE teacher_distributions ADD COLUMN education BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE lesson_bookings ADD COLUMN same_school_free BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
UPDATE lesson_bookings SET same_school_free = true where same_school = true;
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE users ADD COLUMN education_interest BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
18
ruby/Gemfile
18
ruby/Gemfile
|
|
@ -16,10 +16,17 @@ else
|
|||
end
|
||||
|
||||
gem 'pg', '0.17.1', :platform => [:mri, :mswin, :mingw]
|
||||
gem 'jdbc_postgres', :platform => [:jruby]
|
||||
#gem 'jdbc_postgres', :platform => [:jruby]
|
||||
|
||||
gem 'activerecord', '> 4.2'
|
||||
gem 'railties', '> 4.2'
|
||||
gem 'actionmailer', '> 4.2'
|
||||
gem 'rails-observers', '0.1.2'
|
||||
gem 'protected_attributes' # needed to support attr_accessible
|
||||
|
||||
gem 'activerecord', '3.2.22'
|
||||
gem "activerecord-import", "~> 0.4.1"
|
||||
|
||||
|
||||
gem 'uuidtools', '2.1.2'
|
||||
gem 'bcrypt-ruby', '3.0.1'
|
||||
gem 'ruby-protocol-buffers', '1.2.2'
|
||||
|
|
@ -27,11 +34,10 @@ gem 'eventmachine', '1.0.4'
|
|||
gem 'amqp', '1.0.2'
|
||||
gem 'kickbox'
|
||||
gem 'will_paginate'
|
||||
gem 'actionmailer', '3.2.22'
|
||||
gem 'sendgrid', '1.2.0'
|
||||
gem 'aws-sdk', '~> 1'
|
||||
gem 'carrierwave', '0.9.0'
|
||||
gem 'aasm', '3.0.16'
|
||||
gem 'aasm'
|
||||
gem 'devise', '3.3.0' # 3.4.0 causes: uninitialized constant ActionController::Metal (NameError)
|
||||
gem 'postgres-copy'
|
||||
gem 'geokit'
|
||||
|
|
@ -60,10 +66,10 @@ gem 'email_validator'
|
|||
group :test do
|
||||
gem 'simplecov', '~> 0.7.1'
|
||||
gem 'simplecov-rcov'
|
||||
gem 'factory_girl', '4.1.0'
|
||||
gem 'factory_girl', '4.5.0'
|
||||
gem "rspec", "2.11"
|
||||
gem 'spork', '0.9.0'
|
||||
gem 'database_cleaner', '1.3.0'
|
||||
gem 'database_cleaner', '1.4.1'
|
||||
gem 'faker', '1.3.0'
|
||||
gem 'resque_spec' #, :path => "/home/jam/src/resque_spec/"
|
||||
gem 'timecop'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
require "pg"
|
||||
require "active_record"
|
||||
require "rails/railtie"
|
||||
require "protected_attributes"
|
||||
require "rails-observers"
|
||||
require "rails/observers/active_model"
|
||||
require "rails/observers/activerecord/active_record"
|
||||
require "carrierwave"
|
||||
require "carrierwave/orm/activerecord"
|
||||
require "jampb"
|
||||
|
|
@ -25,6 +30,7 @@ require 'stripe'
|
|||
require 'zip-codes'
|
||||
require 'email_validator'
|
||||
|
||||
ActiveRecord::Base.raise_in_transactional_callbacks = true
|
||||
require "jam_ruby/lib/timezone"
|
||||
require "jam_ruby/constants/limits"
|
||||
require "jam_ruby/constants/notification_types"
|
||||
|
|
@ -224,7 +230,7 @@ require "jam_ruby/models/jam_track_hfa_request"
|
|||
require "jam_ruby/models/jam_track_hfa_request_id"
|
||||
require "jam_ruby/models/jam_track_track"
|
||||
require "jam_ruby/models/jam_track_right"
|
||||
require "jam_ruby/models/jam_track_tap_in"
|
||||
#require "jam_ruby/models/jam_track_tap_in" # consider deletion
|
||||
require "jam_ruby/models/jam_track_file"
|
||||
require "jam_ruby/models/jam_track_mixdown"
|
||||
require "jam_ruby/models/jam_track_mixdown_package"
|
||||
|
|
@ -274,6 +280,9 @@ require "jam_ruby/models/subject"
|
|||
require "jam_ruby/models/band_search"
|
||||
require "jam_ruby/import/tency_stem_mapping"
|
||||
require "jam_ruby/models/jam_track_search"
|
||||
require "jam_ruby/models/posa_card"
|
||||
require "jam_ruby/models/posa_card_type"
|
||||
require "jam_ruby/models/posa_card_purchase"
|
||||
require "jam_ruby/models/gift_card"
|
||||
require "jam_ruby/models/gift_card_purchase"
|
||||
require "jam_ruby/models/gift_card_type"
|
||||
|
|
@ -299,6 +308,8 @@ require "jam_ruby/models/affiliate_distribution"
|
|||
require "jam_ruby/models/teacher_intent"
|
||||
require "jam_ruby/models/school"
|
||||
require "jam_ruby/models/school_invitation"
|
||||
require "jam_ruby/models/retailer"
|
||||
require "jam_ruby/models/retailer_invitation"
|
||||
require "jam_ruby/models/teacher_instrument"
|
||||
require "jam_ruby/models/teacher_subject"
|
||||
require "jam_ruby/models/teacher_language"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ module JamRuby
|
|||
class CorpMailer < ActionMailer::Base
|
||||
include SendGrid
|
||||
|
||||
layout "user_mailer"
|
||||
layout "raw_mailer"
|
||||
|
||||
DEFAULT_SENDER = "JamKazam <noreply@jamkazam.com>"
|
||||
|
||||
|
|
|
|||
|
|
@ -49,9 +49,27 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
def student_education_welcome_message(user)
|
||||
@user = user
|
||||
@subject = "Welcome to JamKazam and JamClass online lessons!"
|
||||
@education = user.school && user.school.education
|
||||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_message"
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
sendgrid_substitute(EmailBatchProgression::VAR_FIRST_NAME, [user.first_name])
|
||||
|
||||
mail(:to => user.email, :subject => @subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def student_welcome_message(user)
|
||||
@user = user
|
||||
@subject = "Welcome to JamKazam and JamClass online lessons!"
|
||||
@education = user.school && user.school.education
|
||||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_message"
|
||||
|
||||
|
|
@ -68,6 +86,9 @@ module JamRuby
|
|||
def teacher_welcome_message(user)
|
||||
@user = user
|
||||
@subject= "Welcome to JamKazam and JamClass online lessons!"
|
||||
|
||||
@education = user.teacher && user.teacher.school && user.teacher.school.education
|
||||
|
||||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_message"
|
||||
|
||||
|
|
@ -97,6 +118,38 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
def retailer_owner_welcome_message(user)
|
||||
@user = user
|
||||
@subject= "Welcome to JamKazam!"
|
||||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_message"
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
sendgrid_substitute(EmailBatchProgression::VAR_FIRST_NAME, [user.first_name])
|
||||
|
||||
mail(:to => user.email, :subject => @subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def education_owner_welcome_message(user)
|
||||
@user = user
|
||||
@subject= "Welcome to JamKazam and JamClass online lessons!"
|
||||
sendgrid_category "Welcome"
|
||||
sendgrid_unique_args :type => "welcome_message"
|
||||
|
||||
sendgrid_recipients([user.email])
|
||||
sendgrid_substitute('@USERID', [user.id])
|
||||
sendgrid_substitute(EmailBatchProgression::VAR_FIRST_NAME, [user.first_name])
|
||||
|
||||
mail(:to => user.email, :subject => @subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def password_changed(user)
|
||||
@user = user
|
||||
|
||||
|
|
@ -166,6 +219,8 @@ module JamRuby
|
|||
def friend_request(user, msg, friend_request_id)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "You have a new friend request on JamKazam"
|
||||
unique_args = {:type => "friend_request"}
|
||||
|
|
@ -187,6 +242,8 @@ module JamRuby
|
|||
def friend_request_accepted(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "You have a new friend on JamKazam"
|
||||
unique_args = {:type => "friend_request_accepted"}
|
||||
|
|
@ -207,6 +264,8 @@ module JamRuby
|
|||
def new_user_follower(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "You have a new follower on JamKazam"
|
||||
unique_args = {:type => "new_user_follower"}
|
||||
|
|
@ -227,6 +286,8 @@ module JamRuby
|
|||
def new_band_follower(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "Your band has a new follower on JamKazam"
|
||||
unique_args = {:type => "new_band_follower"}
|
||||
|
|
@ -247,6 +308,9 @@ module JamRuby
|
|||
def session_invitation(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "You have been invited to a session on JamKazam"
|
||||
unique_args = {:type => "session_invitation"}
|
||||
|
|
@ -267,6 +331,9 @@ module JamRuby
|
|||
def musician_session_join(user, msg, session_id)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Someone you know is in a session on JamKazam"
|
||||
unique_args = {:type => "musician_session_join"}
|
||||
|
|
@ -287,6 +354,9 @@ module JamRuby
|
|||
def scheduled_session_invitation(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Session Invitation"
|
||||
unique_args = {:type => "scheduled_session_invitation"}
|
||||
|
|
@ -309,6 +379,7 @@ module JamRuby
|
|||
def scheduled_session_rsvp(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
email = user.email
|
||||
subject = "Session RSVP"
|
||||
unique_args = {:type => "scheduled_session_rsvp"}
|
||||
|
|
@ -331,6 +402,9 @@ module JamRuby
|
|||
def scheduled_session_rsvp_approved(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Session RSVP Approved"
|
||||
unique_args = {:type => "scheduled_session_rsvp_approved"}
|
||||
|
|
@ -353,6 +427,9 @@ module JamRuby
|
|||
def scheduled_session_rsvp_cancelled(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Session RSVP Cancelled"
|
||||
unique_args = {:type => "scheduled_session_rsvp_cancelled"}
|
||||
|
|
@ -375,6 +452,9 @@ module JamRuby
|
|||
def scheduled_session_rsvp_cancelled_org(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Your Session RSVP Cancelled"
|
||||
unique_args = {:type => "scheduled_session_rsvp_cancelled_org"}
|
||||
|
|
@ -397,6 +477,8 @@ module JamRuby
|
|||
def scheduled_session_cancelled(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "Session Cancelled"
|
||||
unique_args = {:type => "scheduled_session_cancelled"}
|
||||
|
|
@ -419,6 +501,9 @@ module JamRuby
|
|||
def scheduled_session_rescheduled(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Session Rescheduled"
|
||||
unique_args = {:type => "scheduled_session_rescheduled"}
|
||||
|
|
@ -439,12 +524,16 @@ module JamRuby
|
|||
end
|
||||
|
||||
def scheduled_session_reminder_upcoming(user, session)
|
||||
@user = user
|
||||
|
||||
subject = "Your JamKazam session starts in 1 hour!"
|
||||
unique_args = {:type => "scheduled_session_reminder_upcoming"}
|
||||
send_scheduled_session_reminder(user, session, subject, unique_args)
|
||||
end
|
||||
|
||||
def scheduled_session_reminder_day(user, session)
|
||||
@user = user
|
||||
|
||||
subject = "JamKazam Session Reminder"
|
||||
unique_args = {:type => "scheduled_session_reminder_day"}
|
||||
send_scheduled_session_reminder(user, session, subject, unique_args)
|
||||
|
|
@ -473,6 +562,9 @@ module JamRuby
|
|||
def scheduled_session_comment(target_user, sender, msg, comment, session)
|
||||
return if !target_user.subscribe_email
|
||||
|
||||
@user = target_user
|
||||
|
||||
|
||||
email = target_user.email
|
||||
subject = "New Session Comment"
|
||||
unique_args = {:type => "scheduled_session_comment"}
|
||||
|
|
@ -520,6 +612,8 @@ module JamRuby
|
|||
subject = "A band that you follow has joined a session"
|
||||
unique_args = {:type => "band_session_join"}
|
||||
|
||||
@user = user
|
||||
|
||||
@body = msg
|
||||
@session_url = "#{APP_CONFIG.external_root_url}/sessions/#{session_id}"
|
||||
sendgrid_category "Notification"
|
||||
|
|
@ -537,6 +631,9 @@ module JamRuby
|
|||
def musician_recording_saved(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "A musician has saved a new recording on JamKazam"
|
||||
unique_args = {:type => "musician_recording_saved"}
|
||||
|
|
@ -557,6 +654,9 @@ module JamRuby
|
|||
def band_recording_saved(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "A band has saved a new recording on JamKazam"
|
||||
unique_args = {:type => "band_recording_saved"}
|
||||
|
|
@ -577,6 +677,8 @@ module JamRuby
|
|||
def band_invitation(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "You have been invited to join a band on JamKazam"
|
||||
unique_args = {:type => "band_invitation"}
|
||||
|
|
@ -597,6 +699,9 @@ module JamRuby
|
|||
def band_invitation_accepted(user, msg)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
|
||||
email = user.email
|
||||
subject = "Your band invitation was accepted"
|
||||
unique_args = {:type => "band_invitation_accepted"}
|
||||
|
|
@ -618,6 +723,8 @@ module JamRuby
|
|||
def text_message(user, sender_id, sender_name, sender_photo_url, message)
|
||||
return if !user.subscribe_email
|
||||
|
||||
@user = user
|
||||
|
||||
email = user.email
|
||||
subject = "Message from #{sender_name}"
|
||||
unique_args = {:type => "text_message"}
|
||||
|
|
@ -640,6 +747,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def student_lesson_request(lesson_booking)
|
||||
@user = lesson_booking.user
|
||||
email = lesson_booking.user.email
|
||||
subject = "You have sent a lesson request to #{lesson_booking.teacher.name}!"
|
||||
unique_args = {:type => "student_lesson_request"}
|
||||
|
|
@ -666,6 +774,7 @@ module JamRuby
|
|||
unique_args = {:type => "teacher_lesson_request"}
|
||||
|
||||
@sender = lesson_booking.user
|
||||
@user = lesson_booking.user
|
||||
@lesson_booking = lesson_booking
|
||||
|
||||
sendgrid_category "Notification"
|
||||
|
|
@ -693,6 +802,7 @@ module JamRuby
|
|||
end
|
||||
@lesson_session = lesson_session
|
||||
@message = message
|
||||
@user = lesson_session.student
|
||||
email = lesson_session.student.email
|
||||
unique_args = {:type => "student_lesson_accepted"}
|
||||
|
||||
|
|
@ -722,6 +832,7 @@ module JamRuby
|
|||
|
||||
@lesson_session = lesson_session
|
||||
@message = message
|
||||
@user = lesson_session.teacher
|
||||
email = lesson_session.school_and_teacher
|
||||
unique_args = {:type => "teacher_lesson_accepted"}
|
||||
|
||||
|
|
@ -750,6 +861,7 @@ module JamRuby
|
|||
end
|
||||
@lesson_session = lesson_session
|
||||
@message = message
|
||||
@user = lesson_session.student
|
||||
email = lesson_session.student.email
|
||||
unique_args = {:type => "student_lesson_accepted"}
|
||||
|
||||
|
|
@ -777,6 +889,8 @@ module JamRuby
|
|||
subject = "All lesson times changed with #{lesson_session.student.name}!"
|
||||
end
|
||||
|
||||
|
||||
@user = lesson_session.teacher
|
||||
@lesson_session = lesson_session
|
||||
@message = message
|
||||
email = lesson_session.school_and_teacher
|
||||
|
|
@ -797,8 +911,10 @@ module JamRuby
|
|||
def teacher_scheduled_jamclass_invitation(user, msg, session)
|
||||
|
||||
email = user.email
|
||||
|
||||
@subject = "#{session.lesson_session.lesson_booking.display_type2.capitalize} JamClass Scheduled with #{session.lesson_session.student.name}"
|
||||
unique_args = {:type => "scheduled_jamclass_invitation"}
|
||||
@user = session.lesson_session.student
|
||||
@student = session.lesson_session.student
|
||||
@teacher = session.lesson_session.teacher
|
||||
@body = msg
|
||||
|
|
@ -819,11 +935,11 @@ module JamRuby
|
|||
end
|
||||
|
||||
def student_scheduled_jamclass_invitation(user, msg, session)
|
||||
return if !user.subscribe_email
|
||||
|
||||
email = user.email
|
||||
@subject = "#{session.lesson_session.lesson_booking.display_type2.capitalize} JamClass Scheduled with #{session.lesson_session.teacher.name}"
|
||||
unique_args = {:type => "scheduled_jamclass_invitation"}
|
||||
@user = session.lesson_session.student
|
||||
@student = session.lesson_session.student
|
||||
@teacher = session.lesson_session.teacher
|
||||
@body = msg
|
||||
|
|
@ -846,6 +962,7 @@ module JamRuby
|
|||
# teacher proposed counter time; so send msg to the student
|
||||
def student_lesson_counter(lesson_session, slot)
|
||||
|
||||
@user = lesson_session.student
|
||||
email = lesson_session.student.email
|
||||
subject = "Instructor has proposed a different time for your lesson"
|
||||
unique_args = {:type => "student_lesson_counter"}
|
||||
|
|
@ -871,6 +988,7 @@ module JamRuby
|
|||
# student proposed counter time; so send msg to the teacher
|
||||
def teacher_lesson_counter(lesson_session, slot)
|
||||
|
||||
@user = lesson_session.teacher
|
||||
email = lesson_session.school_over_teacher
|
||||
subject = "Student has proposed a different time for their lesson"
|
||||
unique_args = {:type => "teacher_lesson_counter"}
|
||||
|
|
@ -901,6 +1019,7 @@ module JamRuby
|
|||
@session_date = lesson_session.slot.pretty_scheduled_start(true)
|
||||
@session_url = lesson_session.web_url
|
||||
@lesson_session = lesson_session
|
||||
@user = lesson_session.teacher
|
||||
email = lesson_session.school_and_teacher
|
||||
if @lesson_session.student_missed
|
||||
subject = "You will be paid for your lesson with #{@student.name}"
|
||||
|
|
@ -934,8 +1053,22 @@ module JamRuby
|
|||
@session_url = lesson_session.web_url
|
||||
@lesson_session = lesson_session
|
||||
|
||||
@user = lesson_session.student
|
||||
email = @student.email
|
||||
subject = "You have used #{@student.used_test_drives} of #{@student.total_test_drives} TestDrive lesson credits"
|
||||
|
||||
|
||||
if lesson_session.posa_card
|
||||
@total_credits = @student.total_posa_credits
|
||||
@used_credits = @student.used_posa_credits
|
||||
@remaining_credits = @student.jamclass_credits
|
||||
else
|
||||
@total_credits = @student.total_test_drives
|
||||
@used_credits = @student.used_test_drives
|
||||
@remaining_credits = @student.remaining_test_drives
|
||||
end
|
||||
|
||||
subject = "You have used #{@used_credits} of #{@total_credits} TestDrive lesson credits"
|
||||
|
||||
unique_args = {:type => "student_test_drive_success"}
|
||||
|
||||
sendgrid_category "Notification"
|
||||
|
|
@ -951,6 +1084,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def teacher_test_drive_no_bill(lesson_session)
|
||||
@user = lesson_session.teacher
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -976,6 +1110,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def student_test_drive_no_bill(lesson_session)
|
||||
@user = lesson_session.student
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1003,6 +1138,7 @@ module JamRuby
|
|||
# successfully completed, but no more test drives left
|
||||
def student_test_drive_lesson_done(lesson_session)
|
||||
|
||||
@user = lesson_session.student
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1028,6 +1164,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def student_lesson_normal_no_bill(lesson_session)
|
||||
@user = lesson_session.student
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1053,6 +1190,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def teacher_lesson_normal_no_bill(lesson_session)
|
||||
@user = lesson_session.teacher
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1077,6 +1215,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def student_lesson_normal_done(lesson_session)
|
||||
@user = lesson_session.student
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1102,6 +1241,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def teacher_lesson_normal_done(lesson_session)
|
||||
@user = lesson_session.teacher
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1126,6 +1266,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def student_unable_charge(lesson_session)
|
||||
@user = lesson_session.student
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1154,6 +1295,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def teacher_unable_charge(lesson_session)
|
||||
@user = lesson_session.teacher
|
||||
@student = lesson_session.student
|
||||
@teacher = lesson_session.teacher
|
||||
@session_name = lesson_session.music_session.name
|
||||
|
|
@ -1179,6 +1321,7 @@ module JamRuby
|
|||
|
||||
def student_unable_charge_monthly(lesson_package_purchase)
|
||||
lesson_booking = lesson_package_purchase.lesson_booking
|
||||
@user = lesson_booking.student
|
||||
@student = lesson_booking.student
|
||||
@teacher = lesson_booking.teacher
|
||||
@lesson_package_purchase = lesson_package_purchase
|
||||
|
|
@ -1211,6 +1354,7 @@ module JamRuby
|
|||
|
||||
def teacher_unable_charge_monthly(lesson_package_purchase)
|
||||
lesson_booking = lesson_package_purchase.lesson_booking
|
||||
@user = lesson_booking.teacher
|
||||
@student = lesson_booking.student
|
||||
@teacher = lesson_booking.teacher
|
||||
@lesson_package_purchase = lesson_package_purchase
|
||||
|
|
@ -1244,6 +1388,7 @@ module JamRuby
|
|||
|
||||
def student_lesson_monthly_charged(lesson_package_purchase)
|
||||
lesson_booking = lesson_package_purchase.lesson_booking
|
||||
@user = lesson_booking.student
|
||||
@student = lesson_booking.student
|
||||
@teacher = lesson_booking.teacher
|
||||
@lesson_package_purchase = lesson_package_purchase
|
||||
|
|
@ -1271,6 +1416,7 @@ module JamRuby
|
|||
|
||||
def teacher_lesson_monthly_charged(lesson_package_purchase)
|
||||
lesson_booking = lesson_package_purchase.lesson_booking
|
||||
@user = lesson_booking.teacher
|
||||
@student = lesson_booking.student
|
||||
@teacher = lesson_booking.teacher
|
||||
@lesson_package_purchase = lesson_package_purchase
|
||||
|
|
@ -1312,6 +1458,7 @@ module JamRuby
|
|||
@name = @teacher.first_name || 'Anonymous'
|
||||
@student = @distribution.student
|
||||
email = @distribution.target.lesson_booking.school_over_teacher
|
||||
@user = @teacher
|
||||
|
||||
if @school
|
||||
if @distribution.is_test_drive?
|
||||
|
|
@ -1359,6 +1506,7 @@ module JamRuby
|
|||
@student = @distribution.student
|
||||
@name = @payable_teacher.first_name || 'Anonymous'
|
||||
email = @distribution.target.lesson_booking.school_over_teacher
|
||||
@user = @teacher
|
||||
|
||||
@card_declined = teacher_payment.is_card_declined?
|
||||
@card_expired = teacher_payment.is_card_expired?
|
||||
|
|
@ -1410,6 +1558,7 @@ module JamRuby
|
|||
@payable_teacher = @school.owner
|
||||
@name = @payable_teacher.first_name || 'Anonymous'
|
||||
@student = @distribution.student
|
||||
@user = @teacher
|
||||
email = @payable_teacher.email
|
||||
|
||||
if @distribution.is_test_drive?
|
||||
|
|
@ -1445,6 +1594,7 @@ module JamRuby
|
|||
@session_date = lesson_session.slot.pretty_scheduled_start(true)
|
||||
@session_url = lesson_session.web_url
|
||||
@lesson_session = lesson_session
|
||||
@user = @student
|
||||
|
||||
email = @student.email
|
||||
subject = "Your JamClass lesson today with #{@teacher.first_name}"
|
||||
|
|
@ -1470,6 +1620,7 @@ module JamRuby
|
|||
@session_date = lesson_session.slot.pretty_scheduled_start(true)
|
||||
@session_url = lesson_session.web_url
|
||||
@lesson_session = lesson_session
|
||||
@user = @student
|
||||
|
||||
email = @student.email
|
||||
subject = "Your lesson with #{@teacher.name} will not be billed"
|
||||
|
|
@ -1497,6 +1648,7 @@ module JamRuby
|
|||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
email = @student.email
|
||||
@user = @student
|
||||
@subject = "We're sorry your lesson request has been declined"
|
||||
unique_args = {:type => "student_lesson_booking_declined"}
|
||||
|
||||
|
|
@ -1521,6 +1673,7 @@ module JamRuby
|
|||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
email = @student.email
|
||||
@user = @student
|
||||
@subject = "Your lesson has been canceled"
|
||||
unique_args = {:type => "student_lesson_booking_canceled"}
|
||||
|
||||
|
|
@ -1544,7 +1697,7 @@ module JamRuby
|
|||
@session_name = @lesson_session.music_session.name
|
||||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
|
||||
@user = @teacher
|
||||
email = @lesson_booking.school_and_teacher
|
||||
@subject = "Your lesson has been canceled"
|
||||
unique_args = {:type => "teacher_lesson_booking_canceled"}
|
||||
|
|
@ -1570,6 +1723,7 @@ module JamRuby
|
|||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
email = @student.email
|
||||
@user = @student
|
||||
@subject = "Your lesson has been canceled"
|
||||
unique_args = {:type => "student_lesson_canceled"}
|
||||
|
||||
|
|
@ -1594,6 +1748,7 @@ module JamRuby
|
|||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
|
||||
@user = @teacher
|
||||
email = @lesson_booking.school_and_teacher
|
||||
@subject = "Your lesson has been canceled"
|
||||
unique_args = {:type => "teacher_lesson_canceled"}
|
||||
|
|
@ -1609,6 +1764,26 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
def invite_retailer_teacher(retailer_invitations)
|
||||
@retailer_invitation = retailer_invitations
|
||||
@retailer = retailer_invitations.retailer
|
||||
|
||||
email = retailer_invitations.email
|
||||
@subject = "#{@retailer.owner.name} has sent you an invitation to join #{@retailer.name} on JamKazam"
|
||||
unique_args = {:type => "invite_retailer_teacher"}
|
||||
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
sendgrid_recipients([email])
|
||||
|
||||
@suppress_user_has_account_footer = true
|
||||
|
||||
mail(:to => email, :subject => @subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def invite_school_teacher(school_invitation)
|
||||
@school_invitation = school_invitation
|
||||
@school = school_invitation.school
|
||||
|
|
@ -1657,7 +1832,7 @@ module JamRuby
|
|||
@session_name = @lesson_session.music_session.name
|
||||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
|
||||
@user = @target
|
||||
email = @lesson_session.school_over_teacher
|
||||
@subject = "#{@sender.name} has sent you a message about a lesson"
|
||||
unique_args = {:type => "lesson_chat"}
|
||||
|
|
@ -1679,7 +1854,7 @@ module JamRuby
|
|||
@teacher = lesson_session.teacher
|
||||
@session_url = lesson_session.web_url
|
||||
@lesson_session = lesson_session
|
||||
|
||||
@user = @student
|
||||
email = @student.email
|
||||
@subject = "Instructor's time proposal is still awaiting your response"
|
||||
unique_args = {:type => "student_counter_reminder"}
|
||||
|
|
@ -1705,6 +1880,7 @@ module JamRuby
|
|||
@session_date = lesson_session.slot.pretty_scheduled_start(true)
|
||||
@session_url = lesson_session.web_url
|
||||
@lesson_session = lesson_session
|
||||
@user = @teacher
|
||||
email = lesson_session.school_over_teacher
|
||||
@subject = "Student #{@student.name}'s time proposal is still awaiting your response"
|
||||
unique_args = {:type => "teacher_counter_reminder"}
|
||||
|
|
@ -1731,6 +1907,7 @@ module JamRuby
|
|||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
|
||||
@user = @teacher
|
||||
email = @teacher.email
|
||||
@subject = "Your lesson with #{@student.first_name} on JamKazam is starting soon"
|
||||
unique_args = {:type => "send_starting_notice_teacher"}
|
||||
|
|
@ -1755,7 +1932,7 @@ module JamRuby
|
|||
@session_name = @lesson_session.music_session.name
|
||||
@session_description = @lesson_session.music_session.description
|
||||
@session_date = @lesson_session.slot.pretty_scheduled_start(true)
|
||||
|
||||
@user = @student
|
||||
email = @student.email
|
||||
@subject = "Your lesson with #{@teacher.first_name} on JamKazam is starting soon"
|
||||
unique_args = {:type => "send_starting_notice_student"}
|
||||
|
|
@ -1777,7 +1954,7 @@ module JamRuby
|
|||
@lesson_session = lesson_session
|
||||
@attachment = attachment
|
||||
|
||||
|
||||
@user = target
|
||||
email = target.email
|
||||
@subject = "An attachment has been added to your lesson by #{sender.name}"
|
||||
unique_args = {:type => "lesson_attachment"}
|
||||
|
|
@ -1791,7 +1968,22 @@ module JamRuby
|
|||
format.text
|
||||
format.html { render :layout => "from_user_mailer" }
|
||||
end
|
||||
end
|
||||
|
||||
def retailer_customer_blast(email, retailer)
|
||||
@retailer = retailer
|
||||
@subject = "Check out our teachers at #{@retailer.name}"
|
||||
unique_args = {:type => "retailer_customer_email"}
|
||||
|
||||
sendgrid_category "Notification"
|
||||
sendgrid_unique_args :type => unique_args[:type]
|
||||
sendgrid_recipients([email])
|
||||
|
||||
@suppress_user_has_account_footer = true
|
||||
mail(:to => email, :subject => @subject) do |format|
|
||||
format.text
|
||||
format.html
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
|
||||
<% if !@user.anonymous? %>
|
||||
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
Thank you for expressing an interest in exploring our secondary education partner program! A member of our staff will
|
||||
reach out to you shortly to chat with you and answer any questions you have about our partner program, our
|
||||
technologies, and how we can help you continue to deliver the best possible music education to your students.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It takes less than 1 hour of your time to set up your music program to partner with JamKazam. And we are happy to walk
|
||||
you through the process step by step, so you don't have to worry about figuring out how to do this. But if you're
|
||||
curious, then you can check out our
|
||||
<a href="https://jamkazam.desk.com/customer/en/portal/topics/985544-jamclass-online-music-lessons---for-secondary-education-music-program-directors/articles" style="color:#fc0">help
|
||||
articles for music program directors</a>. These help articles explain things from
|
||||
the perspective of the school program director - e.g. how to set up your school, how to invite teachers and students
|
||||
to sign up if they wish, how distributions are made into your booster fund, and so on.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
JamKazam handles all the technical support needed to help your students, as well as any preferred teachers associated
|
||||
with your music program, to get set up and ready to go. We even get into a sample online session with each individual
|
||||
to make sure everything is working, and to show them around the features they'll use in online lessons. But if you are
|
||||
curious about how it all works, you can also review our <a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles">help guide for students</a> and our <a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles">help guide for teachers</a>.
|
||||
</p>
|
||||
<p>
|
||||
Thanks again for connecting with us, and we look forward to speaking with you soon!
|
||||
</p>
|
||||
<p>Best Regards,<br/>
|
||||
Team JamKazam</p>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<% if !@user.anonymous? %>
|
||||
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %>
|
||||
<% end %>
|
||||
|
||||
Thank you for expressing an interest in exploring our secondary education partner program! A member of our staff will
|
||||
reach out to you shortly to chat with you and answer any questions you have about our partner program, our
|
||||
technologies, and how we can help you continue to deliver the best possible music education to your students.
|
||||
|
||||
It takes less than 1 hour of your time to set up your music program to partner with JamKazam. And we are happy to walk
|
||||
you through the process step by step, so you don't have to worry about figuring out how to do this. But if you're
|
||||
curious, then you can check out our help articles for music program directors -- https://jamkazam.desk.com/customer/en/portal/topics/985544-jamclass-online-music-lessons---for-secondary-education-music-program-directors/articles. These help articles explain things from
|
||||
the perspective of the school program director - e.g. how to set up your school, how to invite teachers and students
|
||||
to sign up if they wish, how distributions are made into your booster fund, and so on.
|
||||
|
||||
JamKazam handles all the technical support needed to help your students, as well as any preferred teachers associated
|
||||
with your music program, to get set up and ready to go. We even get into a sample online session with each individual
|
||||
to make sure everything is working, and to show them around the features they'll use in online lessons. But if you are
|
||||
curious about how it all works, you can also review our help guide for students -- https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles and our help
|
||||
guide for teachers -- https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles.
|
||||
Best Regards,
|
||||
Team JamKazam
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
Hello <%= @retailer_invitation.first_name %> -
|
||||
<p><%= @retailer.owner.first_name %> is using JamKazam to deliver online music lessons, and has sent you this invitation so that you can
|
||||
register to take online music lessons with <%= @retailer.name %>. To accept this invitation, please click the SIGN UP NOW
|
||||
button below, and follow the instructions on the web page to which you are taken. Thanks, and on behalf of
|
||||
<%= @retailer.name %>, welcome to JamKazam!</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="<%= @retailer_invitation.generate_signup_url %>" style="margin: 8px 0 0 0;background-color: #ed3618;border: solid 1px #F27861;padding: 3px 10px;font-size: 12px;font-weight: 300;cursor: pointer;color: #FC9;text-decoration: none;line-height: 12px;text-align: center;">SIGN
|
||||
UP NOW</a>
|
||||
</p>
|
||||
<br/>
|
||||
<br/>
|
||||
Best Regards,<br>
|
||||
Team JamKazam
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
Hello <%= @retailer_invitation.first_name %> -
|
||||
<br/>
|
||||
<p>
|
||||
<%= @retailer.owner.first_name %> has set up <%= @retailer.name %> on JamKazam, enabling you to deliver online music
|
||||
lessons in an amazing new way that really works. To accept this invitation, please click the SIGN UP NOW button below,
|
||||
and follow the instructions on the web page to which you are taken. Thanks, and welcome to JamKazam!</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="<%= @retailer_invitation.generate_signup_url %>" style="margin: 8px 0 0 0;background-color: #ed3618;border: solid 1px #F27861;padding: 3px 10px;font-size: 12px;font-weight: 300;cursor: pointer;color: #FC9;text-decoration: none;line-height: 12px;text-align: center;">SIGN
|
||||
UP NOW</a>
|
||||
</p>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
Best Regards,<br>
|
||||
Team JamKazam
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
Hello <%= @retailer_invitation.first_name %> -
|
||||
<%= @retailer.owner.first_name %> has set up <%= @retailer.name %> on JamKazam, enabling you to deliver online music
|
||||
lessons in an amazing new way that really works. To accept this invitation, please click the link below,
|
||||
and follow the instructions on the web page to which you are taken. Thanks, and welcome to JamKazam!
|
||||
|
||||
<%= @retailer_invitation.generate_signup_url %>
|
||||
|
||||
Best Regards,
|
||||
Team JamKazam
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
<p>Click the link of each teacher's profile at <%= @retailer.name %> to find the best fit for you:</p>
|
||||
<ul>
|
||||
<% @retailer.teachers.each do |teacher| %>
|
||||
<li><a href="<%= teacher.user.teacher_profile_url%>" style="color:#fc0"><%= teacher.user.name %></a><br/><%= teacher.teaches %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
Check out each teacher's profile at <%= @retailer.name %> to find the best fit for you:
|
||||
|
||||
<% @retailer.teachers.each do |teacher| %>
|
||||
<%= teacher.user.name %>: <%= teacher.user.teacher_profile_url%> (<%= teacher.teaches %>)
|
||||
<% end %>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
|
||||
<% if !@user.anonymous? %>
|
||||
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
Thank you for expressing an interest in exploring our retailer partner program! A member of our staff will reach out to you shortly to chat with you and answer any/all questions you may have about our partner program and our technologies.
|
||||
</p>
|
||||
|
||||
<p>Best Regards,<br/>
|
||||
Team JamKazam</p>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<% if !@user.anonymous? %>
|
||||
Hello <%= EmailBatchProgression::VAR_FIRST_NAME %>
|
||||
<% end %>
|
||||
|
||||
Thank you for expressing an interest in exploring our retailer partner program! A member of our staff will reach out to you shortly to chat with you and answer any/all questions you may have about our partner program and our technologies.
|
||||
|
||||
Best Regards,
|
||||
Team JamKazam
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<% provide(:title, @subject) %>
|
||||
|
||||
|
||||
<% if !@user.anonymous? %>
|
||||
<p>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if @education %>
|
||||
<p>
|
||||
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology was built from the ground up for playing music live in sync with studio quality audio from different locations over the Internet, and for delivering amazing online music lessons.
|
||||
</p>
|
||||
<p>
|
||||
To get ready to take JamClass lessons online, here are the things you'll want to do:
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">1. Set Up Your Gear</b><br/>
|
||||
When you sign up, someone from JamKazam will get in touch with you via email within a couple of business days to help you get set up. If you don't hear from us within a couple of days, please email us at <a style="color:#fc0" href="mailto:support@jamkazam.com">support@jamkazam.com</a> or call us at <a href="tel:+18773768742" style="color:#fc0">1-877-376-8742</a>. To play in online lessons, you will need at a minimum: (1) a Windows or Mac computer; (2) normal home Internet service; and (3) a pair of headphones or earbuds you can plug into the headphone minijack on your computer. If you would like to benefit from studio quality audio (recommended) in your lessons, JamKazam offers an amazing audio package for just $49.99 (less than our cost) that includes an audio interface (a little box that connects to your computer via USB cable), a microphone, a mic cable, and a mic stand. We'll discuss these options with you, and we're happy to support you whichever path you choose. We'll help step you through the setup process, and we'll even get into an online session with you to make sure everything is working properly, and to show you some of the key features you can use during online lessons.
|
||||
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">2. Book Lessons</b><br/>
|
||||
Once your gear is set up, you are ready to take lessons. Go to this web page: <a style="color:#fc0" href="<%= @user.school.teacher_list_url %>"><%= @user.school.teacher_list_url %></a>. If your school has preferred instructors, they will be listed on this page, and you can click a button to book a lesson with the teacher from whom you want to take lessons. If your school doesn't have preferred instructors, then there is a link on this page to use our teacher search feature to find a great instructor from our broader community of teachers. You'll need your parents to enter credit card information to pay for your lessons. We use one of the largest and most secure commerce platforms on the Internet called Stripe, so you can feel confident your financial information will be very secure.
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">3. Learn About JamClass Features</b><br/>
|
||||
You can also review our <a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles">JamClass user guide for students</a>
|
||||
to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to join your teacher in online lessons, features you can use while in lessons, and more.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician!
|
||||
</p>
|
||||
<% else %>
|
||||
|
||||
|
||||
<p>
|
||||
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology was
|
||||
built from the ground up for playing music live in sync with high quality audio from different locations over the
|
||||
Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience
|
||||
than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians will attest to this.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To get ready to take JamClass lessons online, here are the things you'll want to do:
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">1. Find a Teacher & Book Lessons</b><br/>
|
||||
|
||||
If you haven't done so already, <a href="https://www.jamkazam.com/client#/jamclass/searchOptions" style="color:#fc0">use this link to search our teachers</a>, and click to book a TestDrive with a teacher who looks good for you. When you do this, you'll be given the option to take full 30-minute TestDrive lessons:
|
||||
|
||||
<ul>
|
||||
<li>With 4 different teachers for just $12.50 each</li>
|
||||
<li>With 2 different teachers for just $14.99 each</li>
|
||||
<li>Or with 1 teacher for just $14.99</li>
|
||||
</ul>
|
||||
<p>
|
||||
Pick whichever option you prefer. TestDrive lets you safely and easily try multiple teachers to find the one who is best specifically for you, which is a great way to maximize the benefit from your lessons. And TestDrive lessons are heavily discounted to give you a risk-free way to get started. We'd suggest scheduling your first lesson for about a week in the future to give you plenty of time to get up and running with our free app.
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">2. Set Up Your Gear</b><br/>
|
||||
Please review our <a href="https://jamkazam.desk.com/customer/en/portal/topics/564807-gear-recommendations/articles" style="color:#fc0">help articles on gear recommendations</a>
|
||||
to make sure you have everything you need to get set up properly for best results in your online lessons.
|
||||
If you have everything you need, then you can follow the instructions on our <a href="https://jamkazam.desk.com/customer/en/portal/topics/930331-setting-up-your-gear-to-play-in-online-sessions/articles" style="color:#fc0">setup help articles</a> to download and install our free app and set it up with your audio gear and webcam. Please email us at <a href="mailto:support@jamkaazm.com" style="color:#fc0">support@jamkazam.com</a> or call us at <a href="tel:+18773768742" style="color:#fc0">1-877-376-8742</a> any time so that we can help you with these steps. We are very happy to help, and we also strongly suggest that you let one of our staff get into an online session with you to make sure everything is working properly and to make sure you're comfortable with the app and ready for your first lesson.
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">3. Learn About JamClass Features</b><br/>
|
||||
Please review our <a href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles" style="color:#fc0">JamClass user guide for students</a> to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to search for the best teacher for you, how to request/book lessons, how to join your teacher in online lessons, features you can use while in lessons, and much more.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician!
|
||||
</p>
|
||||
|
||||
<% end %>
|
||||
|
||||
<p>Best Regards,<br/>
|
||||
Team JamKazam</p>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<% if !@user.anonymous? %>Hello <%= EmailBatchProgression::VAR_FIRST_NAME %> --<% end %>
|
||||
|
||||
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology was
|
||||
built from the ground up for playing music live in sync with high quality audio from different locations over the
|
||||
Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience
|
||||
than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians will attest to this.
|
||||
|
||||
|
||||
To get ready to take JamClass lessons online, here are the things you'll want to do:
|
||||
|
||||
1. Find a Teacher & Book Lessons
|
||||
If you already know the teacher from whom you want to learn, then you can simply
|
||||
use this link to search for them (https://www.jamkazam.com/client#/jamclass/searchOptions), and
|
||||
click the Book Lesson button to get started. But if you're like most of us, you don't know. In this case, we strongly
|
||||
advise signing up for our unique TestDrive service.
|
||||
|
||||
TestDrive lets you take 4 full lessons (30 minutes each) from 4 different teachers for just $49.99 to find the best
|
||||
teacher for you. Finding the right teacher is the single most important determinant of success in your lessons. Would
|
||||
you marry the first person you ever dated? No? Same here. Pick 4 teachers who look great, and then see who you click
|
||||
with. It's a phenomenal value, and then you can stick with the best teacher for you.
|
||||
Click this link to sign up now for TestDrive (https://www.jamkazam.com/client#/jamclass/test-drive-selection).
|
||||
Then you can book 4 TestDrive lessons to get rolling.
|
||||
|
||||
2. Set Up Your Gear
|
||||
Use this link to a set of
|
||||
help articles on how to set up your gear (https://jamkazam.desk.com/customer/en/portal/topics/673197-first-time-setup/articles)
|
||||
to be ready to teach online. After you have signed
|
||||
up, someone from JamKazam will contact you to schedule a test online session, in which we will make sure your audio
|
||||
and video gear are working properly in an online session, and to make sure you feel comfortable with the key features
|
||||
you will be using in sessions with teachers.
|
||||
|
||||
3. Learn About JamClass Features
|
||||
Use this link to a set of help articles for students on JamClass (https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles)
|
||||
to familiarize yourself with the most useful features
|
||||
for online lessons. This includes how to search for the best teacher for you, how to request/book lessons, how to join
|
||||
your teacher in online lessons, features you can use while in lessons, and much more. There is very important basic
|
||||
information, plus some really nifty stuff here, so be sure to look through it at least briefly to see how we can
|
||||
turbocharge your online lessons!
|
||||
|
||||
4. Play With Other Musicians Online - It's Free!
|
||||
With JamKazam, you can use the things you're learning in lessons to play with other amateur musicians in online
|
||||
sessions, free! Or just play for fun. Once you've set up your gear for lessons, you can
|
||||
create online music sessions (https://jamkazam.desk.com/customer/en/portal/articles/1599977-creating-a-session)
|
||||
that others can join, or find other musicians' online music sessions (https://jamkazam.desk.com/customer/en/portal/articles/1599978-finding-a-session)
|
||||
and hop into those to play with others. If you
|
||||
want to take advantage of this part of the JamKazam platform, we'd advise that you edit your musician profile (https://www.jamkazam.com/client#/account/profile) to make
|
||||
it easier to connect with other musicians (https://jamkazam.desk.com/customer/en/portal/articles/1707418-connecting-with-other-musicians) in our community to expand your set of musician friends. It's a ton of fun,
|
||||
so give it a try!
|
||||
|
||||
As you work through these things, if you ever get stuck or have questions, please don't hesitate to reach out for
|
||||
help. You can email us any time at support@jamkazam.com. We are happy to
|
||||
help you, and we look forward to helping you
|
||||
learn and grow as a musician, and expand your musical universe!
|
||||
|
||||
Best Regards,
|
||||
Team JamKazam
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<% provide(:title, "You have used #{@student.used_test_drives} of #{@student.total_test_drives} TestDrive lesson credits") %>
|
||||
<% provide(:title, "You have used #{@used_credits} of #{@total_credits} TestDrive lesson credits") %>
|
||||
<% provide(:photo_url, @teacher.resolved_photo_url) %>
|
||||
|
||||
<% content_for :note do %>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
</p>
|
||||
|
||||
<p>We hope you enjoyed your JamClass lesson today with <%= @teacher.name %>. You have
|
||||
used <%= @student.used_test_drives %> TestDrive credits, and you have <%= @student.remaining_test_drives %>
|
||||
used <%= @used_credits %> TestDrive credits, and you have <%= @remaining_credits %>
|
||||
remaining TestDrive lesson(s) available. If you haven’t booked your next TestDrive lesson,
|
||||
<a href="<%= User.search_url %>" style="color:#fc0">click here</a> to search our teachers and get your next
|
||||
lesson lined up today!</p>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
You have used <%= @student.used_test_drives %> of <%= @student.total_test_drives %> TestDrive lesson credits.
|
||||
You have used <%= @used_credits %> of <%= @total_credits %> TestDrive lesson credits.
|
||||
|
||||
<% if @student.has_rated_teacher(@teacher) %>
|
||||
Also, please rate your teacher at <%= @teacher.ratings_url %> now for today’s lesson to help other students in the community find the best instructors.
|
||||
|
|
|
|||
|
|
@ -6,21 +6,62 @@
|
|||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if @education %>
|
||||
|
||||
<p>
|
||||
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology was
|
||||
built from the ground up for playing music live in sync with high quality audio from different locations over the
|
||||
Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience
|
||||
than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians will attest to this.
|
||||
</p>
|
||||
<p>
|
||||
Thank you for expressing an interest in taking private music lessons online using JamKazam! A member of our staff
|
||||
will reach out to you shortly to chat with you and answer any questions you have about how our online music lesson
|
||||
service works, to help you determine if this is a good option for you.
|
||||
</p>
|
||||
<p>
|
||||
If you decide online lessons look good, then we'll help you get your gear set up properly, and we'll even get into a
|
||||
sample online session with you to make sure everything is working properly, and to ensure you are comfortable using
|
||||
our app's features in a lesson.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To get ready to take JamClass lessons online, here are the things you'll want to do:
|
||||
</p>
|
||||
<p>To take online lessons on JamKazam, you'll need the following things at home:</p>
|
||||
|
||||
<p><b style="color: white">1. Find a Teacher & Book Lessons</b><br/>
|
||||
<ul>
|
||||
<li>A Windows or Mac computer, with a built-in or external webcam for video, and a built-in microphone and headphone jack for audio</li>
|
||||
<li>Home internet service</li>
|
||||
</ul>
|
||||
|
||||
If you haven't done so already, <a href="https://www.jamkazam.com/client#/jamclass/searchOptions" style="color:#fc0">use this link to search our teachers</a>, and click to book a TestDrive with a teacher who looks good for you. When you do this, you'll be given the option to take full 30-minute TestDrive lessons:
|
||||
<p>
|
||||
For higher quality audio in online sessions, we recommend (this is an option, not a requirement) a premium audio
|
||||
gear bundle that includes an audio interface (a little box you connect to your computer with a USB cable), a
|
||||
microphone, a mic cable, and a mic stand. We offer this package for just $49.99, which is less than our cost for
|
||||
these products, but it makes a big difference in audio quality, so we think it's worth the upgrade.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you are curious to learn more about how everything works, you can also review our
|
||||
<a href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles" style="color:#fc0">help
|
||||
guide for students</a>. Thanks
|
||||
again for connecting with us, and we look forward to speaking with you soon!
|
||||
</p>
|
||||
|
||||
<% else %>
|
||||
|
||||
|
||||
<p>
|
||||
Thank you for signing up to take online music lessons using the JamClass service by JamKazam. JamKazam technology
|
||||
was
|
||||
built from the ground up for playing music live in sync with high quality audio from different locations over the
|
||||
Internet. Unlike other lesson services, this means we can deliver a massively better online music lesson experience
|
||||
than voice/chat apps like Skype, etc. Our rapidly growing community of <%= APP_CONFIG.musician_count %> musicians
|
||||
will attest to this.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To get ready to take JamClass lessons online, here are the things you'll want to do:
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">1. Find a Teacher & Book Lessons</b><br/>
|
||||
|
||||
If you haven't done so already,
|
||||
<a href="https://www.jamkazam.com/client#/jamclass/searchOptions" style="color:#fc0">use this link to search our
|
||||
teachers</a>, and click to book a TestDrive with a teacher who looks good for you. When you do this, you'll be
|
||||
given the option to take full 30-minute TestDrive lessons:
|
||||
|
||||
<ul>
|
||||
<li>With 4 different teachers for just $12.50 each</li>
|
||||
|
|
@ -28,25 +69,43 @@
|
|||
<li>Or with 1 teacher for just $14.99</li>
|
||||
</ul>
|
||||
<p>
|
||||
Pick whichever option you prefer. TestDrive lets you safely and easily try multiple teachers to find the one who is best specifically for you, which is a great way to maximize the benefit from your lessons. And TestDrive lessons are heavily discounted to give you a risk-free way to get started. We'd suggest scheduling your first lesson for about a week in the future to give you plenty of time to get up and running with our free app.
|
||||
Pick whichever option you prefer. TestDrive lets you safely and easily try multiple teachers to find the one who is
|
||||
best specifically for you, which is a great way to maximize the benefit from your lessons. And TestDrive lessons are
|
||||
heavily discounted to give you a risk-free way to get started. We'd suggest scheduling your first lesson for about a
|
||||
week in the future to give you plenty of time to get up and running with our free app.
|
||||
</p>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">2. Set Up Your Gear</b><br/>
|
||||
Please review our <a href="https://jamkazam.desk.com/customer/en/portal/topics/564807-gear-recommendations/articles" style="color:#fc0">help articles on gear recommendations</a>
|
||||
to make sure you have everything you need to get set up properly for best results in your online lessons.
|
||||
If you have everything you need, then you can follow the instructions on our <a href="https://jamkazam.desk.com/customer/en/portal/topics/930331-setting-up-your-gear-to-play-in-online-sessions/articles" style="color:#fc0">setup help articles</a> to download and install our free app and set it up with your audio gear and webcam. Please email us at <a href="mailto:support@jamkaazm.com" style="color:#fc0">support@jamkazam.com</a> or call us at <a href="tel:+18773768742" style="color:#fc0">1-877-376-8742</a> any time so that we can help you with these steps. We are very happy to help, and we also strongly suggest that you let one of our staff get into an online session with you to make sure everything is working properly and to make sure you're comfortable with the app and ready for your first lesson.
|
||||
</p>
|
||||
<p><b style="color: white">2. Set Up Your Gear</b><br/>
|
||||
Please review our
|
||||
<a href="https://jamkazam.desk.com/customer/en/portal/topics/564807-gear-recommendations/articles" style="color:#fc0">help
|
||||
articles on gear recommendations</a>
|
||||
to make sure you have everything you need to get set up properly for best results in your online lessons.
|
||||
If you have everything you need, then you can follow the instructions on our
|
||||
<a href="https://jamkazam.desk.com/customer/en/portal/topics/930331-setting-up-your-gear-to-play-in-online-sessions/articles" style="color:#fc0">setup
|
||||
help articles</a> to download and install our free app and set it up with your audio gear and webcam. Please email
|
||||
us at <a href="mailto:support@jamkaazm.com" style="color:#fc0">support@jamkazam.com</a> or call us at
|
||||
<a href="tel:+18773768742" style="color:#fc0">1-877-376-8742</a> any time so that we can help you with these steps.
|
||||
We are very happy to help, and we also strongly suggest that you let one of our staff get into an online session
|
||||
with you to make sure everything is working properly and to make sure you're comfortable with the app and ready for
|
||||
your first lesson.
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">3. Learn About JamClass Features</b><br/>
|
||||
Please review our <a href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles" style="color:#fc0">JamClass user guide for students</a> to familiarize yourself with the features and resources available to you through our JamClass lesson service. This includes how to search for the best teacher for you, how to request/book lessons, how to join your teacher in online lessons, features you can use while in lessons, and much more.
|
||||
</p>
|
||||
<p><b style="color: white">3. Learn About JamClass Features</b><br/>
|
||||
Please review our
|
||||
<a href="https://jamkazam.desk.com/customer/en/portal/topics/926073-jamclass-online-music-lessons---for-students/articles" style="color:#fc0">JamClass
|
||||
user guide for students</a> to familiarize yourself with the features and resources available to you through our
|
||||
JamClass lesson service. This includes how to search for the best teacher for you, how to request/book lessons, how
|
||||
to join your teacher in online lessons, features you can use while in lessons, and much more.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn and grow as a musician!
|
||||
</p>
|
||||
Again, welcome to JamKazam and our JamClass online music lesson service, and we look forward to helping you learn
|
||||
and grow as a musician!
|
||||
</p>
|
||||
|
||||
<% end %>
|
||||
|
||||
<p>Best Regards,<br/>
|
||||
Team JamKazam</p>
|
||||
|
|
@ -9,11 +9,11 @@
|
|||
<% else %>
|
||||
<p>
|
||||
<% if @card_declined %>
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by stripe. Can you please check your stripe account status? Thank you!
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by Stripe. Can you please check your Stripe account status? Thank you!
|
||||
<% elsif @card_expired %>
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by stripe due to a card expiration. Can you please check your stripe account status? Thank you!
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by Stripe due to a card expiration. Can you please check your stripe account status? Thank you!
|
||||
<% else %>
|
||||
For some reason, when we tried to distribute a payment to you on <%= @bill_date %>, the charge failed. Can you please check your stripe account status? Thank you!
|
||||
For some reason, when we tried to distribute a payment to you on <%= @bill_date %>, the charge failed. Can you please check your Stripe account status? Thank you!
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ Hello <%= @name %>,
|
|||
We attempted to process a payment via your Stripe account for <%= @distribution.real_distribution_display %> for this lesson, but the payment failed. Please sign into your Stripe account, and verify that everything there is working properly. We’ll try again to process this payment in about 24 hours.
|
||||
<% else %>
|
||||
<% if @card_declined %>
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by stripe. Can you please check your stripe account status? Thank you!
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by Stripe. Can you please check your Stripe account status? Thank you!
|
||||
<% elsif @card_expired %>
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by stripe due to a card expiration. Can you please check your stripe account status? Thank you!
|
||||
When we tried to distribute a payment to you on <%= @bill_date %>, the charge was declined by Stripe due to a card expiration. Can you please check your Stripe account status? Thank you!
|
||||
<% else %>
|
||||
For some reason, when we tried to distribute a payment to you on <%= @bill_date %>, the charge failed. Can you please check your stripe account status? Thank you!
|
||||
For some reason, when we tried to distribute a payment to you on <%= @bill_date %>, the charge failed. Can you please check your Stripe account status? Thank you!
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,56 +6,113 @@
|
|||
</p>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
Thank you for signing up to teach online music lessons using the JamClass service by JamKazam. JamKazam technology was
|
||||
built from the ground up for playing music live in sync with high quality audio from different locations over the
|
||||
Internet, so you will find it delivers a massively better online music lesson platform than voice/chat apps like
|
||||
Skype, etc.
|
||||
</p>
|
||||
<% if @education %>
|
||||
|
||||
<p>
|
||||
To get ready to teach JamClass students online, here are the things you'll want to do:
|
||||
</p>
|
||||
<p>
|
||||
Thank you for expressing an interest in teaching private music lessons online using JamKazam! A member of our staff
|
||||
will reach out to you shortly to chat with you and answer any questions you have about how our online music lesson
|
||||
service works, to help you determine if this is a good option for you.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you decide teaching online lessons look good, then we'll help you get your gear set up properly, and we'll even
|
||||
get into a sample online session with you to make sure everything is working properly, and to ensure you are
|
||||
comfortable using our app's features in a lesson.
|
||||
</p>
|
||||
|
||||
<p>To take online lessons on JamKazam, you'll need the following things at home:</p>
|
||||
|
||||
<ul>
|
||||
<li>A Windows or Mac computer, with a built-in or external webcam for video, and a built-in microphone and headphone
|
||||
jack for audio
|
||||
</li>
|
||||
<li>Home internet service</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
For higher quality audio in online sessions, we recommend (this is an option, not a requirement) a premium audio
|
||||
gear bundle that includes an audio interface (a little box you connect to your computer with a USB cable), a
|
||||
microphone, a mic cable, and a mic stand. We offer this package for just $49.99, which is less than our cost for
|
||||
these products, but it makes a big difference in audio quality, so we think it's worth the upgrade. Also, if you
|
||||
already own an audio interface, it's highly likely you can use what you already have with our free app.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you are curious to learn more about how everything works, you can also review our <a href="https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles" style="color:#fc0">help guide for teachers</a>. Thanks
|
||||
again for connecting with us, and we look forward to speaking with you soon!
|
||||
</p>
|
||||
|
||||
<% else %>
|
||||
<p>
|
||||
Thank you for signing up to teach online music lessons using the JamClass service by JamKazam. JamKazam technology
|
||||
was
|
||||
built from the ground up for playing music live in sync with high quality audio from different locations over the
|
||||
Internet, so you will find it delivers a massively better online music lesson platform than voice/chat apps like
|
||||
Skype, etc.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To get ready to teach JamClass students online, here are the things you'll want to do:
|
||||
</p>
|
||||
|
||||
|
||||
<p><b style="color: white">1. Set Up Your Teacher Profile</b><br/>
|
||||
As JamKazam brings students into the JamClass marketplace, these students search for teachers. The way they find
|
||||
teachers is by searching on their criteria (e.g. instruments, genres, etc.), and then by browsing through teacher
|
||||
profiles to get a feel for the teachers who match their search criteria. Your teacher profile is critical to being
|
||||
found in searches, and then presenting yourself in more depth to students who are interested in you. So you'll want to
|
||||
take a little time to fill in the information in your teacher profile to present yourself well.
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/articles/2405835-creating-your-teacher-profile">Click
|
||||
here for
|
||||
instructions on filling out your teacher profile</a>.
|
||||
</p>
|
||||
<p><b style="color: white">1. Set Up Your Teacher Profile</b><br/>
|
||||
As JamKazam brings students into the JamClass marketplace, these students search for teachers. The way they find
|
||||
teachers is by searching on their criteria (e.g. instruments, genres, etc.), and then by browsing through teacher
|
||||
profiles to get a feel for the teachers who match their search criteria. Your teacher profile is critical to being
|
||||
found in searches, and then presenting yourself in more depth to students who are interested in you. So you'll want
|
||||
to
|
||||
take a little time to fill in the information in your teacher profile to present yourself well.
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/articles/2405835-creating-your-teacher-profile">Click
|
||||
here for
|
||||
instructions on filling out your teacher profile</a>.
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">2. Set Up Your Gear</b><br/>
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/articles/1288274-computer-internet-audio-and-video-requirements">Click
|
||||
here for information on the gear requirements to effectively teach using the JamClass service</a>. When you have
|
||||
everything you need,
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/930331-setting-up-your-gear-to-play-in-online-sessions/articles">use
|
||||
this set of help articles as a good step-by-step guide to set up your gear for use with the
|
||||
JamKazam application</a>. After you have signed up, someone from JamKazam will contact you to schedule a test online
|
||||
session, in which we will make sure your audio and video gear are working properly in an online session, and to make
|
||||
sure you feel comfortable with the key features you will be using in sessions with students.
|
||||
</p>
|
||||
<p><b style="color: white">2. Set Up Your Gear</b><br/>
|
||||
<% if @education %>
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/articles/1288274-computer-internet-audio-and-video-requirements">Click
|
||||
here for information on the gear requirements to effectively teach using the JamClass service</a>. At a minimum,
|
||||
you'll need a Windows or Mac computer and home Internet service, but we also recommend using an audio interface
|
||||
for superior audio quality. If you already have an audio interface for home recording, you can very likely use the
|
||||
one you have. If not, JamKazam offers a high quality audio package of an audio interface (a small box you connect
|
||||
to your computer via USB cable), a microphone, a mic cable, and a mic stand for just $49.99 (less than our cost).
|
||||
After you have signed up, someone from JamKazam will contact you to schedule a 1:1 help session to help you get
|
||||
set up, to make sure your audio and video gear are working properly in an online session, and to make sure you
|
||||
feel comfortable with the key features you will be using in sessions with students.
|
||||
<% else %>
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/articles/1288274-computer-internet-audio-and-video-requirements">Click
|
||||
here for information on the gear requirements to effectively teach using the JamClass service</a>. When you have
|
||||
everything you need,
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/930331-setting-up-your-gear-to-play-in-online-sessions/articles">use
|
||||
this set of help articles as a good step-by-step guide to set up your gear for use with the
|
||||
JamKazam application</a>. After you have signed up, someone from JamKazam will contact you to schedule a test
|
||||
online
|
||||
session, in which we will make sure your audio and video gear are working properly in an online session, and to
|
||||
make
|
||||
sure you feel comfortable with the key features you will be using in sessions with students.
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><b style="color: white">3. Learn About JamClass Features</b><br/>
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles">Click
|
||||
this link for a set of help articles specifically for teachers</a> to learn how to respond to student lesson
|
||||
requests, how to join your lessons when they are scheduled to begin, how to get paid, and more. You can also
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/673198-key-features-to-use-in-online-sessions/articles">use
|
||||
this
|
||||
link for a set of help articles that explain how to use the key features available to you in online sessions</a>
|
||||
to
|
||||
effectively teach students.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As you work through these things, if you ever get stuck or have questions, please don't hesitate to reach out for
|
||||
help. You can email us any time at <a href="mailto:support@jamkazam.com" style="color:#fc0">support@jamkazam.com</a>.
|
||||
We are happy to help you, and we look forward to helping you
|
||||
reach and teach more students!
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<p><b style="color: white">3. Learn About JamClass Features</b><br/>
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/926076-jamclass-online-music-lessons---for-teachers/articles">Click
|
||||
this link for a set of help articles specifically for teachers</a> to learn how to respond to student lesson
|
||||
requests, how to join your lessons when they are scheduled to begin, how to get paid, and more. You can also
|
||||
<a style="color:#fc0" href="https://jamkazam.desk.com/customer/en/portal/topics/673198-key-features-to-use-in-online-sessions/articles">use
|
||||
this
|
||||
link for a set of help articles that explain how to use the key features available to you in online sessions</a> to
|
||||
effectively teach students.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As you work through these things, if you ever get stuck or have questions, please don't hesitate to reach out for
|
||||
help. You can email us any time at <a href="mailto:support@jamkazam.com" style="color:#fc0">support@jamkazam.com</a>.
|
||||
We are happy to help you, and we look forward to helping you
|
||||
reach and teach more students!
|
||||
</p>
|
||||
|
||||
<p>Best Regards,<br/>
|
||||
Team JamKazam</p>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
<td align="left">
|
||||
|
||||
<!-- CALL OUT BOX -->
|
||||
<p style="margin-top:0px"><font size="2" color="#7FACBA" face="Arial, Helvetica, sans-serif">This email was sent to you because you have an account at <a style="color: #ffcc00;" href="http://www.jamkazam.com">JamKazam</a>. Click <a style="color: #ffcc00;" href="http://www.jamkazam.com/unsubscribe/#{@user.unsubscribe_token}">here to unsubscribe</a> and update your profile settings.
|
||||
<p style="margin-top:0px"><font size="2" color="#7FACBA" face="Arial, Helvetica, sans-serif">This email was sent to you because you have an account at <a style="color: #ffcc00;" href="http://www.jamkazam.com">JamKazam</a>. Click <a style="color: #ffcc00;" href="https://www.jamkazam.com/unsubscribe/<%= @user.unsubscribe_token %>">here to unsubscribe</a>.
|
||||
</font></p>
|
||||
</td></tr></table>
|
||||
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ module JamRuby
|
|||
return
|
||||
end
|
||||
|
||||
#wav_file = File.join(tmp_dir, File.basename(click_track_file[:original_filename]))
|
||||
#JamTrackImporter.song_storage_manager.download(click_track_file[:original_filename], wav_file)
|
||||
wav_file = File.join(tmp_dir, File.basename(click_track_file[:original_filename]))
|
||||
JamTrackImporter.song_storage_manager.download(click_track_file[:original_filename], wav_file)
|
||||
|
||||
JamTrack.transaction do
|
||||
click_track = jam_track.click_track
|
||||
|
|
@ -81,6 +81,8 @@ module JamRuby
|
|||
click_track.instrument_id = 'computer'
|
||||
click_track.jam_track = jam_track
|
||||
click_track.position = 10000
|
||||
click_track.wav_file = wav_file
|
||||
|
||||
if !click_track.save
|
||||
@@log.error("unable to create jamtrack click track #{click_track.errors.inspect}")
|
||||
finish("jam_track_click", "unable to create: #{click_track.errors.inspect}")
|
||||
|
|
@ -1601,6 +1603,8 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def assign_instrument_parts(wav_file, tracks, addt_files, reassign = false)
|
||||
if !reassign
|
||||
track = JamTrackTrack.new
|
||||
|
|
@ -2651,6 +2655,34 @@ module JamRuby
|
|||
importer
|
||||
end
|
||||
|
||||
# created for helbing tracks which had .mp3 as click track
|
||||
def convert_click_track_to_wav(jam_track)
|
||||
importer = JamTrackImporter.new
|
||||
importer.name = jam_track.name
|
||||
|
||||
track = jam_track.click_track
|
||||
|
||||
if !track
|
||||
Dir.mktmpdir do |tmp_dir|
|
||||
|
||||
# something like: "mapped/Victor Young - Stella By Starlight/meta.yml"
|
||||
metalocation = jam_track.metalocation
|
||||
base_dir = metalocation[0...metalocation.rindex('/')]
|
||||
click_mp3 = File.join(tmp_dir, 'Click.mp3')
|
||||
click_wav = File.join(tmp_dir, 'Click.wav')
|
||||
song_storage_manager.download(base_dir + '/Click.mp3', click_mp3)
|
||||
|
||||
`ffmpeg -i "#{click_mp3}" "#{click_wav}"`
|
||||
|
||||
song_storage_manager.upload(base_dir + '/Click.wav', click_wav)
|
||||
importer.finish("success", nil)
|
||||
end
|
||||
else
|
||||
importer.finish('success', nil)
|
||||
end
|
||||
importer
|
||||
end
|
||||
|
||||
def synchronize_jamtrack_master_preview(jam_track)
|
||||
importer = JamTrackImporter.new
|
||||
importer.name = jam_track.name
|
||||
|
|
@ -2717,7 +2749,8 @@ module JamRuby
|
|||
def import_click_tracks
|
||||
importers = []
|
||||
|
||||
JamTrack.all.each do |jam_track|
|
||||
licensor = JamTrackLicensor.find_by_name!('Stockton Helbing')
|
||||
JamTrack.where(licensor_id: licensor.id).each do |jam_track|
|
||||
#jam_track = JamTrack.find('126')
|
||||
importers << import_click_track(jam_track)
|
||||
end
|
||||
|
|
@ -2796,6 +2829,32 @@ module JamRuby
|
|||
end
|
||||
end
|
||||
|
||||
def convert_click_track_to_wavs
|
||||
importers = []
|
||||
|
||||
licensor = JamTrackLicensor.find_by_name!('Stockton Helbing')
|
||||
JamTrack.where(licensor_id: licensor.id).each do |jam_track|
|
||||
importers << convert_click_track_to_wav(jam_track)
|
||||
end
|
||||
|
||||
@@log.info("SUMMARY")
|
||||
@@log.info("-------")
|
||||
importers.each do |importer|
|
||||
if importer
|
||||
if importer.reason == "success" || importer.reason == "jam_track_exists" || importer.reason == "other_processing"
|
||||
@@log.info("#{importer.name} #{importer.reason}")
|
||||
else
|
||||
@@log.error("#{importer.name} failed to import.")
|
||||
@@log.error("#{importer.name} reason=#{importer.reason}")
|
||||
@@log.error("#{importer.name} detail=#{importer.detail}")
|
||||
end
|
||||
else
|
||||
@@log.error("NULL IMPORTER")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
def synchronize_jamtrack_aac_previews
|
||||
|
||||
importers = []
|
||||
|
|
@ -2818,8 +2877,6 @@ module JamRuby
|
|||
else
|
||||
@@log.error("NULL IMPORTER")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -3123,11 +3180,11 @@ module JamRuby
|
|||
|
||||
def resync_instruments(licensor)
|
||||
|
||||
load_paris_mappings if @paris_mapping.nil?
|
||||
load_paris_mappings if @paris_mapping.nil? && is_paris_storage?
|
||||
|
||||
JamTrack.where(licensor_id: licensor.id).each do |jam_track|
|
||||
|
||||
if @paris_metadata[jam_track.vendor_id].nil?
|
||||
if is_paris_storage? && @paris_metadata[jam_track.vendor_id].nil?
|
||||
next
|
||||
end
|
||||
puts "RESYNCING JAMTRACK #{jam_track.id}"
|
||||
|
|
@ -3140,6 +3197,7 @@ module JamRuby
|
|||
|
||||
#puts ">>>>>>>>> HIT KEY TO CONTINUE <<<<<<<<<<"
|
||||
#STDIN.gets
|
||||
break
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ module JamRuby
|
|||
|
||||
def save_jam_track_right_jkz(jam_track_right, sample_rate=48)
|
||||
jam_track = jam_track_right.jam_track
|
||||
jam_track.reload
|
||||
py_root = APP_CONFIG.jamtracks_dir
|
||||
step = 0
|
||||
Dir.mktmpdir do |tmp_dir|
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# shouldn't be used in Rails 4
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# This needs to be outside the module to work.
|
||||
class JsonValidator < ActiveModel::EachValidator
|
||||
# implement the method called during validation
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ module JamRuby
|
|||
def upload_sign(filename, content_md5, part_number, upload_id)
|
||||
hdt = http_date_time
|
||||
str_to_sign = "PUT\n#{content_md5}\n#{content_type}\n#{hdt}\n/#{@aws_bucket}/#{filename}?partNumber=#{part_number}&uploadId=#{upload_id}"
|
||||
signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), @aws_secret, str_to_sign)).chomp
|
||||
signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), @aws_secret, str_to_sign)).chomp
|
||||
{ :datetime => hdt,
|
||||
:md5 => content_md5,
|
||||
:url => "https://s3.amazonaws.com/#{@aws_bucket}/#{filename}?partNumber=#{part_number}&uploadId=#{upload_id}",
|
||||
|
|
|
|||
|
|
@ -833,7 +833,7 @@ module JamRuby
|
|||
def self.stats
|
||||
stats = {}
|
||||
|
||||
result = ActiveMusicSession.select('count(distinct(id)) AS total, count(distinct(jam_track_initiator_id)) as jam_track_count, count(distinct(backing_track_initiator_id)) as backing_track_count, count(distinct(metronome_initiator_id)) as metronome_count, count(distinct(claimed_recording_initiator_id)) as recording_count').first
|
||||
result = ActiveMusicSession.select('count(distinct(id)) AS total, count(distinct(jam_track_initiator_id)) as jam_track_count, count(distinct(backing_track_initiator_id)) as backing_track_count, count(distinct(metronome_initiator_id)) as metronome_count, count(distinct(claimed_recording_initiator_id)) as recording_count')[0]
|
||||
|
||||
stats['count'] = result['total'].to_i
|
||||
stats['jam_track_count'] = result['jam_track_count'].to_i
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ class JamRuby::AffiliatePartner < ActiveRecord::Base
|
|||
|
||||
belongs_to :partner_user, :class_name => "JamRuby::User", :foreign_key => :partner_user_id, inverse_of: :affiliate_partner
|
||||
has_one :school, class_name: "JamRuby::School"
|
||||
has_one :retailer, class_name: "JamRuby::Retailer"
|
||||
has_many :user_referrals, :class_name => "JamRuby::User", :foreign_key => :affiliate_referral_id
|
||||
belongs_to :affiliate_legalese, :class_name => "JamRuby::AffiliateLegalese", :foreign_key => :legalese_id
|
||||
has_many :sale_line_items, :class_name => 'JamRuby::SaleLineItem', foreign_key: :affiliate_referral_id
|
||||
|
|
@ -45,7 +46,7 @@ class JamRuby::AffiliatePartner < ActiveRecord::Base
|
|||
#validates :partner_code, format: { with: PARTNER_CODE_REGEX }, :allow_blank => true
|
||||
validates :entity_type, inclusion: {in: ENTITY_TYPES, message: "invalid entity type"}
|
||||
|
||||
serialize :address, JSON
|
||||
#serialize :address, JSON
|
||||
|
||||
before_save do |record|
|
||||
record.address ||= ADDRESS_SCHEMA.clone
|
||||
|
|
@ -79,7 +80,7 @@ class JamRuby::AffiliatePartner < ActiveRecord::Base
|
|||
oo.partner_name = params[:partner_name].try(:strip)
|
||||
oo.partner_user = user if user # user is not required
|
||||
oo.entity_type = params[:entity_type] || ENTITY_TYPES.first
|
||||
signed_legalese
|
||||
oo.signed_at = Time.now
|
||||
oo.save
|
||||
oo
|
||||
end
|
||||
|
|
@ -94,6 +95,17 @@ class JamRuby::AffiliatePartner < ActiveRecord::Base
|
|||
oo.save
|
||||
end
|
||||
|
||||
def self.create_from_retailer(retailer)
|
||||
oo = AffiliatePartner.new
|
||||
oo.partner_name = "Affiliate from Retailer #{retailer.id}"
|
||||
oo.partner_user = retailer.owner
|
||||
oo.entity_type = 'Other'
|
||||
oo.retailer = retailer
|
||||
oo.signed_at = nil
|
||||
oo.save
|
||||
end
|
||||
|
||||
|
||||
def self.coded_id(code=nil)
|
||||
self.where(:partner_code => code).limit(1).pluck(:id).first if code.present?
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ module JamRuby
|
|||
ShoppingCart.where(anonymous_user_id: @id).order('created_at DESC')
|
||||
end
|
||||
|
||||
def mixed_cart
|
||||
Sale.is_mixed(shopping_carts)
|
||||
end
|
||||
|
||||
def destroy_all_shopping_carts
|
||||
ShoppingCart.destroy_all(anonymous_user_id: @id)
|
||||
|
|
@ -57,5 +60,6 @@ module JamRuby
|
|||
def reload
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module JamRuby
|
|||
DEFAULT_ENVIRONMENT = 'public'
|
||||
CLIENT_PREFIX = 'JamClient'
|
||||
|
||||
PRODUCTS = ["#{CLIENT_PREFIX}/Win32", "#{CLIENT_PREFIX}/MacOSX", "#{CLIENT_PREFIX}/JamBlaster"]
|
||||
PRODUCTS = ["#{CLIENT_PREFIX}/Win32", "#{CLIENT_PREFIX}/MacOSX", "#{CLIENT_PREFIX}/JamBlaster", "#{CLIENT_PREFIX}/JamBlasterClient"]
|
||||
|
||||
self.primary_key = 'id'
|
||||
attr_accessible :version, :uri, :sha1, :environment, :product, as: :admin
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module JamRuby
|
|||
self.table_name = "backing_tracks"
|
||||
self.primary_key = 'id'
|
||||
|
||||
default_scope order('created_at ASC')
|
||||
default_scope { order('created_at ASC') }
|
||||
|
||||
belongs_to :connection, :class_name => "JamRuby::Connection", :inverse_of => :tracks, :foreign_key => 'connection_id'
|
||||
validates :connection, presence: true
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ module JamRuby
|
|||
.order('created_at DESC')
|
||||
.limit(10)
|
||||
|
||||
recordings.concat(msh)
|
||||
recordings.sort! {|a,b| b.created_at <=> a.created_at}.first(5)
|
||||
result = recordings.concat(msh)
|
||||
result.sort! {|a,b| b.created_at <=> a.created_at}.first(5)
|
||||
end
|
||||
|
||||
def location
|
||||
|
|
@ -182,7 +182,7 @@ module JamRuby
|
|||
band = id.blank? ? Band.new : Band.find(id)
|
||||
|
||||
# ensure user updating Band details is a Band member
|
||||
unless band.new_record? || band.users.exists?(user)
|
||||
unless band.new_record? || band.users.exists?(user.id)
|
||||
raise JamPermissionError, ValidationMessages::USER_NOT_BAND_MEMBER_VALIDATION_ERROR
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module JamRuby
|
|||
cattr_accessor :jschema, :search_meta
|
||||
attr_accessor :user_counters
|
||||
|
||||
serialize :data_blob, JSON
|
||||
#serialize :data_blob, JSON
|
||||
|
||||
KEY_BAND_SEARCH_TYPE = 'band_search_type'
|
||||
KEY_BAND_TYPE = 'band_type'
|
||||
|
|
@ -251,6 +251,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def _process_results_page(_results)
|
||||
|
||||
@results = _results
|
||||
if user
|
||||
@user_counters = @results.inject({}) { |hh,val| hh[val.id] = {}; hh }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
module JamRuby
|
||||
class Charge < ActiveRecord::Base
|
||||
class Charge < ActiveRecord::Base
|
||||
|
||||
attr_accessor :stripe_charge
|
||||
|
||||
belongs_to :user, class_name: "JamRuby::User"
|
||||
|
||||
|
|
@ -24,9 +26,16 @@ module JamRuby
|
|||
raise "not implemented"
|
||||
end
|
||||
|
||||
def record_charge(stripe_charge)
|
||||
self.stripe_charge_id = stripe_charge.id
|
||||
self.billed = true
|
||||
self.billed_at = Time.now
|
||||
self.save(validate: false)
|
||||
end
|
||||
|
||||
def charge(force = false)
|
||||
|
||||
stripe_charge = nil
|
||||
@stripe_charge = nil
|
||||
|
||||
if !self.billed
|
||||
|
||||
|
|
@ -49,25 +58,30 @@ module JamRuby
|
|||
begin
|
||||
|
||||
stripe_charge = do_charge(force)
|
||||
self.stripe_charge_id = stripe_charge.id
|
||||
self.billed = true
|
||||
self.billed_at = Time.now
|
||||
self.save(validate: false)
|
||||
|
||||
# record the charge in this context (meaning, in our transaction)
|
||||
record_charge(@stripe_charge) if @stripe_charge
|
||||
|
||||
rescue Stripe::StripeError => e
|
||||
|
||||
stripe_handler(e)
|
||||
|
||||
subject = "Unable to charge user #{charged_user.email} for lesson #{self.id} (stripe)"
|
||||
body = "user=#{charged_user.email}\n\nbilling_error_reason=#{billing_error_reason}\n\nbilling_error_detail = #{billing_error_detail}"
|
||||
AdminMailer.alerts({subject: subject, body: body})
|
||||
AdminMailer.alerts({subject: subject, body: body}).deliver_now
|
||||
do_send_unable_charge
|
||||
|
||||
return false
|
||||
rescue Exception => e
|
||||
|
||||
# record the charge even if there was an unhandled exception at some point
|
||||
record_charge(@stripe_charge) if @stripe_charge
|
||||
|
||||
unhandled_handler(e)
|
||||
|
||||
subject = "Unable to charge user #{charged_user.email} for lesson #{self.id} (unhandled)"
|
||||
body = "user=#{charged_user.email}\n\nbilling_error_reason=#{billing_error_reason}\n\nbilling_error_detail = #{billing_error_detail}"
|
||||
AdminMailer.alerts({subject: subject, body: body})
|
||||
unhandled_handler(e)
|
||||
AdminMailer.alerts({subject: subject, body: body}).deliver_now
|
||||
return false
|
||||
end
|
||||
|
||||
|
|
@ -89,8 +103,8 @@ module JamRuby
|
|||
return stripe_charge
|
||||
end
|
||||
|
||||
def unhandled_handler(e, reason = 'unhandled_exception')
|
||||
self.billing_error_reason = reason
|
||||
def unhandled_handler(e)
|
||||
self.billing_error_reason = e.to_s
|
||||
if e.cause
|
||||
self.billing_error_detail = e.cause.to_s + "\n" + e.cause.backtrace.join("\n\t") if e.cause.backtrace
|
||||
self.billing_error_detail << "\n\n"
|
||||
|
|
@ -98,7 +112,7 @@ module JamRuby
|
|||
else
|
||||
self.billing_error_detail = e.to_s + "\n" + e.backtrace.join("\n\t") if e.backtrace
|
||||
end
|
||||
puts "Charge: unhandled exception #{billing_error_reason}, #{billing_error_detail}"
|
||||
#puts "Charge: unhandled exception #{billing_error_reason}, #{billing_error_detail}"
|
||||
self.save(validate: false)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ module JamRuby
|
|||
self.table_name = 'chat_messages'
|
||||
self.primary_key = 'id'
|
||||
|
||||
default_scope order('created_at DESC')
|
||||
default_scope { order('created_at DESC') }
|
||||
|
||||
attr_accessor :ignore_message_checks
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ module JamRuby
|
|||
|
||||
# a nil purpose means 'normal chat', which is the only time we should send an email
|
||||
if !target.online? && purpose.nil? && message.present?
|
||||
UserMailer.lesson_chat(chat_msg).deliver!
|
||||
UserMailer.lesson_chat(chat_msg).deliver_now
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ module JamRuby
|
|||
|
||||
|
||||
def user_belongs_to_recording
|
||||
if user && recording && !recording.users.exists?(user)
|
||||
if user && recording && !recording.users.exists?(user.id)
|
||||
errors.add(:user, ValidationMessages::NOT_PART_OF_RECORDING)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ module JamRuby
|
|||
class Connection < ActiveRecord::Base
|
||||
|
||||
include HtmlSanitize
|
||||
include AASM
|
||||
|
||||
# client_types
|
||||
TYPE_CLIENT = 'client'
|
||||
TYPE_BROWSER = 'browser'
|
||||
|
|
@ -116,13 +118,13 @@ module JamRuby
|
|||
|
||||
if music_session.musician_access
|
||||
if music_session.approval_required
|
||||
if !(music_session.music_session.creator == user || music_session.creator == user || music_session.invited_musicians.exists?(user))
|
||||
if !(music_session.music_session.creator == user || music_session.creator == user || music_session.invited_musicians.exists?(user.id))
|
||||
errors.add(:approval_required, ValidationMessages::INVITE_REQUIRED)
|
||||
return false
|
||||
end
|
||||
end
|
||||
else
|
||||
if !(music_session.music_session.creator == user || music_session.creator == user || music_session.invited_musicians.exists?(user))
|
||||
if !(music_session.music_session.creator == user || music_session.creator == user || music_session.invited_musicians.exists?(user.id))
|
||||
errors.add(:musician_access, ValidationMessages::INVITE_REQUIRED)
|
||||
return false
|
||||
end
|
||||
|
|
@ -176,7 +178,7 @@ module JamRuby
|
|||
|
||||
def join_the_session(music_session, as_musician, tracks, user, audio_latency, videos=nil)
|
||||
self.music_session_id = music_session.id
|
||||
self.as_musician = as_musician
|
||||
self.as_musician = as_musician == true # this is deliberate; otherwise we create a warning in one our tests that passes 'blarg' (rails warning about casting strings to false)
|
||||
self.joining_session = true
|
||||
self.joined_session_at = Time.now
|
||||
associate_tracks(tracks) unless tracks.nil?
|
||||
|
|
@ -244,7 +246,7 @@ module JamRuby
|
|||
stats[result['client_type']] = result['client_type_count'].to_i
|
||||
end
|
||||
|
||||
result = Connection.select('count(id) AS total, count(CASE WHEN scoring_timeout > NOW() THEN 1 ELSE null END) AS scoring_timeout_count, count(music_session_id) AS in_session, count(as_musician) AS musicians, count(CASE WHEN udp_reachable THEN 1 ELSE null END) AS udp_reachable_count, count(CASE WHEN is_network_testing THEN 1 ELSE null END) AS is_network_testing_count').first
|
||||
result = Connection.select('count(id) AS total, count(CASE WHEN scoring_timeout > NOW() THEN 1 ELSE null END) AS scoring_timeout_count, count(music_session_id) AS in_session, count(as_musician) AS musicians, count(CASE WHEN udp_reachable THEN 1 ELSE null END) AS udp_reachable_count, count(CASE WHEN is_network_testing THEN 1 ELSE null END) AS is_network_testing_count')[0]
|
||||
|
||||
stats['count'] = result['total'].to_i
|
||||
stats['scoring_timeout'] = result['scoring_timeout_count'].to_i
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ module JamRuby
|
|||
|
||||
csv = ::CSV.new(io, {encoding: 'ISO-8859-1', headers: false})
|
||||
csv.each do |row|
|
||||
vals = vals+sep+"(#{ActiveRecord::Base.quote_value(row[0])}, #{ActiveRecord::Base.quote_value(row[1])})"
|
||||
vals = vals+sep+"(#{ActiveRecord::Base.quote_value(row[0], nil)}, #{ActiveRecord::Base.quote_value(row[1], nil)})"
|
||||
sep = ','
|
||||
i += 1
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def self.alert_user_sharer(user)
|
||||
violation = check_user_sharer(APP_CONFIG.max_user_ip_address, user.id).first
|
||||
violation = check_user_sharer(APP_CONFIG.max_user_ip_address, user.id)[0]
|
||||
|
||||
if violation
|
||||
body = "User has downloaded from too many IP addresses #{user.id}\n"
|
||||
|
|
@ -95,7 +95,7 @@ module JamRuby
|
|||
AdminMailer.alerts({
|
||||
subject:"Account IP Access Violation. USER: #{user.email}",
|
||||
body:body
|
||||
}).deliver
|
||||
}).deliver_now
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
if !IpWhitelist.listed(remote_ip)
|
||||
violation = check_freebie_snarfer(APP_CONFIG.max_multiple_users_same_ip, remote_ip).first
|
||||
violation = check_freebie_snarfer(APP_CONFIG.max_multiple_users_same_ip, remote_ip)[0]
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ module JamRuby
|
|||
AdminMailer.alerts({
|
||||
subject:"Single IP Access Violation. IP:#{remote_ip}",
|
||||
body:body
|
||||
}).deliver
|
||||
}).deliver_now
|
||||
|
||||
# and now shut them down
|
||||
if Rails.application.config.ban_jamtrack_downloaders
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ module JamRuby
|
|||
attr_accessible :from_email, :subject, :test_emails, :body
|
||||
attr_accessible :lock_version, :opt_in_count, :sent_count, :started_at, :completed_at
|
||||
|
||||
default_scope :order => 'created_at DESC'
|
||||
default_scope { order('created_at DESC') }
|
||||
|
||||
VAR_FIRST_NAME = '@FIRSTNAME'
|
||||
VAR_LAST_NAME = '@LASTNAME'
|
||||
|
|
@ -88,7 +88,7 @@ FOO
|
|||
if 'test' == Rails.env
|
||||
BatchMailer.send_batch_email(self.id, bset.user_id).deliver!
|
||||
else
|
||||
BatchMailer.send_batch_email(self.id, bset.user_id).deliver
|
||||
BatchMailer.send_batch_email(self.id, bset.user_id).deliver_now
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -122,7 +122,7 @@ FOO
|
|||
if 'test' == Rails.env
|
||||
BatchMailer.send_batch_email_test(self.id).deliver!
|
||||
else
|
||||
BatchMailer.send_batch_email_test(self.id).deliver
|
||||
BatchMailer.send_batch_email_test(self.id).deliver_now
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ SQL
|
|||
self.fetch_recipients do |user, new_musicians|
|
||||
self.opt_in_count += 1
|
||||
bset = EmailBatchSet.new_musician_set(self, user, new_musicians)
|
||||
UserMailer.new_musicians(user, new_musicians).deliver
|
||||
UserMailer.new_musicians(user, new_musicians).deliver_now
|
||||
end
|
||||
self.sent_count = self.opt_in_count
|
||||
self.save
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ SQL
|
|||
self.fetch_recipients(trigger_idx) do |users|
|
||||
users.each do |uu|
|
||||
self.email_batch_sets << (bset = self.make_set(uu, trigger_idx))
|
||||
ProgressMailer.send_reminder(bset).deliver
|
||||
ProgressMailer.send_reminder(bset).deliver_now
|
||||
sent += 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ module JamRuby
|
|||
self.fetch_recipients do |receiver, sessions_and_latency|
|
||||
self.opt_in_count += 1
|
||||
bset = EmailBatchSet.scheduled_session_set(self, receiver, sessions_and_latency)
|
||||
UserMailer.scheduled_session_daily(receiver, sessions_and_latency).deliver
|
||||
UserMailer.scheduled_session_daily(receiver, sessions_and_latency).deliver_now
|
||||
end
|
||||
|
||||
self.test_emails = _count_recipients.inspect
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ module JamRuby
|
|||
validates :email, uniqueness: true
|
||||
|
||||
def self.banned(user)
|
||||
EmailBlacklist.count(:conditions => "email = '#{user.email.downcase}'") >= 1
|
||||
EmailBlacklist.where("email = '#{user.email.downcase}'").count >= 1
|
||||
end
|
||||
|
||||
def self.listed(user)
|
||||
EmailBlacklist.count(:conditions => "email= '#{user.id}'") == 1
|
||||
EmailBlacklist.where("email = '#{user.id}'").count == 1
|
||||
end
|
||||
|
||||
def self.admin_url
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module JamRuby
|
|||
observe JamRuby::Feedback
|
||||
|
||||
def after_validation(feedback)
|
||||
CorpMailer.feedback(feedback).deliver unless feedback.errors.any?
|
||||
CorpMailer.feedback(feedback).deliver_now unless feedback.errors.any?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -73,7 +73,7 @@ module JamRuby
|
|||
[locid, countrycode, region, city, postalcode, latitude, longitude, metrocode, areacode])
|
||||
end
|
||||
|
||||
def self.i(s)
|
||||
def self.what(s)
|
||||
return 'NULL' if s.nil? or s.blank?
|
||||
return s.to_i
|
||||
end
|
||||
|
|
@ -175,7 +175,8 @@ module JamRuby
|
|||
metrocode = row[7]
|
||||
areacode = row[8]
|
||||
|
||||
vals = vals+sep+"(#{locid}, '#{countrycode}', '#{region}', #{quote_value(city)}, '#{postalcode}', #{latitude}, #{longitude}, #{i(metrocode)}, '#{areacode}')"
|
||||
quoted_city = quote_value(city, nil)
|
||||
vals = vals+sep+"(#{locid}, '#{countrycode}', '#{region}', #{quoted_city}, '#{postalcode}', #{latitude}, #{longitude}, #{what(metrocode)}, '#{areacode}')"
|
||||
sep = ','
|
||||
i += 1
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ module JamRuby
|
|||
after_save :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ module JamRuby
|
|||
after_save :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ module JamRuby
|
|||
after_save :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ module JamRuby
|
|||
after_save :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ module JamRuby
|
|||
after_save :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ module JamRuby
|
|||
has_many :servers, :class_name => "JamRuby::IcecastServer", :inverse_of => :master_relay, :foreign_key => "master_relay_id"
|
||||
has_many :templates, :class_name => "JamRuby::IcecastTemplate", :inverse_of => :master_relay, :foreign_key => "master_relay_id"
|
||||
|
||||
validates :master_server, presence: true, length: {minimum: 1}
|
||||
validates :master_server, length: {minimum: 1}
|
||||
validates :master_server_port, presence: true, numericality: {only_integer: true}, length: {in: 1..65535}
|
||||
validates :master_update_interval, presence: true, numericality: {only_integer: true}, length: {in: 1..1200}
|
||||
validates :master_username, presence: true, length: {minimum: 5}
|
||||
|
|
@ -18,8 +18,8 @@ module JamRuby
|
|||
after_save :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ module JamRuby
|
|||
belongs_to :server, class_name: "JamRuby::IcecastServer", inverse_of: :mounts, foreign_key: 'icecast_server_id'
|
||||
belongs_to :mount_template, class_name: "JamRuby::IcecastMountTemplate", inverse_of: :mounts, foreign_key: 'icecast_mount_template_id'
|
||||
|
||||
has_many :source_changes, class_name: "JamRuby::IcecastSourceChange", inverse_of: :mount, foreign_key: 'icecast_mount_id', order: 'created_at DESC'
|
||||
has_many :source_changes, -> { order('created_at DESC') }, class_name: "JamRuby::IcecastSourceChange", inverse_of: :mount, foreign_key: 'icecast_mount_id'
|
||||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
validates :source_username, length: {minimum: 5}, if: lambda {|m| m.source_username.present?}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module JamRuby
|
|||
end
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
servers.update_all(config_changed: 1)
|
||||
end
|
||||
|
||||
def sanitize_active_admin
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ module JamRuby
|
|||
before_destroy :poke_config
|
||||
|
||||
def poke_config
|
||||
IcecastServer.update(servers, config_changed: 1)
|
||||
templates.each { |template| IcecastServer.update(template.servers, config_changed: 1) }
|
||||
servers.update_all(config_changed: 1)
|
||||
templates.each { |template| template.servers.update_all(config_changed: 1) }
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue