diff --git a/lib/beet_round_server_web/live/bidding_live/index.ex b/lib/beet_round_server_web/live/bidding_live/index.ex index 9477271..ecd2697 100644 --- a/lib/beet_round_server_web/live/bidding_live/index.ex +++ b/lib/beet_round_server_web/live/bidding_live/index.ex @@ -9,7 +9,7 @@ defmodule BeetRoundServerWeb.BiddingLive.Index do ~H""" <.header> - {@page_title} + {@current_scope.user.email} <:actions> <.button variant="primary" navigate={~p"/biddings/new"}> <.icon name="hero-plus" /> Neues Gebot @@ -18,35 +18,24 @@ defmodule BeetRoundServerWeb.BiddingLive.Index do <%= if @bidding_round == 0 do %> -

Keine Bietrunde aktiv.

+

Keine Bietrunde aktiv. Aktuell kein Bieten möglich!

<% else %> -

Aktive Bietrunde: {@bidding_round}

+

Aktive Bietrunde: {@bidding_round} - Es kann geboten werden!

<% end %> - <.table - id="biddings" - rows={@streams.biddings} - row_click={fn {_id, bidding} -> JS.navigate(~p"/biddings/#{bidding}") end} - > - <:col :let={{_id, bidding}} label="Bidding round">{bidding.bidding_round} - <:col :let={{_id, bidding}} label="Amount">{bidding.amount} - <:col :let={{_id, bidding}} label="Depot wish one">{bidding.depot_wish_one} - <:col :let={{_id, bidding}} label="Depot wish two">{bidding.depot_wish_two} - <:action :let={{_id, bidding}}> -
- <.link navigate={~p"/biddings/#{bidding}"}>Show -
- <.link navigate={~p"/biddings/#{bidding}/edit"}>Edit - - <:action :let={{id, bidding}}> - <.link - phx-click={JS.push("delete", value: %{id: bidding.id}) |> hide("##{id}")} - data-confirm="Gebot wirklich löschen?" - > - Delete - - - +
+ + <%= if @current_bidding do %> +

Aktuelles Gebot:

+ <.list> + <:item title="Bietrunde">{@current_bidding.bidding_round} + <:item title="monatl. Betrag">{@current_bidding.amount} € + <:item title="Depot Wunsch 1">{@current_bidding.depot_wish_one} + <:item title="Depot Wunsch 2">{@current_bidding.depot_wish_two} + + <% else %> +

Noch kein Gebot abgegeben

+ <% end %>
""" end @@ -58,11 +47,13 @@ defmodule BeetRoundServerWeb.BiddingLive.Index do end current_round = BiddingRoundFacade.get_current_round() + current_bidding = Biddings.get_most_recent_bidding(socket.assigns.current_scope) {:ok, socket |> assign(:page_title, "Aktuelles Gebot") |> assign(bidding_round: current_round) + |> assign(current_bidding: current_bidding) |> stream(:biddings, list_biddings(socket.assigns.current_scope))} end