Module: BakeryTheme::ObjectListHelper
- Included in:
- BakeryThemeHelper
- Defined in:
- app/helpers/bakery_theme/object_list_helper.rb
Defined Under Namespace
Classes: ObjectListItem
Instance Method Summary collapse
- #group_list(options = {}, &block) ⇒ Object
- #object_list(options = {}, &block) ⇒ Object
- #object_list_item_for(object, options = {}) {|item| ... } ⇒ Object
Instance Method Details
#group_list(options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 4 def group_list( = {}, &block) attributes = attributes[:class] ||= [] attributes[:class] << "content_items" attributes[:class] << "object_list" # folder_item_list attributes[:class] << @content_space content = capture do yield end content_tag :ol, content, tag_attributes_for(attributes) end |
#object_list(options = {}, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 16 def object_list( = {}, &block) sortable = .delete :sortable object = .delete :object display_mode = .delete :display_mode custom_class = .delete :class refresh_url = .delete :update attributes = attributes[:id] = dom_id(object, :children) if object attributes[:'data-change-url'] = refresh_url if refresh_url attributes[:class] ||= [] attributes[:class] << custom_class if custom_class attributes[:class] << "object_list" #folder_item_list attributes[:class] << "content_list" attributes[:class] << "content_items" attributes[:class] << "grid_display" if display_mode == :grid attributes[:class] << "sortable_content" if sortable attributes[:class] << @content_space content = capture do yield end content << content_tag(:li, "", :class => "dragspace") if sortable content_tag :ol, content, tag_attributes_for(attributes) end |
#object_list_item_for(object, options = {}) {|item| ... } ⇒ Object
41 42 43 44 45 |
# File 'app/helpers/bakery_theme/object_list_helper.rb', line 41 def object_list_item_for object, = {} item = ObjectListItem.new object, , self yield item if block_given? item.to_html end |