Files
2023-05-03 22:37:43 +02:00

70 lines
2.1 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">
<.render_doc tree={@raw_internal_tree} ></.render_doc>
</div>
<div id="html-tree">
<.render_tree tree={@raw_internal_tree} ></.render_tree>
</div>
</div>
<.button phx-click="approve_raw_internaltree">Continue</.button>
"""
end
def review_translation_units(assigns) do
~H"""
<div>Review Translation Units</div>
<div class="flex gap-4">
<div id="html-tree" class="article w-96 overflow-auto whitespace-nowrap">
<.render_tree tree={@raw_internal_tree} ></.render_tree>
</div>
<div id="partition-preview" class="article show-boundary overflow-auto h-full">
<.render_doc tree={@raw_internal_tree} ></.render_doc>
</div>
<div>
<.live_component module={OutlookWeb.ArticleLive.MenuComponent} entries={@menu_entries} handler="modify_tunits" id={:review_tunits} />
</div>
</div>
<.button phx-click="approve_translation_units">Continue</.button>
"""
end
def final_form(assigns) do
~H"""
<div>Final Form</div>
<!-- this should eventually become the first stage because url will be needed for processing of images -->
<.button phx-click="save">Save</.button>
"""
end
end