chiya/lib/chiya_web/controllers/channel_html/index.html.heex

30 lines
1 KiB
Text
Raw Normal View History

2023-03-05 17:16:24 +01:00
<.header>
2023-04-08 09:54:57 +02:00
<.icon name="hero-speaker-wave" /> Channels
<:subtitle>Channels are collections for your notes.</:subtitle>
2023-03-05 17:16:24 +01:00
<:actions>
<.link href={~p"/admin/channels/new"}>
2023-03-05 17:16:24 +01:00
<.button>New Channel</.button>
</.link>
</:actions>
</.header>
<.table id="channels" rows={@channels} row_click={&JS.navigate(~p"/admin/channels/#{&1}")}>
2023-03-05 17:16:24 +01:00
<:col :let={channel} label="Name"><%= channel.name %></:col>
2023-04-10 12:08:19 +02:00
<:col :let={channel} label="Visibility">
<%= Chiya.Channels.Channel.icon(channel) %> <%= channel.visibility %>
</:col>
<:col :let={channel} label="Notes"><%= Enum.count(channel.notes) %></:col>
2023-03-05 17:16:24 +01:00
<:col :let={channel} label="Slug"><%= channel.slug %></:col>
<:action :let={channel}>
<div class="sr-only">
<.link navigate={~p"/admin/channels/#{channel}"}>Show</.link>
2023-03-05 17:16:24 +01:00
</div>
<.link navigate={~p"/admin/channels/#{channel}/edit"}>Edit</.link>
2023-03-05 17:16:24 +01:00
</:action>
<:action :let={channel}>
<.link href={~p"/admin/channels/#{channel}"} method="delete" data-confirm="Are you sure?">
2023-03-05 17:16:24 +01:00
Delete
</.link>
</:action>
</.table>