Module: Cms::UiElementsHelper
- Defined in:
- app/helpers/cms/ui_elements_helper.rb
Instance Method Summary collapse
-
#publish_button(type) ⇒ Object
For simple publish buttons.
-
#save_and_publish_button(block, content_type) ⇒ Object
Renders a Save And Publish button if: 1.
- #select_content_type_tag(type, &block) ⇒ Object
Instance Method Details
#publish_button(type) ⇒ Object
For simple publish buttons
15 16 17 18 |
# File 'app/helpers/cms/ui_elements_helper.rb', line 15 def (type) html = %Q{<button type="submit" name="#{type}[publish_on_save]" value="true" class="submit"><span>Save And Publish</span></button>'} html.html_safe end |
#save_and_publish_button(block, content_type) ⇒ Object
Renders a Save And Publish button if:
-
Current User has publish rights
-
Block is publishable
7 8 9 10 11 12 |
# File 'app/helpers/cms/ui_elements_helper.rb', line 7 def (block, content_type) if current_user.able_to?(:publish_content) && block.publishable? html = %Q{<button type="submit" name="#{content_type.content_block_type.singularize}[publish_on_save]" value="true" class="submit" tabindex="#{next_tabindex}"><span>Save And Publish</span></button>} html.html_safe end end |
#select_content_type_tag(type, &block) ⇒ Object
21 22 23 24 25 |
# File 'app/helpers/cms/ui_elements_helper.rb', line 21 def select_content_type_tag(type, &block) = {:rel => "select-#{type.key}"} [:class] = "on" if content_type == type content_tag_for(:li, type, nil, , &block) end |