Conditionally show purchased at in edit form
This commit is contained in:
@@ -43,7 +43,12 @@ defmodule MusicLibraryWeb.RecordLive.FormComponent do
|
||||
/>
|
||||
</div>
|
||||
<.input field={@form[:release]} type="text" label={gettext("Release")} />
|
||||
<.input field={@form[:purchased_at]} type="datetime-local" label={gettext("Purchased at")} />
|
||||
<.input
|
||||
:if={@show_purchased_at}
|
||||
field={@form[:purchased_at]}
|
||||
type="datetime-local"
|
||||
label={gettext("Purchased at")}
|
||||
/>
|
||||
<div phx-drop-target={@uploads.cover_data.ref}>
|
||||
<.label for={@uploads.cover_data.ref}>
|
||||
<%= gettext("Cover art") %>
|
||||
|
||||
@@ -167,6 +167,7 @@
|
||||
id={@record.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
show_purchased_at={true}
|
||||
record={@record}
|
||||
patch={~p"/records"}
|
||||
/>
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
id={@record.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
show_purchased_at={true}
|
||||
record={@record}
|
||||
patch={~p"/records/#{@record}"}
|
||||
/>
|
||||
|
||||
@@ -167,6 +167,7 @@
|
||||
id={@record.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
show_purchased_at={false}
|
||||
record={@record}
|
||||
patch={~p"/wishlist"}
|
||||
/>
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
id={@record.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
show_purchased_at={false}
|
||||
record={@record}
|
||||
patch={~p"/wishlist/#{@record}"}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user