2023-10-17 11:17:22 +13:00
|
|
|
<.header>
|
|
|
|
<%= @resource %> Listing
|
|
|
|
<:actions>
|
|
|
|
<.link href={~p"/<%= @route_prefix %>/new"}>
|
|
|
|
<.button>New <%= @resource %></.button>
|
|
|
|
</.link>
|
|
|
|
</:actions>
|
|
|
|
</.header>
|
|
|
|
|
|
|
|
<.table id="<%= @plural %>" rows={@<%= @plural %>} row_click={&JS.navigate(~p"/<%= @route_prefix %>/#{&1}")}>
|
|
|
|
<%= for attribute <- @attributes do %>
|
2023-10-25 03:22:24 +13:00
|
|
|
<:col :let={<%= @singular %>} label="<%= Phoenix.Naming.humanize(attribute.name) %>"><%%= <%= @singular %>.<%= attribute.name %> %></:col>
|
2023-10-17 11:17:22 +13:00
|
|
|
<% end %>
|
|
|
|
<:action :let={<%= @singular %>}>
|
|
|
|
<div class="sr-only">
|
|
|
|
<.link navigate={~p"/<%= @route_prefix %>/#{<%= @singular %>}"}>Show</.link>
|
|
|
|
</div>
|
|
|
|
<.link navigate={~p"/<%= @route_prefix %>/#{<%= @singular %>}/edit"}>Edit</.link>
|
|
|
|
</:action>
|
|
|
|
<:action :let={<%= @singular %>}>
|
|
|
|
<.link href={~p"/<%= @route_prefix %>/#{<%= @singular %>}"} method="delete" data-confirm="Are you sure?">
|
|
|
|
Delete
|
|
|
|
</.link>
|
|
|
|
</:action>
|
|
|
|
</.table>
|