Sha256: 4d92ca42840b3765c075f176e2100e1e65dc8cf88c25a67a2214d1dc7e61906a

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

- begin
  - nodes = record.fragment_nodes
  - namespace = nodes.group_by(&:namespace)

  #form-fragments
    - if nodes.empty?
      .alert.alert-warning
        - if record.layout
          = link_to record.layout.label, edit_comfy_admin_cms_site_layout_path(@site, record.layout)
        = t(".no_tags").html_safe

    - else
      .tabbable
        - if namespace.size > 1
          .row
            .col-sm-2
            .col-sm-10
              %ul.nav.nav-tabs
                - namespace.each_with_index do |(name, tags), index|
                  %li.nav-item
                    - active = index == 0 ? "active" : nil
                    - label = t("comfy.cms.content.namespace.#{name}", default: name.humanize)
                    = link_to label, "#ns-#{name}", class: "nav-link #{active}", data: {toggle: "tab"}

        .tab-content
          - frag_index = 0

          - builder_opts = { builder: ComfortableMediaSurfer::FormBuilder, bootstrap: { layout: :horizontal }}
          = fields scope, model: record, **builder_opts do |form|
            - namespace.each_with_index do |(name, tags), index|
              .tab-pane{id: "ns-#{name}", class: index == 0 ? "active" : nil}
                - tags.each do |tag|
                  = form.fragment_field(tag, frag_index)
                  - frag_index += 1

- rescue ComfortableMediaSurfer::Content::Renderer::SyntaxError, ComfortableMediaSurfer::Content::Tag::Error => e
  .alert.alert-danger
    = e

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comfortable_media_surfer-3.0.0 app/views/comfy/admin/cms/fragments/_form_fragments.html.haml