memEx/lib/memex_web/live/note_live/form_component.html.heex
shibao 571f6fffdb
Some checks are pending
continuous-integration/drone/push Build is running
improve tagging logic
2022-12-19 22:34:00 -05:00

48 lines
1.3 KiB
Plaintext

<div class="h-full flex flex-col justify-start items-stretch space-y-4">
<.form
:let={f}
for={@changeset}
id="note-form"
phx-target={@myself}
phx-change="validate"
phx-submit="save"
phx-debounce="300"
class="flex flex-col justify-start items-stretch space-y-4"
>
<%= text_input(f, :slug,
class: "input input-primary",
placeholder: gettext("slug")
) %>
<%= error_tag(f, :slug) %>
<%= textarea(f, :content,
id: "note-form-content",
class: "input input-primary h-64 min-h-64",
phx_hook: "MaintainAttrs",
phx_update: "ignore",
placeholder: gettext("content")
) %>
<%= error_tag(f, :content) %>
<%= text_input(f, :tags_string,
id: "tags-input",
class: "input input-primary",
placeholder: gettext("tag1,tag2")
) %>
<%= error_tag(f, :tags_string) %>
<div class="flex justify-center items-stretch space-x-4">
<%= select(f, :visibility, Ecto.Enum.values(Memex.Notes.Note, :visibility),
class: "grow input input-primary",
prompt: gettext("select privacy")
) %>
<%= submit(dgettext("actions", "save"),
phx_disable_with: gettext("saving..."),
class: "mx-auto btn btn-primary"
) %>
</div>
<%= error_tag(f, :visibility) %>
</.form>
</div>