%
cats = Caboose::BlockTypeCategory.where(:show_in_sidebar => true).order(:sort_order).all
grid = Caboose::BlockType.where(:name => 'flex_grid').first
seen_btids = [0]
%>
Drag a block
onto the page.
<% if grid %>
- Structure
-
2 Column Row
-
3 Column Row
-
4 Column Row
-
5 Column Row
<% end %>
<% cats.each do |cat| %>
<% block_types = Caboose::BlockType.joins(:sites).where(:parent_id => nil, :block_type_category_id => cat.id).where("sites.id = ?", @site.id).order(:description) %>
<% next if block_types.count == 0 %>
- <%= cat.name %>
<% block_types.each do |block_type| %>
-
<%= block_type.description %>
<% seen_btids << block_type.id %>
<% end %>
<% end %>
<% all_bts = Caboose::BlockType.joins(:sites).where(:parent_id => nil, :block_type_category_id => 2).where("sites.id = ?", @site.id).where("block_types.id not in (?)", seen_btids).order(:description) %>
<% if all_bts.count > 0 %>
- All Blocks
<% all_bts.each do |block_type| %>
-
<%= block_type.description %>
<% end %>
<% end %>