Module: RulesEngineView::Buttons
- Defined in:
- lib/rules_engine_view/buttons.rb
Instance Method Summary collapse
-
#re_add_link(title, id) ⇒ Object
nested buttons.
-
#re_button_add(url, options = {}) ⇒ Object
ADD and REMOVE BUTTONS.
- #re_button_checked(url, options = {}) ⇒ Object
- #re_button_link(title, url, color, options = {}) ⇒ Object
- #re_button_link_blue(title, url, options = {}) ⇒ Object
- #re_button_link_gray(title, url, options = {}) ⇒ Object
- #re_button_link_green(title, url, options = {}) ⇒ Object
- #re_button_link_orange(title, url, options = {}) ⇒ Object
- #re_button_link_red(title, url, options = {}) ⇒ Object
- #re_button_remove(url, options = {}) ⇒ Object
- #re_button_select(url, options = {}) ⇒ Object
- #re_button_submit(title, color, options = {}) ⇒ Object
- #re_button_submit_blue(title, options = {}) ⇒ Object
- #re_button_submit_gray(title, options = {}) ⇒ Object
- #re_button_submit_green(title, options = {}) ⇒ Object
- #re_button_submit_orange(title, options = {}) ⇒ Object
- #re_button_submit_red(title, options = {}) ⇒ Object
- #re_button_unchecked(url, options = {}) ⇒ Object
- #re_remove_field(object_name, id) ⇒ Object
- #re_remove_link(title, object_name, id) ⇒ Object
Instance Method Details
#re_add_link(title, id) ⇒ Object
nested buttons
68 69 70 |
# File 'lib/rules_engine_view/buttons.rb', line 68 def re_add_link(title, id) link_to(title, "#", :class => 're-add-link', :id => "#{id}") end |
#re_button_add(url, options = {}) ⇒ Object
ADD and REMOVE BUTTONS
88 89 90 91 |
# File 'lib/rules_engine_view/buttons.rb', line 88 def url, = {} klass = "re-button-add #{[:class]}" link_to("", url, .merge(:class => klass)) end |
#re_button_checked(url, options = {}) ⇒ Object
103 104 105 106 |
# File 'lib/rules_engine_view/buttons.rb', line 103 def url, = {} klass = "re-button-checked #{[:class]}" link_to("", url, .merge(:class => klass)) end |
#re_button_link(title, url, color, options = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/rules_engine_view/buttons.rb', line 35 def (title, url, color, = {}) klass = "re-form-button-#{color} #{[:class]}" result = "<div class='re-form-button".html_safe result << " span-#{[:span]}" unless [:span].blank? result << "'>".html_safe result << link_to("<span>".html_safe + title + "</span>".html_safe, url, .merge(:class=> klass).except(:span)) result << "</div>".html_safe result end |
#re_button_link_blue(title, url, options = {}) ⇒ Object
49 50 51 |
# File 'lib/rules_engine_view/buttons.rb', line 49 def (title, url, = {}) return (title, url, "blue", ) end |
#re_button_link_gray(title, url, options = {}) ⇒ Object
45 46 47 |
# File 'lib/rules_engine_view/buttons.rb', line 45 def (title, url, = {}) return (title, url, "gray", ) end |
#re_button_link_green(title, url, options = {}) ⇒ Object
53 54 55 |
# File 'lib/rules_engine_view/buttons.rb', line 53 def (title, url, = {}) return (title, url, "green", ) end |
#re_button_link_orange(title, url, options = {}) ⇒ Object
57 58 59 |
# File 'lib/rules_engine_view/buttons.rb', line 57 def (title, url, = {}) return (title, url, "orange", ) end |
#re_button_link_red(title, url, options = {}) ⇒ Object
61 62 63 |
# File 'lib/rules_engine_view/buttons.rb', line 61 def (title, url, = {}) return (title, url, "red", ) end |
#re_button_remove(url, options = {}) ⇒ Object
93 94 95 96 |
# File 'lib/rules_engine_view/buttons.rb', line 93 def url, = {} klass = "re-button-remove #{[:class]}" link_to("", url, .merge(:class => klass)) end |
#re_button_select(url, options = {}) ⇒ Object
98 99 100 101 |
# File 'lib/rules_engine_view/buttons.rb', line 98 def url, = {} klass = "re-button-select #{[:class]}" link_to("", url, .merge(:class => klass)) end |
#re_button_submit(title, color, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/rules_engine_view/buttons.rb', line 4 def (title, color, ={}) klass = "re-form-button-#{color} #{[:class]}" result = "<div class='re-form-button".html_safe result << " span-#{[:span]}" unless [:span].blank? result << "'>".html_safe result << submit_tag(title, .merge(:class=> klass).except(:span)) result << "</div>".html_safe result end |
#re_button_submit_blue(title, options = {}) ⇒ Object
18 19 20 |
# File 'lib/rules_engine_view/buttons.rb', line 18 def (title, = {}) return (title, "blue", ) end |
#re_button_submit_gray(title, options = {}) ⇒ Object
14 15 16 |
# File 'lib/rules_engine_view/buttons.rb', line 14 def (title, = {}) return (title, "gray", ) end |
#re_button_submit_green(title, options = {}) ⇒ Object
22 23 24 |
# File 'lib/rules_engine_view/buttons.rb', line 22 def (title, = {}) return (title, "green", ) end |
#re_button_submit_orange(title, options = {}) ⇒ Object
26 27 28 |
# File 'lib/rules_engine_view/buttons.rb', line 26 def (title, = {}) return (title, "orange", ) end |
#re_button_submit_red(title, options = {}) ⇒ Object
30 31 32 |
# File 'lib/rules_engine_view/buttons.rb', line 30 def (title, = {}) return (title, "red", ) end |
#re_button_unchecked(url, options = {}) ⇒ Object
108 109 110 111 |
# File 'lib/rules_engine_view/buttons.rb', line 108 def url, = {} klass = "re-button-unchecked #{[:class]}" link_to("", url, .merge(:class => klass)) end |
#re_remove_field(object_name, id) ⇒ Object
79 80 81 82 83 84 |
# File 'lib/rules_engine_view/buttons.rb', line 79 def re_remove_field(object_name, id) return "" if id == 0 builder_id = object_name.gsub('[', '_').gsub(']', '') hidden_field_tag("#{object_name}[_delete]", "", :id => "#{builder_id}__delete") end |
#re_remove_link(title, object_name, id) ⇒ Object
72 73 74 75 76 77 |
# File 'lib/rules_engine_view/buttons.rb', line 72 def re_remove_link(title, object_name, id) return "" if id == 0 builder_id = object_name.gsub('[', '_').gsub(']', '') link_to(title, "#", :class => 're-remove-link', :id => "#{builder_id}_remove") end |