Add toggling fields in translation form
This commit is contained in:
@ -14,6 +14,7 @@ defmodule OutlookWeb.TranslationLive.FormComponent do
|
|||||||
<:subtitle>Use this form to manage translation records in your database.</:subtitle>
|
<:subtitle>Use this form to manage translation records in your database.</:subtitle>
|
||||||
</.header>
|
</.header>
|
||||||
|
|
||||||
|
<div phx-click={JS.toggle(to: ".more-fields")} class="cursor-pointer">more/less fields</div>
|
||||||
<.simple_form
|
<.simple_form
|
||||||
:let={f}
|
:let={f}
|
||||||
for={@changeset}
|
for={@changeset}
|
||||||
@ -23,9 +24,12 @@ defmodule OutlookWeb.TranslationLive.FormComponent do
|
|||||||
phx-submit="save"
|
phx-submit="save"
|
||||||
>
|
>
|
||||||
<.input field={{f, :article_id}} type="hidden" />
|
<.input field={{f, :article_id}} type="hidden" />
|
||||||
|
<div class="more-fields">
|
||||||
<.input field={{f, :language}} type="select" label="language"
|
<.input field={{f, :language}} type="select" label="language"
|
||||||
options={Application.get_env(:outlook,:deepl)[:target_langs]} />
|
options={Application.get_env(:outlook,:deepl)[:target_langs]} />
|
||||||
|
</div>
|
||||||
<.input field={{f, :title}} type="text" label="title" />
|
<.input field={{f, :title}} type="text" label="title" />
|
||||||
|
<div class="more-fields">
|
||||||
<.input field={{f, :teaser}} type="textarea" label="teaser" class="h-28" />
|
<.input field={{f, :teaser}} type="textarea" label="teaser" class="h-28" />
|
||||||
<.input field={{f, :date}} type="datetime-local" label="date" />
|
<.input field={{f, :date}} type="datetime-local" label="date" />
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
@ -33,6 +37,7 @@ defmodule OutlookWeb.TranslationLive.FormComponent do
|
|||||||
<.input field={{f, :unauthorized}} type="checkbox" label="unauthorized" />
|
<.input field={{f, :unauthorized}} type="checkbox" label="unauthorized" />
|
||||||
</div>
|
</div>
|
||||||
<.input field={{f, :remarks}} type="textarea" label="remarks" class="h-28" />
|
<.input field={{f, :remarks}} type="textarea" label="remarks" class="h-28" />
|
||||||
|
</div>
|
||||||
<input type="hidden" id="continue_edit" name="continue_edit" value="false" />
|
<input type="hidden" id="continue_edit" name="continue_edit" value="false" />
|
||||||
<input type="hidden" id="publish" name="publish" value="false" />
|
<input type="hidden" id="publish" name="publish" value="false" />
|
||||||
<:actions>
|
<:actions>
|
||||||
|
|||||||
Reference in New Issue
Block a user