Show supporter level ticket URL on the registration page

This commit is contained in:
Matt Barringer 2013-02-03 12:46:44 +01:00
parent 973913b3bf
commit 5d3864d7da
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,14 @@
module RegistrationHelper
def generate_supporter_level_js(conference)
str = ""
conference.supporter_levels.map do |t|
next if t.url.empty?
str += "if ($('#registration_supporter_registration_attributes_supporter_level_id option:selected').text() == '#{t.title}') {\n"
str += "console.log('#{t.title}');\n"
str += "str = 'If you have a confirmation or registration code, enter it here. Otherwise, you can purchase a <i>#{t.title}</i> ticket <a href=\"#{t.url}\" target=_new>here</a>, if you need to.';\n"
str += "}\n\n"
end.join("\n")
str
end
end