Module: FriendsFormsHelper
- Defined in:
- app/helpers/friends_forms_helper.rb
Instance Method Summary collapse
- #fieldset(title, options = {}, &block) ⇒ Object
- #tooltip_box(tooltip, options = {fallback: false}) ⇒ Object
- #tooltip_content_box(name, options = {}, &block) ⇒ Object
Instance Method Details
#fieldset(title, options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/friends_forms_helper.rb', line 3 def fieldset(title, = {}, &block) if [:if].nil? || [:if] == true data_string = " " if [:data] [:data].each {|d,v| data_string << "#{d}='v' "} end concat raw("<fieldset id='#{options[:id]}' #{data_string} class='shadow #{options[:mainclass]}' #{("style='height: %spx'" % options[:height]) if options[:height]} style='#{options[:mainstyle]}'>") concat raw("<legend class='#{options[:class]}' style='#{options[:style]}'>#{title}</legend><div class='fieldset-content'>") yield concat raw("</div></fieldset>") end end |
#tooltip_box(tooltip, options = {fallback: false}) ⇒ Object
16 17 18 |
# File 'app/helpers/friends_forms_helper.rb', line 16 def tooltip_box(tooltip, = {fallback: false}) "<span class='label-tooltip label-tooltip-fallback-#{options[:fallback]}' title='#{tooltip}'> </span>".html_safe end |
#tooltip_content_box(name, options = {}, &block) ⇒ Object
20 21 22 23 24 25 |
# File 'app/helpers/friends_forms_helper.rb', line 20 def tooltip_content_box(name, = {}, &block) [:default_class] ||= "icon-clue" html = "<div class='tooltip-box'><div class='tooltip-box-label #{options[:default_class]}'>" html << "#{name}<div class='tooltip-box-content #{options[:css]} box rounded shadow'>#{capture(&block)}</div></div></div>" concat(html.html_safe) end |