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='#{[:id]}' #{data_string} class='shadow #{[:mainclass]}' #{("style='height: %spx'" % [:height]) if [:height]} style='#{[:mainstyle]}'>") concat raw("<legend class='#{[:class]}' style='#{[: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-#{[: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 #{[:default_class]}'>" html << "#{name}<div class='tooltip-box-content #{[:css]} box rounded shadow'>#{capture(&block)}</div></div></div>" concat(html.html_safe) end |