244 lines
8.3 KiB
Ruby
244 lines
8.3 KiB
Ruby
class LandingsController < ApplicationController
|
|
|
|
include LandingsHelper
|
|
|
|
respond_to :html
|
|
|
|
def watch_bands
|
|
@promo_buzz = PromoBuzz.active
|
|
|
|
if Rails.application.config.use_promos_on_homepage
|
|
@promo_latest = PromoLatest.active
|
|
else
|
|
@promo_latest, start = Feed.index(nil, limit: 10)
|
|
end
|
|
|
|
page = params['p'].to_i
|
|
|
|
if page == 2
|
|
render 'watch_bands_2', layout: 'web'
|
|
elsif page == 3
|
|
render 'watch_bands_3', layout: 'web'
|
|
else
|
|
render 'watch_bands_1', layout: 'web'
|
|
end
|
|
end
|
|
|
|
def watch_overview_kick
|
|
render 'watch_kick', layout: 'web'
|
|
end
|
|
|
|
def watch_overview_kick2
|
|
render 'watch_kick_2', layout: 'web'
|
|
end
|
|
|
|
def watch_overview_kick3
|
|
render 'watch_kick_3', layout: 'web'
|
|
end
|
|
|
|
def watch_overview_kick4
|
|
render 'watch_kick_4', layout: 'web'
|
|
end
|
|
|
|
def watch_overview
|
|
@promo_buzz = PromoBuzz.active
|
|
|
|
if Rails.application.config.use_promos_on_homepage
|
|
@promo_latest = PromoLatest.active
|
|
else
|
|
@promo_latest, start = Feed.index(nil, limit: 10)
|
|
end
|
|
|
|
page = params['p'].to_i
|
|
|
|
if page == 2
|
|
render 'watch_overview_2', layout: 'web'
|
|
elsif page == 3
|
|
render 'watch_overview_3', layout: 'web'
|
|
else
|
|
render 'watch_overview_1', layout: 'web'
|
|
end
|
|
end
|
|
|
|
def watch_bands_tight
|
|
render 'watch_bands_tight', layout: 'web'
|
|
end
|
|
|
|
def watch_overview_tight
|
|
render 'watch_overview_tight', layout: 'web'
|
|
end
|
|
|
|
|
|
def individual_jamtrack
|
|
@no_landing_tag = true
|
|
@landing_tag_play_learn_earn = true
|
|
@show_after_black_bar_border = true
|
|
instrument_id = nil
|
|
instrument_name = nil
|
|
instrument_count = 0
|
|
if params[:instrument]
|
|
instrument = params[:instrument].downcase.sub('-', ' ')
|
|
instrument = Instrument.find_by_id(instrument)
|
|
instrument_id = instrument.id if instrument
|
|
instrument_name = instrument.description
|
|
query, next_ptr, instrument_count = JamTrack.index({instrument: instrument_id}, current_user)
|
|
end
|
|
@jam_track = JamTrack.find_by_slug(params[:plan_code])
|
|
@jam_track = JamTrack.find_by_plan_code("jamtrack-" + params[:plan_code]) unless @jam_track
|
|
|
|
if @jam_track.nil?
|
|
redirect_to '/client/#jamtrack'
|
|
return
|
|
end
|
|
|
|
band_jam_track_count = @jam_track.band_jam_track_count
|
|
jam_track_count = JamTrack.count
|
|
@title = individual_jamtrack_title(false, params[:generic], @jam_track)
|
|
@description = individual_jamtrack_desc(false, params[:generic], @jam_track)
|
|
@page_data = {jam_track: @jam_track, all_track_count: jam_track_count, band_track_count: band_jam_track_count, band: false, generic: params[:generic], instrument: instrument_name, instrument_id: instrument_id, instrument_count: instrument_count}
|
|
gon.jam_track_plan_code = @jam_track.plan_code if @jam_track
|
|
gon.generic = params[:generic]
|
|
gon.instrument_id = instrument_id
|
|
render 'individual_jamtrack', layout: 'web'
|
|
end
|
|
|
|
|
|
|
|
def individual_jamtrack_band
|
|
@no_landing_tag = true
|
|
@landing_tag_play_learn_earn = true
|
|
@show_after_black_bar_border = true
|
|
@jam_track = JamTrack.find_by_slug(params[:plan_code])
|
|
@jam_track = JamTrack.find_by_plan_code("jamtrack-" + params[:plan_code]) unless @jam_track
|
|
|
|
if @jam_track.nil?
|
|
redirect_to '/client/#jamtrack'
|
|
return
|
|
end
|
|
|
|
band_jam_track_count = @jam_track.band_jam_track_count
|
|
jam_track_count = JamTrack.count
|
|
@title = individual_jamtrack_title(true, params[:generic], @jam_track)
|
|
@description = individual_jamtrack_desc(true, params[:generic], @jam_track)
|
|
@page_data = {jam_track: @jam_track, all_track_count: jam_track_count, band_track_count: band_jam_track_count, band: true, generic: params[:generic]}
|
|
gon.jam_track_plan_code = @jam_track.plan_code if @jam_track
|
|
gon.generic = params[:generic]
|
|
render 'individual_jamtrack', layout: 'web'
|
|
end
|
|
|
|
def individual_jamtrack_v2
|
|
@no_landing_tag = true
|
|
instrument_id = nil
|
|
instrument_name = nil
|
|
instrument_count = 0
|
|
if params[:instrument]
|
|
instrument = params[:instrument].downcase.sub('-', ' ')
|
|
instrument = Instrument.find_by_id(instrument)
|
|
instrument_id = instrument.id if instrument
|
|
instrument_name = instrument.description
|
|
query, next_ptr, instrument_count = JamTrack.index({instrument: instrument_id}, current_user)
|
|
end
|
|
@jam_track = JamTrack.find_by_slug(params[:plan_code])
|
|
@jam_track = JamTrack.find_by_plan_code("jamtrack-" + params[:plan_code]) unless @jam_track
|
|
band_jam_track_count = @jam_track.band_jam_track_count
|
|
jam_track_count = JamTrack.count
|
|
@title = individual_jamtrack_title(false, params[:generic], @jam_track)
|
|
@description = individual_jamtrack_desc(false, params[:generic], @jam_track)
|
|
@page_data = {jam_track: @jam_track, all_track_count: jam_track_count, band_track_count: band_jam_track_count, band: false, generic: params[:generic], instrument: instrument_name, instrument_id: instrument_id, instrument_count: instrument_count}
|
|
gon.jam_track_plan_code = @jam_track.plan_code if @jam_track
|
|
gon.generic = params[:generic]
|
|
gon.instrument_id = instrument_id
|
|
render 'individual_jamtrack_v2', layout: 'web'
|
|
end
|
|
|
|
|
|
def individual_jamtrack_band_v2
|
|
@no_landing_tag = true
|
|
@jam_track = JamTrack.find_by_slug(params[:plan_code])
|
|
@jam_track = JamTrack.find_by_plan_code("jamtrack-" + params[:plan_code]) unless @jam_track
|
|
band_jam_track_count = @jam_track.band_jam_track_count
|
|
jam_track_count = JamTrack.count
|
|
@title = individual_jamtrack_title(true, params[:generic], @jam_track)
|
|
@description = individual_jamtrack_desc(true, params[:generic], @jam_track)
|
|
@page_data = {jam_track: @jam_track, all_track_count: jam_track_count, band_track_count: band_jam_track_count, band: true, generic: params[:generic]}
|
|
gon.jam_track_plan_code = @jam_track.plan_code if @jam_track
|
|
gon.generic = params[:generic]
|
|
render 'individual_jamtrack_v2', layout: 'web'
|
|
end
|
|
|
|
def individual_jamtrack_v1
|
|
@no_landing_tag = true
|
|
@show_cta_free_jamtrack = true
|
|
@jam_track = JamTrack.find_by_plan_code("jamtrack-" + params[:plan_code])
|
|
gon.jam_track_plan_code = params[:plan_code] ? "jamtrack-" + params[:plan_code] : nil
|
|
gon.generic = params[:generic]
|
|
render 'individual_jamtrack_v1', layout: 'web'
|
|
end
|
|
|
|
def individual_jamtrack_band_v1
|
|
@no_landing_tag = true
|
|
@show_cta_free_jamtrack = true
|
|
@jam_track = JamTrack.find_by_plan_code("jamtrack-" + params[:plan_code])
|
|
gon.jam_track_plan_code = params[:plan_code] ? "jamtrack-" + params[:plan_code] : nil
|
|
|
|
render 'individual_jamtrack_band_v1', layout: 'web'
|
|
end
|
|
|
|
def product_jamblaster
|
|
render 'product_jamblaster', layout: 'web'
|
|
end
|
|
|
|
def product_platform
|
|
@no_landing_tag = true
|
|
@landing_tag_play_learn_earn = true
|
|
@show_after_black_bar_border = true
|
|
render 'product_platform', layout: 'web'
|
|
end
|
|
|
|
def product_jamtracks
|
|
gon.generic = true
|
|
gon.just_previews = true
|
|
jam_track = JamTrack.select('plan_code').where(plan_code: Rails.application.config.nominated_jam_track).first
|
|
unless jam_track
|
|
jam_track = JamTrack.first
|
|
end
|
|
|
|
gon.jam_track_plan_code = jam_track.plan_code if jam_track
|
|
render 'product_jamtracks', layout: 'web'
|
|
end
|
|
|
|
def affiliate_program
|
|
render 'affiliate_program', layout: 'web'
|
|
end
|
|
|
|
def redeem_giftcard
|
|
@no_landing_tag = true
|
|
@landing_tag_play_learn_earn = true
|
|
render 'redeem_giftcard', layout: 'web'
|
|
end
|
|
|
|
def buy_gift_card
|
|
@no_landing_tag = true
|
|
@landing_tag_play_learn_earn = true
|
|
@show_after_black_bar_border = true
|
|
@jam_track = JamTrack.find_by_slug('elton-john-rocket-man')
|
|
@jam_track = JamTrack.first unless @jam_track
|
|
|
|
instrument_id = nil
|
|
instrument_name = nil
|
|
instrument_count = 0
|
|
|
|
band_jam_track_count = @jam_track.band_jam_track_count
|
|
jam_track_count = JamTrack.count
|
|
@title = individual_jamtrack_title(false, params[:generic], @jam_track)
|
|
@description = individual_jamtrack_desc(false, params[:generic], @jam_track)
|
|
@page_data = {jam_track: @jam_track, all_track_count: jam_track_count, band_track_count: band_jam_track_count, band: false, generic: params[:generic], instrument: instrument_name, instrument_id: instrument_id, instrument_count: instrument_count}
|
|
gon.jam_track_plan_code = @jam_track.plan_code if @jam_track
|
|
gon.generic = params[:generic]
|
|
gon.instrument_id = instrument_id
|
|
|
|
render 'buy_gift_card', layout: 'web'
|
|
end
|
|
end
|
|
|