Uniform record detail page title logic
This commit is contained in:
@@ -535,21 +535,6 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
|
|||||||
|> assign_embedding_text()}
|
|> assign_embedding_text()}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp page_title(:show, record) do
|
|
||||||
Enum.join(
|
|
||||||
[
|
|
||||||
Records.Record.artist_names(record),
|
|
||||||
"-",
|
|
||||||
record.title,
|
|
||||||
"·",
|
|
||||||
gettext("Details"),
|
|
||||||
"·",
|
|
||||||
gettext("Collection")
|
|
||||||
],
|
|
||||||
" "
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
defp page_title(action, record) do
|
defp page_title(action, record) do
|
||||||
Enum.join(
|
Enum.join(
|
||||||
[
|
[
|
||||||
@@ -565,7 +550,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp title_segment(:show), do: gettext("Show")
|
defp title_segment(:show), do: gettext("Details")
|
||||||
defp title_segment(:edit), do: gettext("Edit")
|
defp title_segment(:edit), do: gettext("Edit")
|
||||||
|
|
||||||
defp assign_similar_records(socket) do
|
defp assign_similar_records(socket) do
|
||||||
|
|||||||
@@ -436,13 +436,13 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp title_segment(:show), do: gettext("Details")
|
||||||
|
defp title_segment(:edit), do: gettext("Edit")
|
||||||
|
|
||||||
defp assign_embedding_text(socket) do
|
defp assign_embedding_text(socket) do
|
||||||
case Similarity.get_embedding_text(socket.assigns.record.id) do
|
case Similarity.get_embedding_text(socket.assigns.record.id) do
|
||||||
{:ok, text} -> assign(socket, :embedding_text, text)
|
{:ok, text} -> assign(socket, :embedding_text, text)
|
||||||
{:error, _reason} -> assign(socket, :embedding_text, gettext("Not available"))
|
{:error, _reason} -> assign(socket, :embedding_text, gettext("Not available"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp title_segment(:show), do: gettext("Show")
|
|
||||||
defp title_segment(:edit), do: gettext("Edit")
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -187,12 +187,6 @@ msgstr ""
|
|||||||
msgid "Search"
|
msgid "Search"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/collection_live/show.ex
|
|
||||||
#: lib/music_library_web/live/wishlist_live/show.ex
|
|
||||||
#, elixir-autogen, elixir-format
|
|
||||||
msgid "Show"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: lib/music_library_web/components/layouts/app.html.heex
|
#: lib/music_library_web/components/layouts/app.html.heex
|
||||||
#: lib/music_library_web/live/stats_live/index.ex
|
#: lib/music_library_web/live/stats_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
@@ -294,6 +288,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
#: lib/music_library_web/live/artist_live/show.ex
|
||||||
#: lib/music_library_web/live/collection_live/show.ex
|
#: lib/music_library_web/live/collection_live/show.ex
|
||||||
|
#: lib/music_library_web/live/wishlist_live/show.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Details"
|
msgid "Details"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@@ -187,12 +187,6 @@ msgstr ""
|
|||||||
msgid "Search"
|
msgid "Search"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/collection_live/show.ex
|
|
||||||
#: lib/music_library_web/live/wishlist_live/show.ex
|
|
||||||
#, elixir-autogen, elixir-format
|
|
||||||
msgid "Show"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: lib/music_library_web/components/layouts/app.html.heex
|
#: lib/music_library_web/components/layouts/app.html.heex
|
||||||
#: lib/music_library_web/live/stats_live/index.ex
|
#: lib/music_library_web/live/stats_live/index.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
@@ -294,6 +288,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: lib/music_library_web/live/artist_live/show.ex
|
#: lib/music_library_web/live/artist_live/show.ex
|
||||||
#: lib/music_library_web/live/collection_live/show.ex
|
#: lib/music_library_web/live/collection_live/show.ex
|
||||||
|
#: lib/music_library_web/live/wishlist_live/show.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Details"
|
msgid "Details"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
Reference in New Issue
Block a user