2012-09-21 04:46:45 +00:00
|
|
|
class ClientsController < ApplicationController
|
|
|
|
|
|
2014-02-13 18:27:38 +00:00
|
|
|
include ClientHelper
|
2012-09-28 08:20:43 +00:00
|
|
|
include UsersHelper
|
|
|
|
|
|
2014-05-16 19:39:37 +00:00
|
|
|
|
|
|
|
|
AUTHED = %W{friend}
|
|
|
|
|
|
2021-09-04 13:41:24 +00:00
|
|
|
def scripts
|
|
|
|
|
_index
|
|
|
|
|
render :layout => 'scripts', content_type: 'text/javascript'
|
|
|
|
|
end
|
2014-05-16 19:39:37 +00:00
|
|
|
|
2012-09-21 04:46:45 +00:00
|
|
|
def index
|
2021-09-04 13:41:24 +00:00
|
|
|
_index
|
2014-03-21 03:23:33 +00:00
|
|
|
render :layout => 'client'
|
2013-11-28 12:15:22 +00:00
|
|
|
end
|
|
|
|
|
|
2014-05-16 19:39:37 +00:00
|
|
|
def latency_tester
|
|
|
|
|
render :layout => 'client'
|
|
|
|
|
end
|
2013-11-28 12:15:22 +00:00
|
|
|
|
|
|
|
|
def auth_action
|
|
|
|
|
if current_user
|
|
|
|
|
session.delete(:return_to) if session[:return_to] =~ /authed/
|
|
|
|
|
# FIXME: implement auth-action on a per-case basis
|
|
|
|
|
redirect_to(client_url) and return
|
|
|
|
|
else
|
|
|
|
|
if AUTHED.include?(params[:authed])
|
|
|
|
|
session[:return_to] = auth_action_url(:authed => params[:authed], :data => params[:data])
|
|
|
|
|
else
|
|
|
|
|
session.delete(:return_to) if session[:return_to] =~ /authed/
|
|
|
|
|
end
|
|
|
|
|
redirect_to client_url
|
2013-01-28 15:50:16 +00:00
|
|
|
end
|
2012-09-21 04:46:45 +00:00
|
|
|
end
|
2021-03-24 13:17:16 +00:00
|
|
|
|
2021-09-04 13:41:24 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def _index
|
|
|
|
|
enable_olark
|
|
|
|
|
gon.olark_box_start_hidden = true
|
|
|
|
|
|
|
|
|
|
# we want to enforce that /client is always the client view prefix
|
|
|
|
|
# this is a side effect of setting root path to '/'; soon we can remove this when we implement the new home page
|
|
|
|
|
if request.path == '/'
|
|
|
|
|
redirect_to client_url
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if current_user
|
|
|
|
|
@is_guitar_center = false #current_user.is_guitar_center?
|
|
|
|
|
gon.user_id = current_user.id
|
|
|
|
|
gon.user_email = current_user.email
|
|
|
|
|
gon.user_name = current_user.name
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@in_client_page = true
|
|
|
|
|
@minimal_curtain = Rails.application.config.minimal_curtain
|
|
|
|
|
gon.recurly_tax_estimate_jam_track_plan = Rails.application.config.recurly_tax_estimate_jam_track_plan
|
|
|
|
|
end
|
2012-09-21 04:46:45 +00:00
|
|
|
end
|