Module: Skyline::ApplicationHelper
- Defined in:
- app/helpers/skyline/application_helper.rb
Instance Method Summary collapse
-
#has_js_layout? ⇒ Boolean
Does this template have a Skyline JS Layout set?.
-
#message(type, message, options = {}) ⇒ Object
You can use this method to place a message directly in your view.
-
#notification(type, message, options = {}) ⇒ Object
You can use this method to place a notification directly in your view.
-
#render_js_layout ⇒ Object
Actually render the JS code to initialize the previously set Skyline JS Layout.
-
#render_messages(options = {}) ⇒ Object
Actually render the messages on screen.
- #render_messages_javascript(options = {}) ⇒ Object
-
#render_notifications(options = {}) ⇒ Object
Actually render the notifications on screen.
- #render_notifications_javascript(options = {}) ⇒ Object
-
#tick_image(bool, options = {}) ⇒ Object
Place a tick or a cross depending on the value of bool.
-
#use_js_layout(name) ⇒ Object
Set the Skyline JS layout to use.
Instance Method Details
#has_js_layout? ⇒ Boolean
Does this template have a Skyline JS Layout set?
25 26 27 |
# File 'app/helpers/skyline/application_helper.rb', line 25 def has_js_layout? @_js_layout.present? end |
#message(type, message, options = {}) ⇒ Object
You can use this method to place a message directly in your view. This also works directly from a render(:update) or an update_page block.
43 44 45 |
# File 'app/helpers/skyline/application_helper.rb', line 43 def (type,,={}) Skyline::MessageGenerator.new(type,,) end |
#notification(type, message, options = {}) ⇒ Object
You can use this method to place a notification directly in your view. This also works directly from a render(:update) or an update_page block.
53 54 55 |
# File 'app/helpers/skyline/application_helper.rb', line 53 def notification(type,,={}) Skyline::NotificationGenerator.new(type,,) end |
#render_js_layout ⇒ Object
Currently only implemented in EntopicEditor plugin
Actually render the JS code to initialize the previously set Skyline JS Layout.
32 33 34 35 |
# File 'app/helpers/skyline/application_helper.rb', line 32 def render_js_layout return unless @_js_layout raise "TO BE IMPLEMENTED" end |
#render_messages(options = {}) ⇒ Object
Actually render the messages on screen.
60 61 62 |
# File 'app/helpers/skyline/application_helper.rb', line 60 def (={}) javascript_tag () end |
#render_messages_javascript(options = {}) ⇒ Object
71 72 73 |
# File 'app/helpers/skyline/application_helper.rb', line 71 def (={}) _render_volatiles(self.,) end |
#render_notifications(options = {}) ⇒ Object
Actually render the notifications on screen.
67 68 69 |
# File 'app/helpers/skyline/application_helper.rb', line 67 def render_notifications(={}) javascript_tag render_notifications_javascript() end |
#render_notifications_javascript(options = {}) ⇒ Object
75 76 77 78 |
# File 'app/helpers/skyline/application_helper.rb', line 75 def render_notifications_javascript(={}) .reverse_merge! :generator => Skyline::NotificationGenerator _render_volatiles(self.notifications,) end |
#tick_image(bool, options = {}) ⇒ Object
Place a tick or a cross depending on the value of bool
6 7 8 9 10 11 12 13 |
# File 'app/helpers/skyline/application_helper.rb', line 6 def tick_image(bool,={}) name = bool ? "true" : "false" src = "/skyline/images/icons/#{name}.gif" .reverse_merge! :alt => t(name, :scope => [:icons]) image_tag(src,) end |
#use_js_layout(name) ⇒ Object
Set the Skyline JS layout to use. Used in templates so the layout can initialize the correct layout.
18 19 20 |
# File 'app/helpers/skyline/application_helper.rb', line 18 def use_js_layout(name) @_js_layout = name end |