Sha256: 0f611f25ef172678a9dafde3aa00ac72549f1b29ca55d8e0b92d13697ad77d9b

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

<div class="md:flex items-center justify-between mb-4">
  <h1 class="text-xl">
    <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-indigo-500" %>
    /
    <%= link_to resource.display_name(@record), resource.show_path(@record), class: "text-indigo-500 font-bold" %>
  </h1>

  <div class="flex items-center px-4">
    <div class="mr-2">
      <%= link_to "Edit", resource.edit_path(@record), class: "block bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow" %>
    </div>
    <%= button_to "Delete", resource.show_path(@record), method: :delete, data: { confirm: "Are you sure?" }, class: "bg-white hover:bg-gray-100 text-red-500 font-semibold py-2 px-4 border border-red-500 rounded shadow pointer-cursor" %>
  </div>
</div>

<div class="divide-y">
  <% resource.attributes.values.each do |attribute| %>
    <% next if attribute.field.nil? %>
    <% next unless attribute.field.visible?(action_name) %>

    <div class="px-4 py-3 md:grid md:grid-cols-4 md:gap-4 md:px-6">
      <div class="text-sm font-medium text-gray-500">
        <%= attribute.field.attribute_name.to_s.titleize %>
      </div>

      <div class="md:col-span-3">
        <%= render partial: attribute.field.to_partial_path("show"), locals: { field: attribute.field, record: @record, resource: resource } %>
      </div>
    </div>
  <% end %>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
madmin-1.2.6 app/views/madmin/application/show.html.erb
madmin-1.2.5 app/views/madmin/application/show.html.erb