Sha256: bab07abd9f2d0f2ca40d8c78dadb32831f78c37d8a467bfe5ee5b97adfe3ef8d

Contents?: true

Size: 967 Bytes

Versions: 10

Compression:

Stored size: 967 Bytes

Contents

- field_map = local_assigns[:field_map] || records_table_field_map

%table.records{:class => sortable_controller? ? 'sortable' : nil }
  %thead
    %tr
      - field_map[:fields].keys.each do |key|
        - if key.is_a?(Symbol)
          %th= resource_class.human_attribute_name(key)
        - else
          %th= orderable_column_link(key)
      %th= e9_t(:actions)
  %tbody
    - if collection.empty?
      %tr
        %td{:colspan => field_map[:fields].length + 1}= e9_t(:no_records_text)
    - else
      - collection.each do |record|
        %tr{:id => "ids_#{record.id}", :class => cycle('odd', 'even')}
          - field_map[:fields].each do |key, value|
            %td{:class => "record-#{key.to_s.dasherize}"}
              = value.respond_to?(:call) ? value.call(record) : record.send(key)
          %td.links
            - field_map[:links][record].each do |link|
              = link

- if @controller.should_paginate_index
  = will_paginate collection

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
e9_crm-0.1.21 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.20 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.19 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.18 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.17 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.16 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.14 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.13 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.12 app/views/e9_crm/resources/_table.html.haml
e9_crm-0.1.11 app/views/e9_crm/resources/_table.html.haml