This commit is contained in:
shibao 2022-01-31 20:14:17 -05:00
parent d549b732e1
commit 7ed77af3e0
3 changed files with 37 additions and 46 deletions

View File

@ -44,21 +44,18 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
id="ammo_group-form" id="ammo_group-form"
phx-target={@myself} phx-target={@myself}
phx-change="validate" phx-change="validate"
phx-submit="save"> phx-submit="save"
>
<%= label f, :count, class: "title text-lg text-primary-500" %> <%= label(f, :count, class: "title text-lg text-primary-500") %>
<%= number_input f, :count %> <%= number_input(f, :count) %>
<%= error_tag f, :count %> <%= error_tag(f, :count) %>
<%= label(f, :price_paid, class: "title text-lg text-primary-500") %>
<%= label f, :price_paid, class: "title text-lg text-primary-500" %> <%= number_input(f, :price_paid, step: "any") %>
<%= number_input f, :price_paid, step: "any" %> <%= error_tag(f, :price_paid) %>
<%= error_tag f, :price_paid %> <%= label(f, :notes, class: "title text-lg text-primary-500") %>
<%= textarea(f, :notes, class: "input") %>
<%= label f, :notes, class: "title text-lg text-primary-500" %> <%= error_tag(f, :notes) %>
<%= textarea f, :notes, class: "input" %> <%= submit("Save", phx_disable_with: "Saving...") %>
<%= error_tag f, :notes %>
<%= submit "Save", phx_disable_with: "Saving..." %>
</.form> </.form>
</div> </div>
""" """

View File

@ -44,33 +44,27 @@ defmodule CanneryWeb.AmmoTypeLive.FormComponent do
id="ammo_type-form" id="ammo_type-form"
phx-target={@myself} phx-target={@myself}
phx-change="validate" phx-change="validate"
phx-submit="save"> phx-submit="save"
>
<%= label f, :name, class: "title text-lg text-primary-500" %> <%= label(f, :name, class: "title text-lg text-primary-500") %>
<%= text_input f, :name, class: "input input-primary" %> <%= text_input(f, :name, class: "input input-primary") %>
<%= error_tag f, :name %> <%= error_tag(f, :name) %>
<%= label(f, :desc, class: "title text-lg text-primary-500") %>
<%= label f, :desc, class: "title text-lg text-primary-500" %> <%= text_input(f, :desc, class: "input input-primary") %>
<%= text_input f, :desc, class: "input input-primary" %> <%= error_tag(f, :desc) %>
<%= error_tag f, :desc %> <%= label(f, :case_material, class: "title text-lg text-primary-500") %>
<%= text_input(f, :case_material, class: "input input-primary") %>
<%= label f, :case_material, class: "title text-lg text-primary-500" %> <%= error_tag(f, :case_material) %>
<%= text_input f, :case_material, class: "input input-primary" %> <%= label(f, :bullet_type, class: "title text-lg text-primary-500") %>
<%= error_tag f, :case_material %> <%= text_input(f, :bullet_type, class: "input input-primary") %>
<%= error_tag(f, :bullet_type) %>
<%= label f, :bullet_type, class: "title text-lg text-primary-500" %> <%= label(f, :weight, class: "title text-lg text-primary-500") %>
<%= text_input f, :bullet_type, class: "input input-primary" %> <%= number_input(f, :weight, step: "any") %>
<%= error_tag f, :bullet_type %> <%= error_tag(f, :weight) %>
<%= label(f, :manufacturer, class: "title text-lg text-primary-500") %>
<%= label f, :weight, class: "title text-lg text-primary-500" %> <%= text_input(f, :manufacturer, class: "input input-primary") %>
<%= number_input f, :weight, step: "any" %> <%= error_tag(f, :manufacturer) %>
<%= error_tag f, :weight %> <%= submit("Save", phx_disable_with: "Saving...") %>
<%= label f, :manufacturer, class: "title text-lg text-primary-500" %>
<%= text_input f, :manufacturer, class: "input input-primary" %>
<%= error_tag f, :manufacturer %>
<%= submit "Save", phx_disable_with: "Saving..." %>
</.form> </.form>
</div> </div>
""" """

View File

@ -45,10 +45,10 @@ defmodule CanneryWeb.InviteLive.FormComponent do
class="grid grid-cols-3 justify-center items-center space-y-4" class="grid grid-cols-3 justify-center items-center space-y-4"
phx-target={@myself} phx-target={@myself}
phx-change="validate" phx-change="validate"
phx-submit="save"> phx-submit="save"
>
<%= label f, :name, class: "title text-lg text-primary-500" %> <%= label(f, :name, class: "title text-lg text-primary-500") %>
<%= text_input f, :name, class: "input input-primary col-span-2" %> <%= text_input(f, :name, class: "input input-primary col-span-2") %>
<span class="col-span-3"> <span class="col-span-3">
<%= error_tag(f, :name) %> <%= error_tag(f, :name) %>
</span> </span>