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>
|
||||
</.header>
|
||||
|
||||
<div phx-click={JS.toggle(to: ".more-fields")} class="cursor-pointer">more/less fields</div>
|
||||
<.simple_form
|
||||
:let={f}
|
||||
for={@changeset}
|
||||
@ -23,16 +24,20 @@ defmodule OutlookWeb.TranslationLive.FormComponent do
|
||||
phx-submit="save"
|
||||
>
|
||||
<.input field={{f, :article_id}} type="hidden" />
|
||||
<.input field={{f, :language}} type="select" label="language"
|
||||
options={Application.get_env(:outlook,:deepl)[:target_langs]} />
|
||||
<.input field={{f, :title}} type="text" label="title" />
|
||||
<.input field={{f, :teaser}} type="textarea" label="teaser" class="h-28" />
|
||||
<.input field={{f, :date}} type="datetime-local" label="date" />
|
||||
<div class="flex items-center justify-between">
|
||||
<.input field={{f, :public}} type="checkbox" label="public" />
|
||||
<.input field={{f, :unauthorized}} type="checkbox" label="unauthorized" />
|
||||
<div class="more-fields">
|
||||
<.input field={{f, :language}} type="select" label="language"
|
||||
options={Application.get_env(:outlook,:deepl)[:target_langs]} />
|
||||
</div>
|
||||
<.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, :date}} type="datetime-local" label="date" />
|
||||
<div class="flex items-center justify-between">
|
||||
<.input field={{f, :public}} type="checkbox" label="public" />
|
||||
<.input field={{f, :unauthorized}} type="checkbox" label="unauthorized" />
|
||||
</div>
|
||||
<.input field={{f, :remarks}} type="textarea" label="remarks" class="h-28" />
|
||||
</div>
|
||||
<.input field={{f, :remarks}} type="textarea" label="remarks" class="h-28" />
|
||||
<input type="hidden" id="continue_edit" name="continue_edit" value="false" />
|
||||
<input type="hidden" id="publish" name="publish" value="false" />
|
||||
<:actions>
|
||||
|
||||
Reference in New Issue
Block a user