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

35 lines
791 B
Plaintext
Raw Normal View History

2022-07-25 20:08:40 -04:00
<div>
<h2><%= @title %></h2>
<.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"
>
<%= label(f, :title) %>
<%= text_input(f, :title) %>
<%= error_tag(f, :title) %>
<%= label(f, :content) %>
<%= textarea(f, :content) %>
<%= error_tag(f, :content) %>
<%= label(f, :tag) %>
<%= multiple_select(f, :tag, "Option 1": "option1", "Option 2": "option2") %>
<%= error_tag(f, :tag) %>
<%= label(f, :visibility) %>
<%= select(f, :visibility, Ecto.Enum.values(Memex.Notes.Note, :visibility),
prompt: "Choose a value"
) %>
<%= error_tag(f, :visibility) %>
2022-07-25 20:08:40 -04:00
<div>
2022-07-25 22:05:54 -04:00
<%= submit("Save", phx_disable_with: "Saving...") %>
2022-07-25 20:08:40 -04:00
</div>
</.form>
</div>