62 lines
1.6 KiB
Plaintext
62 lines
1.6 KiB
Plaintext
<div>
|
|
<header class="gap-6 mb-2">
|
|
<div class="flex items-center justify-between gap-6 mb-2 mt-2">
|
|
<.search_form query={@record_list_params.query} />
|
|
<.link patch={~p"/collection/import"}>
|
|
<.button>{gettext("Import")}</.button>
|
|
</.link>
|
|
</div>
|
|
</header>
|
|
|
|
<p class="text-right text-sm max-sm:text-xs mt-8 text-zinc-900 dark:text-zinc-400">
|
|
{gettext(
|
|
"Showing <b>%{visible}</b> of <b>%{total}</b> records",
|
|
%{visible: Enum.count(@streams.records), total: @record_list_params.total_entries}
|
|
)
|
|
|> raw()}
|
|
</p>
|
|
</div>
|
|
|
|
<.record_list
|
|
records={@streams.records}
|
|
record_show_path={fn record -> ~p"/collection/#{record}" end}
|
|
record_edit_path={fn record -> ~p"/collection/#{record}/edit" end}
|
|
/>
|
|
|
|
<.modal
|
|
:if={@live_action == :edit}
|
|
id="record-modal"
|
|
show
|
|
on_cancel={JS.patch(back_path(@record_list_params))}
|
|
>
|
|
<.live_component
|
|
module={MusicLibraryWeb.RecordLive.FormComponent}
|
|
id={@record.id}
|
|
title={@page_title}
|
|
action={@live_action}
|
|
show_purchased_at={true}
|
|
record={@record}
|
|
patch={back_path(@record_list_params)}
|
|
/>
|
|
</.modal>
|
|
|
|
<.modal
|
|
:if={@live_action == :import}
|
|
id="record-modal"
|
|
show
|
|
on_cancel={JS.patch(back_path(@record_list_params))}
|
|
>
|
|
<.live_component
|
|
module={MusicLibraryWeb.RecordLive.ImportComponent}
|
|
id={:search}
|
|
title={@page_title}
|
|
action={@live_action}
|
|
record={@record}
|
|
patch={back_path(@record_list_params)}
|
|
initial_query=""
|
|
icon_name="hero-plus"
|
|
/>
|
|
</.modal>
|
|
|
|
<.pagination id={:bottom_pagination} pagination_params={@record_list_params} />
|