diff --git a/lib/outlook/articles/article.ex b/lib/outlook/articles/article.ex index 7e6b94e..7d85bdb 100644 --- a/lib/outlook/articles/article.ex +++ b/lib/outlook/articles/article.ex @@ -12,6 +12,7 @@ defmodule Outlook.Articles.Article do field :language, :string, default: "EN" field :title, :string field :url, :string + field :remarks, :string belongs_to :author, Author has_many :translations, Translation, on_delete: :delete_all @@ -21,7 +22,7 @@ defmodule Outlook.Articles.Article do @doc false def changeset(article, attrs) do article - |> cast(attrs, [:title, :content, :url, :language, :date, :author_id]) + |> cast(attrs, [:title, :content, :url, :language, :date, :author_id, :remarks]) |> validate_required([:title, :content, :url, :language, :date, :author_id]) |> foreign_key_constraint(:author_id) end diff --git a/lib/outlook_web/live/article_live/form_component.ex b/lib/outlook_web/live/article_live/form_component.ex index d49b04e..ef99321 100644 --- a/lib/outlook_web/live/article_live/form_component.ex +++ b/lib/outlook_web/live/article_live/form_component.ex @@ -26,6 +26,7 @@ defmodule OutlookWeb.ArticleLive.FormComponent do <.input field={{f, :language}} type="select" label="language" options={Application.get_env(:outlook,:deepl)[:source_langs]} /> <.input field={{f, :date}} type="datetime-local" label="date" /> + <.input field={{f, :remarks}} type="textarea" label="remarks" class="h-28" /> <:actions> <.button phx-disable-with="Saving...">Save Article diff --git a/lib/outlook_web/live/article_live/show.html.heex b/lib/outlook_web/live/article_live/show.html.heex index 3026a18..4cabc10 100644 --- a/lib/outlook_web/live/article_live/show.html.heex +++ b/lib/outlook_web/live/article_live/show.html.heex @@ -40,6 +40,10 @@ <.render_doc tree={@article_content} /> +