diff --git a/assets/js/kbar.js b/assets/js/kbar.js index 2965875..98c9844 100644 --- a/assets/js/kbar.js +++ b/assets/js/kbar.js @@ -84,8 +84,8 @@ const ResultItem = React.forwardRef( className={classNames( "flex justify-between items-center cursor-pointer px-4 py-3 dark:text-white", { - "bg-emerald-50 dark:bg-emerald-900": active, - "border-l-2 border-emerald-300": active + "bg-gray-300 dark:bg-gray-600": active, + "border-l-2 border-gray-300": active })} >
@@ -257,7 +257,7 @@ export default function KBar() { - + diff --git a/lib/chiya/channels/channel.ex b/lib/chiya/channels/channel.ex index b02bca5..b7147a4 100644 --- a/lib/chiya/channels/channel.ex +++ b/lib/chiya/channels/channel.ex @@ -27,4 +27,12 @@ defmodule Chiya.Channels.Channel do |> validate_required([:name, :content, :visibility, :slug, :layout]) |> validate_exclusion(:slug, ~w(admin user dev)) end + + def icon(%Chiya.Channels.Channel{visibility: vis}) do + case(vis) do + :public -> "🌍" + :private -> "🔒" + :unlisted -> "👁️" + end + end end diff --git a/lib/chiya_web/components/core_components.ex b/lib/chiya_web/components/core_components.ex index 040fc71..7fa23d8 100644 --- a/lib/chiya_web/components/core_components.ex +++ b/lib/chiya_web/components/core_components.ex @@ -510,8 +510,8 @@ defmodule ChiyaWeb.CoreComponents do end ~H""" -
- +
+
@@ -574,7 +574,7 @@ defmodule ChiyaWeb.CoreComponents do def list(assigns) do ~H""" -
+
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) %>
<%= col[:label] %>