Skip to content

Commit

Permalink
Show item description in signup
Browse files Browse the repository at this point in the history
  • Loading branch information
mveytsman committed May 22, 2024
1 parent 0c1f461 commit 2b81664
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 14 additions & 2 deletions lib/bike_brigade_web/live/campaign_signup_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,21 @@ defmodule BikeBrigadeWeb.CampaignSignupLive.Show do

defp get_delivery_size(assigns) do
~H"""
<div :for={task_item <- @task.task_items}>
<div :for={task_item <- @task.task_items} class="flex items-center">
<span :if={task_item.count > 1}> task_item.count </span>
<%= Inflex.inflect(task_item.item.name, task_item.count) %>
<%= if task_item.item.description && task_item.item.description != "" do %>
<div class="flex items-center">
<details>
<summary class="cursor-pointer">
<%= Inflex.inflect(task_item.item.name, task_item.count) %>
</summary>
<%= task_item.item.description %>
</details>
</div>
<% else %>
<%= Inflex.inflect(task_item.item.name, task_item.count) %>
<% end %>
</div>
"""
end
Expand Down
3 changes: 2 additions & 1 deletion test/bike_brigade_web/live/campaign_signup_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ defmodule BikeBrigadeWeb.CampaignSignupLiveTest do
assert live |> element("[data-test-id=dropoff-name-#{ctx.task.id}]") |> render =~ "CJH"
assert html =~ BikeBrigade.Locations.neighborhood(ctx.task.dropoff_location)

# We show the name of the item
# We show the name and description of the item
assert html =~ "Burrito"
assert html =~ "a large burrito with all the fixings"

end

Expand Down

0 comments on commit 2b81664

Please sign in to comment.