Sha256: d6741c56fe1475df14c46ce95652b551b5c1d9efa9c60c0741e7fcbd381b33bb

Contents?: true

Size: 1.53 KB

Versions: 19

Compression:

Stored size: 1.53 KB

Contents

<thead class="bg-white border-b border-gray-200 pb-1">
  <% if @resource.record_selector %>
    <th class="rounded-lg">
      <%== item_select_all_input %>
    </th>
  <% end %>
  <% fields.each_with_index do |field, index|  %>
    <%
      if params[:sort_by] == field.id.to_s
        if params[:sort_direction] == 'asc'
          sort_by = nil
        else
          sort_by = field.id
        end

        if sort_by.present?
          case params[:sort_direction]
            when nil
              sort_direction = 'desc'
            when 'desc'
              sort_direction = 'asc'
            when 'asc'
              sort_direction = nil
            end
        else
          sort_direction = nil
        end
      else
        sort_by = field.id
        sort_direction = 'desc'
      end
      classes = "text-gray-500 tracking-tight leading-tight text-sm font-semibold" %>
    <th class="text-left uppercase px-3 py-4 whitespace-nowrap rounded-l">
      <% if field.sortable %>
        <%= link_to params.permit!.merge(sort_by: sort_by, sort_direction: sort_direction), class: "flex items-center #{classes} #{'cursor-pointer' if field.sortable}", 'data-turbo-frame': params[:turbo_frame] do %>
          <%= field.name %>
          <%= render partial: 'avo/partials/sortable_component', locals: {field: field} %>
        <% end %>
      <% else %>
        <div class="flex items-center <%= classes %>">
          <%= field.name %>
        </div>
      <% end %>
    </th>
  <% end %>
  <th class="w-24">
    <!-- Item controls cell -->
  </th>
</thead>

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
avo-2.5.2.pre.7 app/views/avo/partials/_table_header.html.erb
avo-2.5.2.pre.4 app/views/avo/partials/_table_header.html.erb
avo-2.5.2.pre.3 app/views/avo/partials/_table_header.html.erb
avo-2.5.2.pre.2 app/views/avo/partials/_table_header.html.erb
avo-2.5.2.pre.1 app/views/avo/partials/_table_header.html.erb
avo-2.5.1 app/views/avo/partials/_table_header.html.erb
avo-2.5.0 app/views/avo/partials/_table_header.html.erb
avo-2.4.1 app/views/avo/partials/_table_header.html.erb
avo-2.4.0 app/views/avo/partials/_table_header.html.erb
avo-2.3.1.pre.6 app/views/avo/partials/_table_header.html.erb
avo-2.3.1.pre.5 app/views/avo/partials/_table_header.html.erb
avo-2.3.1.pre.4 app/views/avo/partials/_table_header.html.erb
avo-2.3.1.pre.3 app/views/avo/partials/_table_header.html.erb
avo-2.3.1.pre.2 app/views/avo/partials/_table_header.html.erb
avo-2.3.1.pre.1 app/views/avo/partials/_table_header.html.erb
avo-2.3.0 app/views/avo/partials/_table_header.html.erb
avo-2.2.2 app/views/avo/partials/_table_header.html.erb
avo-2.2.1 app/views/avo/partials/_table_header.html.erb
avo-2.2.0 app/views/avo/partials/_table_header.html.erb