configs
This commit is contained in:
parent
98bde49131
commit
bc4e5607ee
|
|
@ -141,12 +141,9 @@ module JamRuby
|
|||
|
||||
end
|
||||
|
||||
MIN_SESSION_DURATION_RATING = 60
|
||||
|
||||
def should_rate_session?
|
||||
(2 <= music_session.unique_users.length &&
|
||||
MIN_SESSION_DURATION_RATING < (Time.now - music_session.created_at).seconds) ||
|
||||
Rails.env.development?
|
||||
(APP_CONFIG.rating_dialog_min_num <= music_session.unique_users.length &&
|
||||
APP_CONFIG.rating_dialog_min_time < (Time.now - music_session.created_at).seconds)
|
||||
end
|
||||
|
||||
def good_rating?
|
||||
|
|
|
|||
|
|
@ -306,6 +306,14 @@ def app_config
|
|||
1
|
||||
end
|
||||
|
||||
def rating_dialog_min_num
|
||||
1
|
||||
end
|
||||
|
||||
def rating_dialog_min_time
|
||||
false
|
||||
end
|
||||
|
||||
def jam_class_card_wait_period_year
|
||||
1
|
||||
end
|
||||
|
|
|
|||
|
|
@ -40,10 +40,13 @@
|
|||
|
||||
function getRating() {
|
||||
if ($('#btn-rate-session-down', $scopeSelector).hasClass('selected')) {
|
||||
console.log("user chose a bad rating")
|
||||
return -1;
|
||||
} else if ($('#btn-rate-session-up', $scopeSelector).hasClass('selected')) {
|
||||
console.log("user chose a good rating")
|
||||
return 1;
|
||||
}
|
||||
console.log("user chose no rating")
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -466,5 +466,8 @@ if defined?(Bundler)
|
|||
config.paypal_debug = true
|
||||
config.paypal_express_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout' # drop sandbox for production
|
||||
config.paypal_admin_only = true
|
||||
|
||||
config.rating_dialog_min_time = 60
|
||||
config.rating_dialog_min_num = 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -108,4 +108,7 @@ SampleApp::Application.configure do
|
|||
config.jamclass_enabled = true
|
||||
config.jamblaster_menu = true
|
||||
config.recaptcha_enable = false
|
||||
|
||||
config.rating_dialog_min_time = 1
|
||||
config.rating_dialog_min_num = 1
|
||||
end
|
||||
|
|
|
|||
|
|
@ -160,6 +160,14 @@ def web_config
|
|||
def jam_class_card_wait_period_year
|
||||
1
|
||||
end
|
||||
|
||||
def rating_dialog_min_time
|
||||
false
|
||||
end
|
||||
|
||||
def rating_dialog_min_num
|
||||
1
|
||||
end
|
||||
end
|
||||
klass.new
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue