diff --git a/lib/chiya/notes/note.ex b/lib/chiya/notes/note.ex index 63cc753..8ce6c4a 100644 --- a/lib/chiya/notes/note.ex +++ b/lib/chiya/notes/note.ex @@ -55,6 +55,10 @@ defmodule Chiya.Notes.Note do ~p"/note/#{note.slug}" end + def note_path_admin(note) do + ~p"/admin/note/#{note.slug}" + end + def note_url(note) do Phoenix.VerifiedRoutes.url(~p"/note/#{note.slug}") end diff --git a/lib/chiya/site/setting.ex b/lib/chiya/site/setting.ex index 95fc4a8..1e3ea7f 100644 --- a/lib/chiya/site/setting.ex +++ b/lib/chiya/site/setting.ex @@ -18,6 +18,8 @@ defmodule Chiya.Site.Setting do belongs_to :micropub_channel, Chiya.Channels.Channel belongs_to :wiki_channel, Chiya.Channels.Channel + field :show_images_on_home, :boolean, default: true + timestamps() end @@ -34,8 +36,15 @@ defmodule Chiya.Site.Setting do :home_channel_id, :default_channel_id, :micropub_channel_id, - :wiki_channel_id + :wiki_channel_id, + :show_images_on_home + ]) + |> validate_required([ + :title, + :subtitle, + :theme, + :user_agent, + :show_images_on_home ]) - |> validate_required([:title, :subtitle, :theme, :user_agent]) end end diff --git a/lib/chiya_web/components/public_components.ex b/lib/chiya_web/components/public_components.ex index 536d21c..c46dc96 100644 --- a/lib/chiya_web/components/public_components.ex +++ b/lib/chiya_web/components/public_components.ex @@ -149,7 +149,7 @@ defmodule ChiyaWeb.PublicComponents do """ end - attr :note, :map, required: true + attr :notes, :list, required: true def note_list_microblog(assigns) do ~H""" @@ -158,10 +158,10 @@ defmodule ChiyaWeb.PublicComponents do
<.featured_images note={note} /> -
+
<%= raw(render(note.content)) %>
-