Sha256: 3e7bd5dedb1a428c867005452b9084d292b392e328c132fe67cb0e774b493d59

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

<tr>
  <% grid.html_columns(*options[:columns]).each do |column| %>
    <%= tag.th(
      # Consider maintaining consistency with datagrid/rows partial
      "data-column": column.name,
      **column.tag_options,
      class: [        
        column.tag_options[:class],
        # Adding HTML classes based on condition
        "datagrid-order-active-asc": grid.ordered_by?(column, false),
        "datagrid-order-active-desc": grid.ordered_by?(column, true),
      ]
    ) do %>
      <%= column.header %>
      <% if column.supports_order? && options[:order] -%>
        <div class="datagrid-order">
          <%= link_to(
            I18n.t("datagrid.table.order.asc"),
            datagrid_order_path(grid, column, false),
            class: "datagrid-order-control-asc"
          ) %>
          <%= link_to(
            I18n.t("datagrid.table.order.desc"),
            datagrid_order_path(grid, column, true),
            class: "datagrid-order-control-desc"
          ) %>
        </div>
      <% end -%>
    <% end -%>
  <% end %>
</tr>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
datagrid-2.0.0 app/views/datagrid/_head.html.erb
datagrid-2.0.0.pre.alpha app/views/datagrid/_head.html.erb