Files
phoenix-ausblick/lib/outlook_web/live/article_live/new_components.ex
Thelonius Kort b7bd9195b6 Add importing html and save it to Article
Additionally defines a wizard logic which is partially unused yet.
2022-12-29 16:43:52 +01:00

51 lines
1.4 KiB
Elixir

defmodule OutlookWeb.ArticleLive.NewComponents do
use Phoenix.Component
use OutlookWeb, :html
alias Outlook.{InternalTree,HtmlPreparations}
def import_raw_html(assigns) do
~H"""
<div>
<div>Import article</div>
<.simple_form
:let={f}
for={@changeset}
id="raw-html-input-form"
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"
class="h-96" />
<:actions>
<.button phx-disable-with="Importing...">HTML importieren</.button>
</:actions>
</.simple_form>
</div>
"""
end
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