Sha256: 2e7256f514e3282332182ca38abf567b55384ca6b5547488a6ab540dec9eca70

Contents?: true

Size: 1.31 KB

Versions: 37

Compression:

Stored size: 1.31 KB

Contents

%table{ class: table_css_classes }
  - if show_header
    %thead
      %tr
        - columns.each do |name, options|
          - title = options.delete(:title)
          - if title.nil?
            - if resource_class.respond_to?(:human_attribute_name)
              - title = resource_class.human_attribute_name(name)
            - else
              - title = name
          - elsif title === false
            - title = nil
          - if options.has_key?(:sort)
            %td= sort_link(name, title, options[:sort])
          - else
            %td= title
  %tbody
    - collection.each do |resource|
      - tr_options = { class: resource_class.name.underscore.gsub('/', '-') }
      - if resource.respond_to?(:model_name)
        - tr_options[:id] = dom_id(resource)
      - else
        - tr_options[:id] = "#{resource.class.name.underscore.gsub('/', '-')}-#{resource.object_id}"
      %tr{ tr_options }
        - columns.each do |name, options|
          - td_options = { class: "attribute-#{name}", id: "#{tr_options[:id]}-#{name}"}
          - if options[:block].present?
            %td{ td_options }= options[:block].call(resource)
          - else
            %td{ td_options }
              = render partial: "rao/component/table/body_cells/#{options[:render_as]}", locals: { resource: resource, name: name, options: options }

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
rao-component-0.0.47.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.46.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.45.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.44.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.43.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.42.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.41.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.40.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.39.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.38.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.37.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.36.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.35.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.34.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.33.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.32.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.31.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.30.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.29.pre app/views/rao/component/_collection_table.html.haml
rao-component-0.0.28.pre app/views/rao/component/_collection_table.html.haml