Sha256: 8aa1cf95ad81301062363045b6a956d57bad2abbc87ab1b737915447fbabd44d

Contents?: true

Size: 1.39 KB

Versions: 70

Compression:

Stored size: 1.39 KB

Contents

- associated_records = ar_object.send(nested_field.field_name)
- if nested_field.display_type == :table
  div class="#{nested_field.label ? 'card-info' : ''}"
    - if nested_field.label
      p.card-info__label = nested_field.label.to_s.titleize
    .card-info__description.nested-table-wrapper data-table-name="#{nested_field.field_name}"
      table.nested-table
        thead
          tr
            - nested_field.fields.each do |field|
              th scope="col" data-field-type="#{field.field_type}"
                - if field.label
                  = field.label || field.field_name.to_s.titleize
        tbody
          - associated_records.each do |record|
            tr
              - nested_field.fields.each do |field|
                td data-field-type="#{field.field_type}"
                  = show_field_value(record, field)  
- else
  - associated_records.each do |record|
    .card.mb-3  data-table-name="#{nested_field.field_name}"
      .card-body
        .card-info
          .card-info__title = nested_section_title(record, nested_field)
        - nested_field.fields.each do |field|
          = show_field(record, field)  

        - if nested_field.associated_fields.present?
          - nested_field.associated_fields.each do |associated_nested_field|
            = render partial: 'cm_admin/main/nested_table_section', locals: { nested_field: associated_nested_field, ar_object: record }

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
cm-admin-1.5.47 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.46 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.45 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.44 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.43 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.42 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.41 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.40 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.39 app/views/cm_admin/main/_nested_table_section.html.slim
cm-admin-1.5.38 app/views/cm_admin/main/_nested_table_section.html.slim