Improve header titles in editing overlay

This commit is contained in:
Claudio Ortolina
2025-01-24 14:50:21 +00:00
parent a0c06606fb
commit 542702e351
7 changed files with 18 additions and 19 deletions
@@ -68,7 +68,6 @@
<.live_component <.live_component
module={MusicLibraryWeb.RecordLive.FormComponent} module={MusicLibraryWeb.RecordLive.FormComponent}
id={@record.id} id={@record.id}
title={@page_title}
action={@live_action} action={@live_action}
show_purchased_at={true} show_purchased_at={true}
record={@record} record={@record}
@@ -233,7 +233,6 @@
<.live_component <.live_component
module={MusicLibraryWeb.RecordLive.FormComponent} module={MusicLibraryWeb.RecordLive.FormComponent}
id={@record.id} id={@record.id}
title={@page_title}
action={@live_action} action={@live_action}
show_purchased_at={true} show_purchased_at={true}
record={@record} record={@record}
@@ -16,9 +16,12 @@ defmodule MusicLibraryWeb.RecordLive.FormComponent do
~H""" ~H"""
<div> <div>
<header> <header>
<h1 class="text-base font-medium leading-6 text-zinc-700 dark:text-zinc-400"> <h1 class="text-sm font-medium leading-6 text-zinc-700 dark:text-zinc-400">
{@title} {Enum.map(@record.artists, & &1.name) |> Enum.join(", ")}
</h1> </h1>
<h2 class="text-base font-medium leading-6 text-zinc-700 dark:text-zinc-400">
{@record.title}
</h2>
</header> </header>
<.simple_form <.simple_form
@@ -32,7 +32,6 @@
<.live_component <.live_component
module={MusicLibraryWeb.RecordLive.FormComponent} module={MusicLibraryWeb.RecordLive.FormComponent}
id={@record.id} id={@record.id}
title={@page_title}
action={@live_action} action={@live_action}
show_purchased_at={false} show_purchased_at={false}
record={@record} record={@record}
@@ -243,7 +243,6 @@
<.live_component <.live_component
module={MusicLibraryWeb.RecordLive.FormComponent} module={MusicLibraryWeb.RecordLive.FormComponent}
id={@record.id} id={@record.id}
title={@page_title}
action={@live_action} action={@live_action}
show_purchased_at={false} show_purchased_at={false}
record={@record} record={@record}
+12 -12
View File
@@ -23,8 +23,8 @@ msgstr ""
msgid "Are you sure?" msgid "Are you sure?"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:36 #: lib/music_library_web/live/record_live/form_component.ex:39
#: lib/music_library_web/live/record_live/form_component.ex:43 #: lib/music_library_web/live/record_live/form_component.ex:46
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Choose a value" msgid "Choose a value"
msgstr "" msgstr ""
@@ -38,7 +38,7 @@ msgstr ""
msgid "Collection" msgid "Collection"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:57 #: lib/music_library_web/live/record_live/form_component.ex:60
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Cover art" msgid "Cover art"
msgstr "" msgstr ""
@@ -74,7 +74,7 @@ msgstr ""
msgid "Error!" msgid "Error!"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:42 #: lib/music_library_web/live/record_live/form_component.ex:45
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Format" msgid "Format"
msgstr "" msgstr ""
@@ -129,7 +129,7 @@ msgid "Logout"
msgstr "" msgstr ""
#: lib/music_library_web/live/collection_live/show.html.heex:159 #: lib/music_library_web/live/collection_live/show.html.heex:159
#: lib/music_library_web/live/record_live/form_component.ex:47 #: lib/music_library_web/live/record_live/form_component.ex:50
#: lib/music_library_web/live/wishlist_live/show.html.heex:177 #: lib/music_library_web/live/wishlist_live/show.html.heex:177
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "MusicBrainz ID" msgid "MusicBrainz ID"
@@ -141,7 +141,7 @@ msgstr ""
msgid "Next" msgid "Next"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:64 #: lib/music_library_web/live/record_live/form_component.ex:67
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No cover selected" msgid "No cover selected"
msgstr "" msgstr ""
@@ -176,7 +176,7 @@ msgstr ""
msgid "Purchase" msgid "Purchase"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:53 #: lib/music_library_web/live/record_live/form_component.ex:56
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Purchased at" msgid "Purchased at"
msgstr "" msgstr ""
@@ -195,24 +195,24 @@ msgstr ""
msgid "Record imported successfully" msgid "Record imported successfully"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:124 #: lib/music_library_web/live/record_live/form_component.ex:127
#: lib/music_library_web/live/wishlist_live/index.ex:135 #: lib/music_library_web/live/wishlist_live/index.ex:135
#: lib/music_library_web/live/wishlist_live/show.ex:106 #: lib/music_library_web/live/wishlist_live/show.ex:106
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Record updated successfully" msgid "Record updated successfully"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:48 #: lib/music_library_web/live/record_live/form_component.ex:51
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Release" msgid "Release"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:75 #: lib/music_library_web/live/record_live/form_component.ex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:75 #: lib/music_library_web/live/record_live/form_component.ex:78
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Saving..." msgid "Saving..."
msgstr "" msgstr ""
@@ -279,7 +279,7 @@ msgstr ""
msgid "Total wishlist" msgid "Total wishlist"
msgstr "" msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:35 #: lib/music_library_web/live/record_live/form_component.ex:38
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Type" msgid "Type"
msgstr "" msgstr ""
@@ -203,7 +203,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
conn conn
|> visit(~p"/collection") |> visit(~p"/collection")
|> click_link("#records-#{record.id} a", "Edit") |> click_link("#records-#{record.id} a", "Edit")
|> assert_has("h1", text: "Edit") |> assert_has("h2", text: escape(record.title))
|> assert_path(~p"/collection/#{record}/edit") |> assert_path(~p"/collection/#{record}/edit")
end end