Files
music_library/lib/music_library_web/live/stats_live/index.html.heex
T
Claudio Ortolina 893890a2e9 Don't hardcode column classes in stats
The Tailwind build step requires all needed classes to be explicitly
referenced in the source code, and not dynamically generated. This
implies that one cannot (for example) interpolate a number in a class
name.
2024-11-01 18:52:09 +00:00

63 lines
2.2 KiB
Plaintext

<div>
<h1 class="mt-5 text-base lg:text-2xl text-gray-900 dark:text-gray-200 font-semibold">
<%= gettext("Basics") %>
</h1>
<dl class="mt-5 grid grid-cols-2 gap-5 sm:grid-cols-5">
<.album_preview
record={@latest_record}
title={gettext("Latest purchase")}
class="col-span-2 sm:col-span-3"
/>
<.counter title={gettext("Total collection")} count={@collection_count} path={~p"/records"} />
<.counter title={gettext("Total wishlist")} count={@wishlist_count} path={~p"/wishlist"} />
</dl>
</div>
<div>
<h1 class="mt-5 text-base lg:text-2xl text-gray-900 dark:text-gray-200 font-semibold">
<%= gettext("Formats") %>
</h1>
<dl class={[
"mt-5 grid divide-gray-200 dark:divide-slate-300/50 overflow-hidden rounded-md bg-white dark:bg-zinc-700 shadow divide-x",
stats_class(@collection_count_by_format)
]}>
<div :for={{format, count} <- @collection_count_by_format} class="px-2 py-5 sm:px-4">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 text-center max-sm:text-xs break-keep">
<%= Record.format_long_label(format) %>
</dt>
<dd class="mt-1 text-center">
<a
class="text-xl lg:text-2xl font-semibold hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200"
href={~p"/records?query=format:#{format}"}
>
<%= count %>
</a>
</dd>
</div>
</dl>
</div>
<div>
<h1 class="mt-5 text-base lg:text-2xl text-gray-900 dark:text-gray-200 font-semibold">
<%= gettext("Types") %>
</h1>
<dl class={[
"mt-5 grid divide-gray-200 dark:divide-slate-300/50 overflow-hidden rounded-md bg-white dark:bg-zinc-700 shadow divide-x",
stats_class(@collection_count_by_type)
]}>
<div :for={{type, count} <- @collection_count_by_type} class="px-2 py-5 sm:px-4">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 text-center max-sm:text-xs break-keep">
<%= Record.type_long_label(type) %>
</dt>
<dd class="mt-1 text-center">
<a
class="text-xl lg:text-2xl font-semibold hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200"
href={~p"/records?query=type:#{type}"}
>
<%= count %>
</a>
</dd>
</div>
</dl>
</div>