add micropub channel setting

This commit is contained in:
Inhji 2023-06-11 20:39:14 +02:00
parent 45f41277aa
commit 6c3073a637
3 changed files with 21 additions and 1 deletions

View file

@ -15,6 +15,7 @@ defmodule Chiya.Site.Setting do
belongs_to :home_channel, Chiya.Channels.Channel
belongs_to :default_channel, Chiya.Channels.Channel
belongs_to :micropub_channel, Chiya.Channels.Channel
timestamps()
end

View file

@ -14,7 +14,17 @@
<.input field={f[:user_agent]} type="text" label="User agent" />
<.input field={f[:custom_css]} type="textarea" label="Custom css" class="font-mono" />
<.input field={f[:custom_html]} type="textarea" label="Custom html" class="font-mono" />
<.input field={f[:home_channel_id]} type="select" label="Home Channel" options={@channels} />
<.input
field={f[:home_channel_id]}
type="select"
label="Home Channel"
options={@channels}
/>
<.input
field={f[:micropub_channel_id]}
type="select"
label="Micropub Channel" options={@channels}
/>
<.input
field={f[:default_channel_id]}
type="select"

View file

@ -0,0 +1,9 @@
defmodule Chiya.Repo.Migrations.AddDefaultMicropubChannelSetting do
use Ecto.Migration
def change do
alter table(:settings) do
add :micropub_channel_id, references(:channels, on_delete: :nothing)
end
end
end