From 7ed77af3e0e3d18bc1b3be6f5a871bf7f92a014e Mon Sep 17 00:00:00 2001 From: shibao Date: Mon, 31 Jan 2022 20:14:17 -0500 Subject: [PATCH] format --- .../live/ammo_group_live/form_component.ex | 27 +++++------ .../live/ammo_type_live/form_component.ex | 48 ++++++++----------- .../live/invite_live/form_component.ex | 8 ++-- 3 files changed, 37 insertions(+), 46 deletions(-) diff --git a/lib/cannery_web/live/ammo_group_live/form_component.ex b/lib/cannery_web/live/ammo_group_live/form_component.ex index f47b479d..a9b7018b 100644 --- a/lib/cannery_web/live/ammo_group_live/form_component.ex +++ b/lib/cannery_web/live/ammo_group_live/form_component.ex @@ -44,21 +44,18 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do id="ammo_group-form" phx-target={@myself} phx-change="validate" - phx-submit="save"> - - <%= label f, :count, class: "title text-lg text-primary-500" %> - <%= number_input f, :count %> - <%= error_tag f, :count %> - - <%= label f, :price_paid, class: "title text-lg text-primary-500" %> - <%= number_input f, :price_paid, step: "any" %> - <%= error_tag f, :price_paid %> - - <%= label f, :notes, class: "title text-lg text-primary-500" %> - <%= textarea f, :notes, class: "input" %> - <%= error_tag f, :notes %> - - <%= submit "Save", phx_disable_with: "Saving..." %> + phx-submit="save" + > + <%= label(f, :count, class: "title text-lg text-primary-500") %> + <%= number_input(f, :count) %> + <%= error_tag(f, :count) %> + <%= label(f, :price_paid, class: "title text-lg text-primary-500") %> + <%= number_input(f, :price_paid, step: "any") %> + <%= error_tag(f, :price_paid) %> + <%= label(f, :notes, class: "title text-lg text-primary-500") %> + <%= textarea(f, :notes, class: "input") %> + <%= error_tag(f, :notes) %> + <%= submit("Save", phx_disable_with: "Saving...") %> """ diff --git a/lib/cannery_web/live/ammo_type_live/form_component.ex b/lib/cannery_web/live/ammo_type_live/form_component.ex index 965bd0cc..66201b93 100644 --- a/lib/cannery_web/live/ammo_type_live/form_component.ex +++ b/lib/cannery_web/live/ammo_type_live/form_component.ex @@ -44,33 +44,27 @@ defmodule CanneryWeb.AmmoTypeLive.FormComponent do id="ammo_type-form" phx-target={@myself} phx-change="validate" - phx-submit="save"> - - <%= label f, :name, class: "title text-lg text-primary-500" %> - <%= text_input f, :name, class: "input input-primary" %> - <%= error_tag f, :name %> - - <%= label f, :desc, class: "title text-lg text-primary-500" %> - <%= text_input f, :desc, class: "input input-primary" %> - <%= error_tag f, :desc %> - - <%= label f, :case_material, class: "title text-lg text-primary-500" %> - <%= text_input f, :case_material, class: "input input-primary" %> - <%= error_tag f, :case_material %> - - <%= label f, :bullet_type, class: "title text-lg text-primary-500" %> - <%= text_input f, :bullet_type, class: "input input-primary" %> - <%= error_tag f, :bullet_type %> - - <%= label f, :weight, class: "title text-lg text-primary-500" %> - <%= number_input f, :weight, step: "any" %> - <%= error_tag f, :weight %> - - <%= 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..." %> + phx-submit="save" + > + <%= label(f, :name, class: "title text-lg text-primary-500") %> + <%= text_input(f, :name, class: "input input-primary") %> + <%= error_tag(f, :name) %> + <%= label(f, :desc, class: "title text-lg text-primary-500") %> + <%= text_input(f, :desc, class: "input input-primary") %> + <%= error_tag(f, :desc) %> + <%= label(f, :case_material, class: "title text-lg text-primary-500") %> + <%= text_input(f, :case_material, class: "input input-primary") %> + <%= error_tag(f, :case_material) %> + <%= label(f, :bullet_type, class: "title text-lg text-primary-500") %> + <%= text_input(f, :bullet_type, class: "input input-primary") %> + <%= error_tag(f, :bullet_type) %> + <%= label(f, :weight, class: "title text-lg text-primary-500") %> + <%= number_input(f, :weight, step: "any") %> + <%= error_tag(f, :weight) %> + <%= 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...") %> """ diff --git a/lib/cannery_web/live/invite_live/form_component.ex b/lib/cannery_web/live/invite_live/form_component.ex index ae93b80b..6707b302 100644 --- a/lib/cannery_web/live/invite_live/form_component.ex +++ b/lib/cannery_web/live/invite_live/form_component.ex @@ -45,10 +45,10 @@ defmodule CanneryWeb.InviteLive.FormComponent do class="grid grid-cols-3 justify-center items-center space-y-4" phx-target={@myself} phx-change="validate" - phx-submit="save"> - - <%= label f, :name, class: "title text-lg text-primary-500" %> - <%= text_input f, :name, class: "input input-primary col-span-2" %> + phx-submit="save" + > + <%= label(f, :name, class: "title text-lg text-primary-500") %> + <%= text_input(f, :name, class: "input input-primary col-span-2") %> <%= error_tag(f, :name) %>