Sha256: aba12d7612d2ab67ab3fcd51721fc20cba4bae375890cdd350fc7179379c1658

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 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 gap-2 items-center px-4">
    <% resource.member_actions.each do |action| %>
      <%= instance_eval(&action)  %>
    <% end %>
    <%= 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" %>
    <%= button_to "Delete", resource.show_path(@record), method: :delete, data: { turbo_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

1 entries across 1 versions & 1 rubygems

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