57 lines
1.7 KiB
Text
57 lines
1.7 KiB
Text
<%= form_for @changeset, "#", [
|
|
id: "property-form",
|
|
phx_target: @myself,
|
|
phx_change: "validate",
|
|
phx_submit: "save"
|
|
], fn f -> %>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="mb-3" phx-feedback-for="<%= input_id(f, :name)%>">
|
|
<%= label f, :name, class: "form-label" %>
|
|
<div class="input-group has-validation">
|
|
<%= text_input f, :name,
|
|
class: input_class(f, :name, "form-control"),
|
|
aria_describedby: error_id(f, :name)
|
|
%>
|
|
<%= error_tag f, :name %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3" phx-feedback-for="<%= input_id(f, :price)%>">
|
|
<%= label f, :price, class: "form-label" %>
|
|
<div class="input-group has-validation">
|
|
<%= number_input f, :price,
|
|
class: input_class(f, :price, "form-control"),
|
|
step: "any",
|
|
aria_describedby: error_id(f, :price)
|
|
%>
|
|
<%= error_tag f, :price %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3" phx-feedback-for="<%= input_id(f, :description)%>">
|
|
<%= label f, :description, class: "form-label" %>
|
|
<div class="input-group has-validation">
|
|
<%= textarea f, :description,
|
|
class: input_class(f, :description, "form-control"),
|
|
aria_describedby: error_id(f, :description)
|
|
%>
|
|
<%= error_tag f, :description %>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
|
|
<%= link "Cancel", to: "#", class: "btn btn-secondary me-2", phx_click: "cancel", phx_target: @myself %>
|
|
<%= submit "Save",
|
|
class: "btn btn-primary ",
|
|
disabled: !@changeset.valid?,
|
|
aria_disabled: !@changeset.valid? && "true" || false,
|
|
phx_disable_with: "Saving..."
|
|
%>
|
|
|
|
</div>
|
|
|
|
<% end %>
|