Sha256: 15f8aab04e82202194ac4aa50e949f8652f3aab3651b72ea05c6094a7fabffa7

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

ruby:
  colspan = cols.length + 1
  colspan += 1 if ordered
  colspan += 1 if has_thumb
  colspan -= 1 if hide_delete_button
  table_class = ordered ? 'js-sort-row' : nil

  options_for_td = { cols: cols, edit_path: edit_path, edit_column: edit_column }

table class=table_class
  thead
    tr
      - if ordered
        th.th-sortable-handle
      - if has_thumb
        th.-thumb
      - cols.each do |col|
        = th_columns(col)
      - if edit_column
        th.-action data-sorter="false"
      - unless hide_delete_button
        th.-action
  tbody
    - records = index ? @items : parent_item.send(assoc)
    - if records.present?
      - records.each do |item|
        tr id=tr_id(item)
          - if ordered
            td.sortable-handle: i.icon-sort
          - if has_thumb
            td = image_tag(item.asset.thumb.url)
          - cols.each do |col|
            - options_for_td[:col] = col
            - options_for_td[:item] = item
            = td_columns(options_for_td)
          - if edit_column
            td
              a.js-edit-link.js-tooltip.table-action title=t('fae.common.edit') href=self.send(edit_path, item)
                i.icon-edit
          - unless hide_delete_button
            td = fae_delete_button item, "/#{fae_path}/#{assoc_name}/#{item.id.to_s}", class: 'js-tooltip table-action js-delete-link', remote: true

    - elsif !hide_add_button
      tr
        - td_link = link_to 'add some', new_path, class: 'js-add-link'

        td colspan=colspan.to_s No #{title} yet, #{td_link}.
    - else
      tr
        td colspan=colspan.to_s No #{title} yet.

.js-addedit-form-wrapper

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fae-rails-3.0.0 app/views/fae/shared/_shared_nested_table.html.slim