From e4300391b6a1045a72efe44b1ca661afd4cfc488 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Fri, 2 Feb 2024 12:49:20 -0800 Subject: [PATCH] Added friendly_name to form --- .../controllers/media_sources/source_html/show.html.heex | 9 ++++++--- .../media_sources/source_html/source_form.html.heex | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/pinchflat_web/controllers/media_sources/source_html/show.html.heex b/lib/pinchflat_web/controllers/media_sources/source_html/show.html.heex index 6cdf095..7a4a1ae 100644 --- a/lib/pinchflat_web/controllers/media_sources/source_html/show.html.heex +++ b/lib/pinchflat_web/controllers/media_sources/source_html/show.html.heex @@ -9,9 +9,12 @@ <.list> - <:item title="Collection Name"><%= @source.collection_name %> - <:item title="Collection ID"><%= @source.collection_id %> - <:item title="Original URL"><%= @source.original_url %> + <:item + :for={attr <- ~w(collection_type collection_name collection_id original_url friendly_name)a} + title={attr} + > + <%= Map.get(@source, attr) %> + <.back navigate={~p"/media_sources/sources"}>Back to sources diff --git a/lib/pinchflat_web/controllers/media_sources/source_html/source_form.html.heex b/lib/pinchflat_web/controllers/media_sources/source_html/source_form.html.heex index e7fc1f4..bada6cf 100644 --- a/lib/pinchflat_web/controllers/media_sources/source_html/source_form.html.heex +++ b/lib/pinchflat_web/controllers/media_sources/source_html/source_form.html.heex @@ -3,6 +3,8 @@ Oops, something went wrong! Please check the errors below. + <.input field={f[:friendly_name]} type="text" label="Friendly Name" /> + <.input field={f[:media_profile_id]} options={Enum.map(@media_profiles, &{&1.name, &1.id})}