2020-09-08 14:20:48 +00:00
|
|
|
<div class="p-6">
|
|
|
|
<div class="flex pb-6">
|
|
|
|
<div class="w-/12 flex-1 text-4xl">
|
2020-09-15 21:19:40 +00:00
|
|
|
<h1 class="px-4 -mb-2 mt-2"><%= schema.human_plural %></h1>
|
2020-09-08 14:20:48 +00:00
|
|
|
</div>
|
2020-09-15 21:19:40 +00:00
|
|
|
<div class="w-/12 text-4xl text-right px-4">
|
2020-09-08 14:20:48 +00:00
|
|
|
<%%= styled_button_link "New <%= schema.human_singular %>", to: Routes.<%= schema.route_helper %>_path(@conn, :new) %>
|
2020-07-30 16:05:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-29 17:07:36 +00:00
|
|
|
|
2020-09-08 14:20:48 +00:00
|
|
|
<div class="shadow rounded px-1 py-1 bg-white">
|
|
|
|
<table class="min-w-full leading-normal">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-09-15 21:19:40 +00:00
|
|
|
<%= for {k, _} <- schema.attrs do %> <th class="px-4 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"><%= Phoenix.Naming.humanize(Atom.to_string(k)) %></th>
|
2020-09-08 14:20:48 +00:00
|
|
|
<% end %>
|
2020-09-15 21:19:40 +00:00
|
|
|
<th class="px-4 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"></th>
|
2020-09-08 14:20:48 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<%%= case @<%= schema.plural %> do %>
|
|
|
|
<%%= [] -> %>
|
|
|
|
<tr>
|
2020-09-15 21:19:40 +00:00
|
|
|
<td class="px-4 py-6 border-b border-gray-200 bg-white text-sm" colspan="<%= (schema.attrs |> Enum.count()) + 1 %>">
|
2020-09-08 14:20:48 +00:00
|
|
|
No results.
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<%%= _ -> %>
|
|
|
|
<%%= for <%= schema.singular %> <- @<%= schema.plural %> do %>
|
|
|
|
<tr>
|
|
|
|
<%= for {k, _} <- schema.attrs do %>
|
2020-09-15 21:19:40 +00:00
|
|
|
<td class="px-4 py-6 border-b border-gray-200 bg-white text-sm">
|
2020-09-08 14:20:48 +00:00
|
|
|
<%%= link <%= schema.singular %>.<%= k %>, to: Routes.<%= schema.route_helper %>_path(@conn, :show, <%= schema.singular %>) %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
2020-09-15 21:19:40 +00:00
|
|
|
<td class="px-4 py-6 border-b border-gray-200 bg-white text-sm">
|
2020-09-08 14:20:48 +00:00
|
|
|
<label class="relative">
|
|
|
|
...
|
|
|
|
<input type="checkbox" class="hidden hidden-options-toggle">
|
2020-09-15 21:19:40 +00:00
|
|
|
<div class="hidden absolute right-0 rounded bg-white border shadow-lg py-6 w-48">
|
2020-09-08 14:20:48 +00:00
|
|
|
<%%= link "Edit", to: Routes.<%= schema.route_helper %>_path(@conn, :edit, <%= schema.singular %>), class: "block px-4 py-2 hover:bg-gray-100" %>
|
|
|
|
<%%= link "Delete", to: Routes.<%= schema.route_helper %>_path(@conn, :delete, <%= schema.singular %>), method: :delete, data: [confirm: "Are you sure?"], class: "text-red-600 block px-4 py-2 hover:bg-gray-100" %>
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<%% end %>
|
|
|
|
<%% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2020-07-30 16:05:09 +00:00
|
|
|
</div>
|