Add creating and basic editing of translation

This commit is contained in:
Thelonius Kort
2023-01-04 14:42:13 +01:00
parent f4b5abef5a
commit d589d84b40
15 changed files with 235 additions and 47 deletions

View File

@ -15,6 +15,7 @@
<.link navigate={~p"/articles/#{article}"}>Show</.link>
</div>
<.link patch={~p"/articles/#{article}/edit"}>Edit</.link>
<.link navigate={~p"/translations/new?article_id=#{article}"}>New Translation</.link>
</:action>
<:action :let={article}>
<.link phx-click={JS.push("delete", value: %{id: article.id})} data-confirm="Are you sure?">

View File

@ -47,4 +47,12 @@ defmodule OutlookWeb.ArticleLive.NewComponents do
<.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

View File

@ -18,6 +18,8 @@
<%= InternalTree.render_html(@article.content) |> raw %>
</div>
<.link navigate={~p"/translations/new?article_id=#{@article.id}"}>New Translation</.link>
<.back navigate={~p"/articles"}>Back to articles</.back>
<.modal :if={@live_action == :edit} id="article-modal" show on_cancel={JS.patch(~p"/articles/#{@article}")}>