Render bio with <details> element

This commit is contained in:
Claudio Ortolina
2024-12-03 10:01:22 +00:00
parent 26e96994a4
commit 371ed511cc
2 changed files with 14 additions and 8 deletions
@@ -17,13 +17,14 @@
</span> </span>
</span> </span>
</h1> </h1>
<div <details
:if={artist_info = @artist_info.ok? && @artist_info.result} :if={artist_info = @artist_info.ok? && @artist_info.result}
class="bio mt-4 text-sm leading-5 text-zinc-500 dark:text-zinc-400" class="bio mt-4 text-sm leading-5 text-zinc-500 dark:text-zinc-400"
> >
<summary class="text-sm mb-4">{gettext("Biography")}</summary>
{render_bio(artist_info.bio)} {render_bio(artist_info.bio)}
</div> </details>
<div :if={!@artist_info.ok?} class="bio mt-4 text-sm leading-5 text-zinc-500 dark:text-zinc-400"> <div :if={!@artist_info.ok?} class="mt-4 text-sm leading-5 text-zinc-500 dark:text-zinc-400">
{gettext("Biography not available")} {gettext("Biography not available")}
</div> </div>
+10 -5
View File
@@ -51,7 +51,7 @@ msgid "Choose a value"
msgstr "" msgstr ""
#: lib/music_library_web/components/layouts/app.html.heex:13 #: lib/music_library_web/components/layouts/app.html.heex:13
#: lib/music_library_web/live/artist_live/show.html.heex:32 #: lib/music_library_web/live/artist_live/show.html.heex:33
#: lib/music_library_web/live/collection_live/index.ex:77 #: lib/music_library_web/live/collection_live/index.ex:77
#: lib/music_library_web/live/collection_live/show.ex:102 #: lib/music_library_web/live/collection_live/show.ex:102
#: lib/music_library_web/live/collection_live/show.ex:119 #: lib/music_library_web/live/collection_live/show.ex:119
@@ -328,7 +328,7 @@ msgid "Welcome to your Music Library"
msgstr "" msgstr ""
#: lib/music_library_web/components/layouts/app.html.heex:19 #: lib/music_library_web/components/layouts/app.html.heex:19
#: lib/music_library_web/live/artist_live/show.html.heex:70 #: lib/music_library_web/live/artist_live/show.html.heex:71
#: lib/music_library_web/live/wishlist_live/index.ex:75 #: lib/music_library_web/live/wishlist_live/index.ex:75
#: lib/music_library_web/live/wishlist_live/show.ex:102 #: lib/music_library_web/live/wishlist_live/show.ex:102
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@@ -478,13 +478,13 @@ msgid "Dev dashboard"
msgstr "" msgstr ""
#: lib/music_library_web/live/artist_live/show.ex:53 #: lib/music_library_web/live/artist_live/show.ex:53
#: lib/music_library_web/live/artist_live/show.html.heex:27 #: lib/music_library_web/live/artist_live/show.html.heex:28
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Biography not available" msgid "Biography not available"
msgstr "" msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:50 #: lib/music_library_web/live/artist_live/show.html.heex:51
#: lib/music_library_web/live/artist_live/show.html.heex:88 #: lib/music_library_web/live/artist_live/show.html.heex:89
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "View details" msgid "View details"
msgstr "" msgstr ""
@@ -493,3 +493,8 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Number of scrobbles" msgid "Number of scrobbles"
msgstr "" msgstr ""
#: lib/music_library_web/live/artist_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Biography"
msgstr ""