From 15b60a4619452aa2f5db5f8cf69da2ad007b9e9c Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sat, 22 Feb 2025 13:34:21 +0000 Subject: [PATCH] Link badges in barcode scanner results --- .../components/barcode_scanner_component.ex | 8 ++++++-- priv/gettext/default.pot | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/music_library_web/components/barcode_scanner_component.ex b/lib/music_library_web/components/barcode_scanner_component.ex index 950a3e4b..fbd2c1dd 100644 --- a/lib/music_library_web/components/barcode_scanner_component.ex +++ b/lib/music_library_web/components/barcode_scanner_component.ex @@ -114,8 +114,12 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do

<.badge :if={@status == :new} color={:gray} text={gettext("New")} /> - <.badge :if={@status == :wishlisted} color={:yellow} text={gettext("Wishlisted")} /> - <.badge :if={@status == :collected} color={:green} text={gettext("Collected")} /> + <.link :if={@status == :wishlisted} navigate={~p"/wishlist/#{@record_id}"}> + <.badge color={:yellow} text={gettext("Wishlisted")} /> + + <.link :if={@status == :collected} navigate={~p"/collection/#{@record_id}"}> + <.badge color={:green} text={gettext("Collected")} /> + """ end diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index f90cdae2..47ac46dc 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -343,13 +343,13 @@ msgstr "" msgid "Choose which format to import" msgstr "" -#: lib/music_library_web/components/barcode_scanner_component.ex:118 +#: lib/music_library_web/components/barcode_scanner_component.ex:121 #: lib/music_library_web/live/stats_live/index.html.heex:141 #, elixir-autogen, elixir-format msgid "Collected" msgstr "" -#: lib/music_library_web/components/barcode_scanner_component.ex:117 +#: lib/music_library_web/components/barcode_scanner_component.ex:118 #: lib/music_library_web/live/stats_live/index.html.heex:147 #, elixir-autogen, elixir-format msgid "Wishlisted" @@ -647,12 +647,12 @@ msgstr "" msgid "Import releases" msgstr "" -#: lib/music_library_web/components/barcode_scanner_component.ex:158 +#: lib/music_library_web/components/barcode_scanner_component.ex:162 #, elixir-autogen, elixir-format msgid "Failed to search release for barcode %{number}" msgstr "" -#: lib/music_library_web/components/barcode_scanner_component.ex:149 +#: lib/music_library_web/components/barcode_scanner_component.ex:153 #, elixir-autogen, elixir-format msgid "No release found for barcode %{number}" msgstr "" @@ -662,7 +662,7 @@ msgstr "" msgid "Importing..." msgstr "" -#: lib/music_library_web/components/barcode_scanner_component.ex:188 +#: lib/music_library_web/components/barcode_scanner_component.ex:192 #, elixir-autogen, elixir-format msgid "Records imported successfully" msgstr ""