Sha256: dba6e132157381f97e58d44a6b71a6d699bb828b0231aeb6808178be8f3ecdbd

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

.fg-datawrapper{ :class => "fg-#{fancygrid.name}"}
  %table.fg-datacontainer{ :class => fancygrid.table_class, :id => fancygrid.table_id }
    %tr.fg-header
      - fancygrid.visible_columns.each do |column|
        %th{ :class => column.tag_class + (column.searchable ? " fg-orderable" : ""), :"fg-identifier" => column.identifier, :"fg-sort-order" => column.sort_order }
          .fg-head-wrapper.fg-order-tag
            = column.human_name
    - if fancygrid.simple_search?
      %tr.fg-search
        - fancygrid.visible_columns.each do |column|
          %td{ :class => column.tag_class }
            - next unless column.searchable
            .fg-search-criterion
              = hidden_field_tag(:identifier, column.identifier)
              - if column.search_options
                = hidden_field_tag(:operator, :starts_with)
                = select_tag(:value, options_from_collection_for_select(column.search_options, :last, :first), :selected => column.search_value)
              - else
                = hidden_field_tag(:operator, fancygrid.search_operator)
                = text_field_tag(:value, column.search_value)

    - count = 1
    - fancygrid.records.each do |record|
      - count = 1 - count
      %tr.fg-row{ :class => fancygrid.tr_class(record).to_s + " " + (count == 1 ? "odd" : "even"), :id => fancygrid.tr_id(record) }
        - fancygrid.visible_columns.each do |column|
          %td{ :class => column.tag_class.to_s + " " + fancygrid.td_class(record).to_s, :id => fancygrid.td_id(record) }
            = render_fancygrid_cell(record, column, &format_block)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fancygrid-2.0.8 app/views/fancygrid/table.html.haml
fancygrid-2.0.7 app/views/fancygrid/table.html.haml