Sha256: 01927a27084d857fdfa77a7990105ca8f6e1cc3c64c13471414ed3498fae5aa8

Contents?: true

Size: 1.28 KB

Versions: 11

Compression:

Stored size: 1.28 KB

Contents

- namespace = { }
- cms_object = @page || cms_object
- tags = cms_object.tags(true).select{|t| t.is_cms_block?}.uniq{|t| t.identifier}
- tags.each do |tag|
  - namespace[tag.namespace || 'default'] ||= []
  - namespace[tag.namespace || 'default'] << tag

#form-blocks
  - if tags.empty?
    .no-tags
      = link_to cms_object.layout.label, edit_comfy_admin_cms_site_layout_path(@site, cms_object.layout)
      = t('.no_tags').html_safe

  - else
    = fields_for :blocks, nil, :builder => ComfortableMexicanLoveseat::FormBuilder, :layout => :horizontal do |cms_blocks|

      .tabbable
        - if namespace.size > 1
          %ul.nav.nav-tabs
            - namespace.each_with_index do |(name, tags), index|
              %li{:class => index == 0 ? 'active' : nil}
                = link_to name.humanize, "#ns-#{name}", :data => {:toggle => 'tab'}
        .tab-content
          - block_index = 0
          - namespace.each_with_index do |(name, tags), index|
            .tab-pane{:id => "ns-#{name}", :class => index == 0 ? 'active' : nil}
              - tags.each do |tag|
                - begin
                  = cms_blocks.send(tag.class.to_s.demodulize.underscore, tag, block_index)
                - rescue
                  - Rails.env.production?? nil : raise
                - block_index += 1

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
comfortable_mexican_loveseat-0.0.23 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.22 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.21 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.20 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.19 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.18 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.17 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.16 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.15 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.14 app/views/comfy/admin/cms/pages/_form_blocks.html.haml
comfortable_mexican_loveseat-0.0.13 app/views/comfy/admin/cms/pages/_form_blocks.html.haml