make default channel configurable

This commit is contained in:
Inhji 2023-05-07 10:32:21 +02:00
parent 0c27f1808e
commit d24ee9e69f
2 changed files with 12 additions and 1 deletions

View file

@ -15,6 +15,12 @@
<.input field={f[:custom_css]} type="textarea" label="Custom css" class="font-mono" /> <.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[: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[:default_channel_id]}
type="select"
label="Default Channel"
options={@channels}
/>
<:actions> <:actions>
<.button>Save Setting</.button> <.button>Save Setting</.button>
</:actions> </:actions>

View file

@ -31,6 +31,11 @@
<:item title="User agent"><%= @setting.user_agent %></:item> <:item title="User agent"><%= @setting.user_agent %></:item>
<:item title="Custom css"><%= @setting.custom_css %></:item> <:item title="Custom css"><%= @setting.custom_css %></:item>
<:item title="Custom html"><%= @setting.custom_html %></:item> <:item title="Custom html"><%= @setting.custom_html %></:item>
<:item title="Home Channel"><%= @setting.home_channel_id %></:item> <:item title="Home Channel">
<%= if @setting.home_channel, do: @setting.home_channel.name %>
</:item>
<:item title="Default Channel">
<%= if @setting.default_channel, do: @setting.default_channel.name %>
</:item>
</.list> </.list>
<% end %> <% end %>