Sha256: 34f980710e5aa2e92ec99bd82ae6abc58a5c4b69707962968c30b73d8de7f443

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

<div class="table overflow-x-auto mb-12 w-full rounded-lg border border-mid">
  <div class="table-header-group">
    <div class="table-row text-base font-medium text-white bg-mid">
      <% columns.each_with_index do |column, i| %>
        <div class="table-cell sticky top-0 z-10 p-4 <% if i.zero? %>rounded-tl-md<% elsif i == columns.size - 1 %>rounded-tr-md<% end %>"><%= column.label %></div>
      <% end %>
    </div>
  </div>

  <% if @rows.any? %>
  <div class="table-row-group">
    <% @rows.each do |row| %>
      <div class="table-row relative bg-mid/5 hover:bg-mid/20" data-post-id="<%= row.id %>">
        <% @columns.each do |column| %>
          <div class="table-cell py-5 px-3 h-20 text-sm align-middle whitespace-nowrap border-b border-mid/20">
            <%= view_context.capture(row, &column.cell) %>
          </div>
        <% end %>
        <div class="table-cell py-5 px-3 h-20 text-sm align-middle whitespace-nowrap border-b border-mid/20">
          <%= button_to "Delete", view_context.admin_post_path(row), method: :delete, class: "btn btn-danger", data: { confirm: "Are you sure?" } %>
        </div>
      </div>
    <% end %>
  </div>
</div>
  <% else %>
</div>
<div class="text-center mx-12 block border border-dashed py-12 rounded-lg">
  <h3 class="py-1 text-xl font-semibold text-gray-900">No <%= @term.pluralize %></h3>
  <p class="py-1 text-base text-gray-500">Get started by creating a new <%= @term %>.</p>
</div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
panda-cms-0.7.2 app/components/panda/cms/admin/table_component.html.erb