Current section

Files

Jump to
torch priv templates eex index.html.eex
Raw

priv/templates/eex/index.html.eex

<section class="content">
<section class="toolbar">
<%%= link "New", to: <%= namespace_underscore %>_<%= singular %>_path(@conn, :new) %>
</section>
<%%= if length(@<%= plural %>) > 0 do %>
<table class="data">
<thead>
<tr>
<%= for {k, _} <- attrs, not k in [:inserted_at, :updated_at] do %> <th><%%= table_link(@conn, "<%= Phoenix.Naming.humanize(Atom.to_string(k)) %>", <%= inspect(k) %>) %></th>
<% end %>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%%= for <%= singular %> <- @<%= plural %> do %>
<tr>
<%= for {k, _} <- attrs, not k in [:inserted_at, :updated_at] do %> <td><%%= <%= singular %>.<%= k %> %></td>
<% end %>
<td class="actions">
<%%= link "Edit", to: <%= namespace_underscore %>_<%= singular %>_path(@conn, :edit, <%= singular %>) %>
<%%= link "Delete", to: <%= namespace_underscore %>_<%= singular %>_path(@conn, :delete, <%= singular %>), method: :delete, data: [confirm: "Are you sure?"] %>
</td>
</tr>
<%% end %>
</tbody>
</table>
<%%= render Torch.PaginationView, "_pagination.html", assigns %>
<%% else %>
<p class="no-data">No <%= plural %> match your search.</p>
<%% end %>
</section>
<%%= render "_filters.html", assigns %>