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

@ -1,6 +1,9 @@
defmodule OutlookWeb.ArticleLive.NewComponents do
use Phoenix.Component
use OutlookWeb, :html
alias Outlook.{InternalTree,HtmlPreparations}
def import_raw_html(assigns) do
~H"""
<div>
@ -13,7 +16,8 @@ defmodule OutlookWeb.ArticleLive.NewComponents do
phx-change="validate_raw_html_input"
phx-submit="convert_raw_html_input"
>
<.input field={{f, :content}} type="textarea" label="text to import" phx-debounce="500" />
<.input field={{f, :content}} type="textarea" label="text to import" phx-debounce="500"
class="h-96" />
<:actions>
<.button phx-disable-with="Importing...">HTML importieren</.button>
</:actions>
@ -25,13 +29,22 @@ defmodule OutlookWeb.ArticleLive.NewComponents do
def review_raw_internaltree(assigns) do
~H"""
<div>Review Raw InternalTree</div>
<div class="flex">
<div id="html-preview" class="article">
<%= InternalTree.render_html_preview(@raw_internal_tree) |> raw %>
</div>
<div id="html-tree">
<.treeview tree_items={HtmlPreparations.get_tree_items(@raw_internal_tree)} ></.treeview>
</div>
</div>
<.button phx-click="approve_raw_internaltree">Continue</.button>
"""
end
def review_translation_units(assigns) do
~H"""
<div>Review Translation Units</div>
<.button phx-click="approve_translation_units">Continue</.button>
"""
end
end