Refactor type/format labels to enable translations
This commit is contained in:
@@ -2,9 +2,9 @@ defmodule MusicLibraryWeb.StatsLive.Index do
|
||||
use MusicLibraryWeb, :live_view
|
||||
|
||||
import MusicLibraryWeb.StatsLive.DataComponents
|
||||
import MusicLibraryWeb.RecordComponents, only: [format_label: 1, type_label: 1]
|
||||
|
||||
alias MusicLibrary.{Artists, Collection, Records, Wishlist}
|
||||
alias Records.Record
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
latest_record = Collection.get_latest_record!()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
]}>
|
||||
<div :for={{format, count} <- @collection_count_by_format} class="px-2 py-5 sm:px-4">
|
||||
<dt class="text-sm font-medium text-zinc-500 dark:text-zinc-400 text-center max-sm:text-xs break-keep">
|
||||
{Record.format_long_label(format)}
|
||||
{format_label(format)}
|
||||
</dt>
|
||||
<dd class="mt-1 text-center">
|
||||
<.link
|
||||
@@ -54,7 +54,7 @@
|
||||
]}>
|
||||
<div :for={{type, count} <- @collection_count_by_type} class="px-2 py-5 sm:px-4">
|
||||
<dt class="text-sm font-medium text-zinc-500 dark:text-zinc-400 text-center max-sm:text-xs break-keep">
|
||||
{Record.type_long_label(type)}
|
||||
{type_label(type)}
|
||||
</dt>
|
||||
<dd class="mt-1 text-center">
|
||||
<.link
|
||||
@@ -202,7 +202,7 @@
|
||||
)
|
||||
}
|
||||
>
|
||||
{Records.Record.format_long_label(format)}
|
||||
{format_label(format)}
|
||||
</.link>
|
||||
</.focus_wrap>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user