memEx/lib/memex_web/live/context_live/form_component.html.heex
2022-11-03 18:23:17 -04:00

33 lines
785 B
Plaintext

<div>
<h2><%= @title %></h2>
<.form
let={f}
for={@changeset}
id="context-form"
phx-target={@myself}
phx-change="validate"
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.Contexts.Context, :visibility), prompt: "Choose a value" %>
<%= error_tag f, :visibility %>
<div>
<%= submit "Save", phx_disable_with: "Saving..." %>
</div>
</.form>
</div>