Entendu/lib/entendu_web/live/link_live/index.html.leex

38 lines
1.1 KiB
Plaintext

<h1>Listing Links</h1>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal @socket, EntenduWeb.LinkLive.FormComponent,
id: @link.id || :new,
title: @page_title,
action: @live_action,
link: @link,
return_to: Routes.link_index_path(@socket, :index) %>
<% end %>
<table>
<thead>
<tr>
<th>Expires</th>
<th>Burn after reading</th>
<th></th>
</tr>
</thead>
<tbody id="links">
<%= for link <- @links do %>
<tr id="link-<%= link.id %>">
<td><%= link.expires %></td>
<td><%= link.burn_after_reading %></td>
<td>
<span><%= live_redirect "Show", to: Routes.link_show_path(@socket, :show, link) %></span>
<span><%= live_patch "Edit", to: Routes.link_index_path(@socket, :edit, link) %></span>
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: link.id, data: [confirm: "Are you sure?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= live_patch "New Link", to: Routes.link_index_path(@socket, :new) %></span>