Packages

A way to increase Elixir projects readability and maintenance based on Use Cases and Interactors.

Current section

Files

Jump to
use_case priv templates use_case.gen.phx_resource_html index.html.eex
Raw

priv/templates/use_case.gen.phx_resource_html/index.html.eex

<h1><%%= gettext("Listing <%= @schema.human_plural %>") %></h1>
<table>
<thead>
<tr>
<%= for {k, _} <- @schema.attrs do %><th><%%= gettext("<%= Phoenix.Naming.humanize(Atom.to_string(k)) %>") %></th>
<% end %>
<th></th>
</tr>
</thead>
<tbody>
<%%= for <%= @schema.singular %> <- @<%= @schema.plural %> do %>
<tr>
<%= for {k, _} <- @schema.attrs do %> <td><%%= <%= @schema.singular %>.<%= k %> %></td>
<% end %>
<td>
<span><%%= link gettext("Show"), to: Routes.<%= @schema.route_helper %>_path(@conn, :show, <%= @schema.singular %>) %></span>
<span><%%= link gettext("Edit"), to: Routes.<%= @schema.route_helper %>_path(@conn, :edit, <%= @schema.singular %>) %></span>
<span><%%= link gettext("Delete"), to: Routes.<%= @schema.route_helper %>_path(@conn, :delete, <%= @schema.singular %>), method: :delete, data: [confirm: gettext("Are you sure?")] %></span>
</td>
</tr>
<%% end %>
</tbody>
</table>
<span><%%= link gettext("New <%= @schema.human_singular %>"), to: Routes.<%= @schema.route_helper %>_path(@conn, :new) %></span>