diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -107,16 +107,11 @@ end end - def problem_select(problems, options = {}) - prefix = options[:with_specific_in_header] ? [[(t 'main.specified_in_header'),'-1']] : [] - selected = options[:selected] || (options[:with_specific_in_header] ? -1 : nil) - puts "selected = #{selected} hehe" - html_options = {class: 'select2 form-control'} - html_options[:id] = options[:id]if options[:id] - select 'submission', - 'problem_id', prefix + problems.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]}, - (selected ? { selected: "#{selected}"} : {} ), - html_options + def toggle_button(on,toggle_url,id) + link_to (on ? "Yes" : "No"), toggle_url, + {class: "btn btn-block btn-xs btn-#{on ? 'success' : 'default'} ajax-toggle", + id: id, + data: {remote: true, method: 'get'}} end def user_title_bar(user)