Sha256: 121965f9ffb0001936db0db30da01ac37394629ba352d99f3e94c7bc82ebd0e4

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

<div class="flex justify-between">
  <h1><%= resource.friendly_name.pluralize %></h1>
  <%= link_to "New #{resource.friendly_name}", resource.new_path %>
</div>

<div>
  <% if resource.scopes.any? %>
    <%= link_to "All", resource.index_path %>
  <% end %>

  <% resource.scopes.each do |scope| %>
    <%= link_to scope.to_s.humanize, resource.index_path(scope: scope) %>
  <% end %>
</div>

<table class="table-auto">
  <thead>
    <tr>
      <% resource.attributes.each do |attribute| %>
        <% next if attribute[:field].nil? %>
        <% next unless attribute[:field].visible?(action_name) %>

        <th><%= attribute[:name].to_s.titleize %></th>
      <% end %>
      <th>Actions</th>
    </tr>
  </thead>

  <tbody>
    <% @records.each do |record| %>
      <tr>
        <% resource.attributes.each do |attribute| %>
          <% next if attribute[:field].nil? %>
          <% next unless attribute[:field].visible?(action_name) %>

          <% field = attribute[:field] %>

          <td><%= render partial: field.to_partial_path("index"), locals: { field: field, record: record } %></td>
        <% end %>

        <td><%= link_to "View", resource.show_path(record) %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%== pagy_nav(@pagy) if @pagy.pages > 1 %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
madmin-1.1.0 app/views/madmin/application/index.html.erb
madmin-1.0.2 app/views/madmin/application/index.html.erb
madmin-1.0.1 app/views/madmin/application/index.html.erb
madmin-1.0.0 app/views/madmin/application/index.html.erb
madmin-1.0.0.beta2 app/views/madmin/application/index.html.erb
madmin-1.0.0.beta1 app/views/madmin/application/index.html.erb