memEx/lib/memex_web/live/note_live/form_component.html.heex

57 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

2022-11-17 22:38:52 -05:00
<div class="h-full flex flex-col justify-start items-stretch space-y-4">
2022-07-25 20:08:40 -04:00
<.form
2022-11-16 21:11:02 -05:00
:let={f}
2022-07-25 20:08:40 -04:00
for={@changeset}
id="note-form"
phx-target={@myself}
phx-change="validate"
2022-07-25 22:05:54 -04:00
phx-submit="save"
2023-11-04 22:40:56 -04:00
phx-hook="CtrlEnter"
2022-11-17 22:38:52 -05:00
class="flex flex-col justify-start items-stretch space-y-4"
2022-07-25 22:05:54 -04:00
>
2022-11-26 14:51:18 -05:00
<%= text_input(f, :slug,
2023-11-04 21:54:40 -04:00
aria_label: gettext("slug"),
class: "input input-primary",
phx_debounce: 300,
phx_hook: "SanitizeTitles",
placeholder: gettext("slug")
2022-11-17 22:38:52 -05:00
) %>
2022-11-26 14:51:18 -05:00
<%= error_tag(f, :slug) %>
2022-07-25 22:05:54 -04:00
2022-11-17 22:38:52 -05:00
<%= textarea(f, :content,
id: "note-form-content",
class: "input input-primary h-64 min-h-64",
phx_update: "ignore",
2023-11-04 23:27:00 -04:00
placeholder: gettext("use [note-slug] to link to a note"),
aria_label: gettext("use [note-slug] to link to a note"),
2023-11-04 21:54:40 -04:00
phx_debounce: 300
2022-11-17 22:38:52 -05:00
) %>
2022-07-25 22:05:54 -04:00
<%= error_tag(f, :content) %>
2022-11-17 22:38:52 -05:00
<%= text_input(f, :tags_string,
2023-11-04 21:54:40 -04:00
aria_label: gettext("tag1,tag2"),
class: "input input-primary",
id: "tags-input",
phx_debounce: 300,
phx_hook: "SanitizeTags",
placeholder: gettext("tag1,tag2")
2022-07-25 22:05:54 -04:00
) %>
2022-11-17 22:38:52 -05:00
<%= 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",
2023-03-19 15:28:53 -04:00
prompt: gettext("select privacy"),
2023-11-04 21:54:40 -04:00
aria_label: gettext("select privacy"),
phx_debounce: 300
2022-11-17 22:38:52 -05:00
) %>
2022-07-25 22:05:54 -04:00
2022-11-17 22:38:52 -05:00
<%= submit(dgettext("actions", "save"),
phx_disable_with: gettext("saving..."),
class: "mx-auto btn btn-primary"
) %>
2022-07-25 20:08:40 -04:00
</div>
2022-11-17 22:38:52 -05:00
<%= error_tag(f, :visibility) %>
2022-07-25 20:08:40 -04:00
</.form>
</div>