Autogen Yield liveviews
This commit is contained in:
45
lib/osuuspuutarha_web/live/yield_live/index.html.heex
Normal file
45
lib/osuuspuutarha_web/live/yield_live/index.html.heex
Normal file
@@ -0,0 +1,45 @@
|
||||
<h1>Listing Yields</h1>
|
||||
|
||||
<%= if @live_action in [:new, :edit] do %>
|
||||
<.modal return_to={Routes.yield_index_path(@socket, :index)}>
|
||||
<.live_component
|
||||
module={OsuuspuutarhaWeb.YieldLive.FormComponent}
|
||||
id={@yield.id || :new}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
yield={@yield}
|
||||
return_to={Routes.yield_index_path(@socket, :index)}
|
||||
/>
|
||||
</.modal>
|
||||
<% end %>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Plant</th>
|
||||
<th>Amount</th>
|
||||
<th>Unit</th>
|
||||
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="yields">
|
||||
<%= for yield <- @yields do %>
|
||||
<tr id={"yield-#{yield.id}"}>
|
||||
<td><%= yield.date %></td>
|
||||
<td><%= yield.plant %></td>
|
||||
<td><%= yield.amount %></td>
|
||||
<td><%= yield.unit %></td>
|
||||
|
||||
<td>
|
||||
<span><%= live_redirect "Show", to: Routes.yield_show_path(@socket, :show, yield) %></span>
|
||||
<span><%= live_patch "Edit", to: Routes.yield_index_path(@socket, :edit, yield) %></span>
|
||||
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: yield.id, data: [confirm: "Are you sure?"] %></span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span><%= live_patch "New Yield", to: Routes.yield_index_path(@socket, :new) %></span>
|
||||
Reference in New Issue
Block a user