diff --git a/lib/chiya_web/controllers/channel_controller.ex b/lib/chiya_web/controllers/channel_controller.ex
index b32fff1..b531b74 100644
--- a/lib/chiya_web/controllers/channel_controller.ex
+++ b/lib/chiya_web/controllers/channel_controller.ex
@@ -5,7 +5,7 @@ defmodule ChiyaWeb.ChannelController do
alias Chiya.Channels.Channel
def index(conn, _params) do
- channels = Channels.list_channels()
+ channels = Channels.list_channels() |> Channels.preload_channel()
render(conn, :index, channels: channels)
end
diff --git a/lib/chiya_web/controllers/channel_html/index.html.heex b/lib/chiya_web/controllers/channel_html/index.html.heex
index f30afc6..e04944e 100644
--- a/lib/chiya_web/controllers/channel_html/index.html.heex
+++ b/lib/chiya_web/controllers/channel_html/index.html.heex
@@ -1,5 +1,6 @@
<.header>
- Listing Channels
+ <.icon name="hero-speaker-wave" /> Channels
+ <:subtitle>Channels are collections for your notes.
<:actions>
<.link href={~p"/admin/channels/new"}>
<.button>New Channel
@@ -9,7 +10,8 @@
<.table id="channels" rows={@channels} row_click={&JS.navigate(~p"/admin/channels/#{&1}")}>
<:col :let={channel} label="Name"><%= channel.name %>
- <:col :let={channel} label="Visibility"><%= channel.visibility %>
+ <:col :let={channel} label="Visibility"><%= Chiya.Channels.Channel.icon(channel) %> <%= channel.visibility %>
+ <:col :let={channel} label="Notes"><%= Enum.count(channel.notes) %>
<:col :let={channel} label="Slug"><%= channel.slug %>
<:action :let={channel}>
diff --git a/lib/chiya_web/controllers/identity_html/index.html.heex b/lib/chiya_web/controllers/identity_html/index.html.heex
index 50072fe..664d253 100644
--- a/lib/chiya_web/controllers/identity_html/index.html.heex
+++ b/lib/chiya_web/controllers/identity_html/index.html.heex
@@ -1,5 +1,5 @@
<.header>
- Listing Identities
+ <.icon name="hero-user" /> Identities
<:actions>
<.link href={~p"/admin/identities/new"}>
<.button>New Identity
diff --git a/lib/chiya_web/controllers/note_controller.ex b/lib/chiya_web/controllers/note_controller.ex
index 19b4216..747c887 100644
--- a/lib/chiya_web/controllers/note_controller.ex
+++ b/lib/chiya_web/controllers/note_controller.ex
@@ -147,5 +147,8 @@ defmodule ChiyaWeb.NoteController do
end
defp to_channel_options(items \\ nil),
- do: Enum.map(items || Chiya.Channels.list_channels(), fn c -> {c.name, c.id} end)
+ do:
+ Enum.map(items || Chiya.Channels.list_channels(), fn c ->
+ {Chiya.Channels.Channel.icon(c) <> " " <> c.name, c.id}
+ end)
end
diff --git a/lib/chiya_web/controllers/note_html/index.html.heex b/lib/chiya_web/controllers/note_html/index.html.heex
index 23551ad..169b784 100644
--- a/lib/chiya_web/controllers/note_html/index.html.heex
+++ b/lib/chiya_web/controllers/note_html/index.html.heex
@@ -1,5 +1,6 @@
<.header>
- Listing Notes
+ <.icon name="hero-document-text" /> Notes
+ <:subtitle>Notes are the content, the heart of your site.
<:actions>
<.link href={~p"/admin/notes/new"}>
<.button>New Note
diff --git a/lib/chiya_web/controllers/setting_html/show.html.heex b/lib/chiya_web/controllers/setting_html/show.html.heex
index e472d9c..0169207 100644
--- a/lib/chiya_web/controllers/setting_html/show.html.heex
+++ b/lib/chiya_web/controllers/setting_html/show.html.heex
@@ -1,5 +1,5 @@
<.header>
- Settings
+ <.icon name="hero-wrench-screwdriver" /> Settings
<:subtitle>These are your site's settings.
<:actions>
<%= if @setting == nil do %>
diff --git a/lib/chiya_web/live/note_show_live.ex b/lib/chiya_web/live/note_show_live.ex
index 7db7bc6..16979ad 100644
--- a/lib/chiya_web/live/note_show_live.ex
+++ b/lib/chiya_web/live/note_show_live.ex
@@ -11,8 +11,8 @@ defmodule ChiyaWeb.NoteShowLive do
~H"""
<.header>
- Note <%= @note.id %>
- <:subtitle>This is a note record from your database.
+ <%= @note.name %>
+ <:subtitle><%= @note.slug %>
<:actions>
<.link href={~p"/admin/notes/#{@note}/edit"}>
<.button>Edit note
@@ -27,19 +27,16 @@ defmodule ChiyaWeb.NoteShowLive do
<.list>
- <:item title="Name"><%= @note.name %>
- <:item title="Content"><%= @note.content %>
- <:item title="Slug"><%= @note.slug %>
- <:item title="Published at"><%= @note.published_at %>
+ <:item title="Published at"><%= pretty_date(@note.published_at) %> (<%= from_now(@note.published_at) %>)
+ <:item title="Channels"><%= @channels %>
<:item title="Kind"><%= @note.kind %>
<:item title="Url"><%= @note.url %>
- <:item title="Channels"><%= @channels %>
<.line />
- File Content
+ File Content
<%= raw ChiyaWeb.Markdown.render(@note.content) %>