2023-03-05 17:23:16 +01:00
|
|
|
<.header>
|
2023-04-08 09:54:57 +02:00
|
|
|
<.icon name="hero-document-text" /> Notes
|
|
|
|
<:subtitle>Notes are the content, the heart of your site.</:subtitle>
|
2023-03-05 17:23:16 +01:00
|
|
|
<:actions>
|
2023-03-06 19:57:19 +01:00
|
|
|
<.link href={~p"/admin/notes/new"}>
|
2023-03-05 17:23:16 +01:00
|
|
|
<.button>New Note</.button>
|
|
|
|
</.link>
|
2023-04-07 11:37:55 +02:00
|
|
|
<.link href={~p"/admin/notes/import"}>
|
|
|
|
<.button>Import Note</.button>
|
|
|
|
</.link>
|
2023-03-05 17:23:16 +01:00
|
|
|
</:actions>
|
|
|
|
</.header>
|
|
|
|
|
2023-04-11 23:00:47 +02:00
|
|
|
<section class="flex flex-row flex-wrap mt-4 -mb-6 gap-3">
|
2023-04-10 12:08:19 +02:00
|
|
|
<a
|
|
|
|
href={~p"/admin/notes"}
|
2023-04-11 23:00:47 +02:00
|
|
|
class="text-sm dark:text-gray-300 rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700 px-2 py-1 border border-gray-300 dark:border-gray-600 shadow-sm transition"
|
2023-04-10 12:08:19 +02:00
|
|
|
>
|
|
|
|
All
|
|
|
|
</a>
|
2023-04-08 11:40:41 +02:00
|
|
|
<%= for channel <- @channels do %>
|
2023-04-10 12:08:19 +02:00
|
|
|
<a
|
|
|
|
href={~p"/admin/notes?channel=#{channel.slug}"}
|
2023-04-11 23:00:47 +02:00
|
|
|
class="text-sm dark:text-gray-300 rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700 px-2 py-1 border border-gray-300 dark:border-gray-600 shadow-sm transition"
|
2023-04-10 12:08:19 +02:00
|
|
|
>
|
|
|
|
<%= channel.name %>
|
|
|
|
<span class="text-gray-600 dark:text-gray-500">(<%= Enum.count(channel.notes) %>)</span>
|
|
|
|
</a>
|
2023-04-08 11:40:41 +02:00
|
|
|
<% end %>
|
|
|
|
</section>
|
|
|
|
|
2023-03-06 19:57:19 +01:00
|
|
|
<.table id="notes" rows={@notes} row_click={&JS.navigate(~p"/admin/notes/#{&1}")}>
|
2023-03-05 17:23:16 +01:00
|
|
|
<:col :let={note} label="Name"><%= note.name %></:col>
|
2023-03-30 22:56:58 +02:00
|
|
|
<:col :let={note} label="Updated at"><%= from_now(note.updated_at) %></:col>
|
2023-03-13 03:27:17 +01:00
|
|
|
<:col :let={note} label="Published at"><%= from_now(note.published_at) %></:col>
|
2023-03-05 17:23:16 +01:00
|
|
|
</.table>
|