Improve formatting of stats

- Simple markup
- Better spacing at alignment on all viewports
This commit is contained in:
Claudio Ortolina
2024-10-28 11:19:30 +00:00
parent 850a3c7d90
commit 4cbdf6b2b2
2 changed files with 19 additions and 23 deletions
@@ -70,19 +70,17 @@
<%= gettext("Formats") %> <%= gettext("Formats") %>
</h1> </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 grid-cols-5 divide-x"> <dl class="mt-5 grid divide-gray-200 dark:divide-slate-300/50 overflow-hidden rounded-md bg-white dark:bg-zinc-700 shadow grid-cols-5 divide-x">
<div :for={{format, count} <- @collection_count_by_format} class="px-4 py-5 sm:p-6"> <div :for={{format, count} <- @collection_count_by_format} class="px-2 py-5 sm:px-4">
<dt class="text-base max-sm:text-xs font-normal text-gray-900 dark:text-gray-400 break-keep"> <dt class="text-base text-center max-sm:text-xs font-normal text-gray-900 dark:text-gray-400 break-keep">
<%= Record.format_long_label(format) %> <%= Record.format_long_label(format) %>
</dt> </dt>
<dd class="mt-1 flex items-baseline justify-between md:block lg:flex"> <dd class="mt-1 text-center">
<div class="flex items-baseline text-2xl font-semibold"> <a
<a class="text-xl font-semibold hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200"
class="hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200" href={~p"/records?query=format:#{format}"}
href={~p"/records?query=format:#{format}"} >
> <%= count %>
<%= count %> </a>
</a>
</div>
</dd> </dd>
</div> </div>
</dl> </dl>
@@ -93,19 +91,17 @@
<%= gettext("Types") %> <%= gettext("Types") %>
</h1> </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 grid-cols-6 divide-x"> <dl class="mt-5 grid divide-gray-200 dark:divide-slate-300/50 overflow-hidden rounded-md bg-white dark:bg-zinc-700 shadow grid-cols-6 divide-x">
<div :for={{type, count} <- @collection_count_by_type} class="px-4 py-5 sm:p-6"> <div :for={{type, count} <- @collection_count_by_type} class="px-2 py-5 sm:px-4">
<dt class="text-base max-sm:text-xs font-normal text-gray-900 dark:text-gray-400 break-keep"> <dt class="text-base text-center max-sm:text-xs font-normal text-gray-900 dark:text-gray-400 break-keep">
<%= Record.type_long_label(type) %> <%= Record.type_long_label(type) %>
</dt> </dt>
<dd class="mt-1 flex items-baseline justify-between md:block lg:flex"> <dd class="mt-1 text-center">
<div class="flex items-baseline text-2xl font-semibold"> <a
<a class="text-xl font-semibold hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200"
class="hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-200" href={~p"/records?query=type:#{type}"}
href={~p"/records?query=type:#{type}"} >
> <%= count %>
<%= count %> </a>
</a>
</div>
</dd> </dd>
</div> </div>
</dl> </dl>
+1 -1
View File
@@ -330,7 +330,7 @@ msgstr ""
msgid "Formats" msgid "Formats"
msgstr "" msgstr ""
#: lib/music_library_web/controllers/stats_html/index.html.heex:93 #: lib/music_library_web/controllers/stats_html/index.html.heex:91
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Types" msgid "Types"
msgstr "" msgstr ""