Add importing html and save it to Article

Additionally defines a wizard logic which is partially unused yet.
This commit is contained in:
Thelonius Kort
2022-12-29 16:43:52 +01:00
parent 60a22d011e
commit b7bd9195b6
24 changed files with 452 additions and 25 deletions

View File

@ -20,8 +20,8 @@ defmodule OutlookWeb.ArticleLive.FormComponent do
phx-change="validate"
phx-submit="save"
>
<.input field={{f, :author_id}} type="hidden" />
<.input field={{f, :title}} type="text" label="title" />
<.input field={{f, :content}} type="text" label="content" />
<.input field={{f, :url}} type="text" label="url" />
<.input field={{f, :language}} type="text" label="language" />
<.input field={{f, :date}} type="datetime-local" label="date" />
@ -54,6 +54,8 @@ defmodule OutlookWeb.ArticleLive.FormComponent do
end
def handle_event("save", %{"article" => article_params}, socket) do
article_params = article_params
|> Map.put("content", socket.assigns.internal_tree)
save_article(socket, socket.assigns.action, article_params)
end