diff --git a/lib/cannery/ammo/ammo_type.ex b/lib/cannery/ammo/ammo_type.ex index 71e8eef6..ebc5e172 100644 --- a/lib/cannery/ammo/ammo_type.ex +++ b/lib/cannery/ammo/ammo_type.ex @@ -30,7 +30,7 @@ defmodule Cannery.Ammo.AmmoType do field :grains, :integer field :pressure, :string field :primer_type, :string - field :rimfire, :boolean, null: false, default: false + field :firing_type, :string field :tracer, :boolean, null: false, default: false field :incendiary, :boolean, null: false, default: false field :blank, :boolean, null: false, default: false @@ -62,7 +62,7 @@ defmodule Cannery.Ammo.AmmoType do grains: integer() | nil, pressure: String.t() | nil, primer_type: String.t() | nil, - rimfire: boolean(), + firing_type: String.t() | nil, tracer: boolean(), incendiary: boolean(), blank: boolean(), @@ -95,7 +95,7 @@ defmodule Cannery.Ammo.AmmoType do :grains, :pressure, :primer_type, - :rimfire, + :firing_type, :tracer, :incendiary, :blank, diff --git a/lib/cannery_web/live/ammo_type_live/form_component.html.heex b/lib/cannery_web/live/ammo_type_live/form_component.html.heex index 4d371f64..b5b7f0dc 100644 --- a/lib/cannery_web/live/ammo_type_live/form_component.html.heex +++ b/lib/cannery_web/live/ammo_type_live/form_component.html.heex @@ -125,9 +125,12 @@ ) %> <%= error_tag(f, :primer_type, "col-span-3 text-center") %> - <%= label(f, :rimfire, gettext("Rimfire"), class: "mr-4 title text-lg text-primary-500") %> - <%= checkbox(f, :rimfire, class: "text-center col-span-2 checkbox") %> - <%= error_tag(f, :rimfire, "col-span-3 text-center") %> + <%= label(f, :firing_type, gettext("Firing type"), class: "mr-4 title text-lg text-primary-500") %> + <%= text_input(f, :firing_type, + class: "text-center col-span-2 input input-primary", + placeholder: "Centerfire" + ) %> + <%= error_tag(f, :firing_type, "col-span-3 text-center") %> <%= label(f, :tracer, gettext("Tracer"), class: "mr-4 title text-lg text-primary-500") %> <%= checkbox(f, :tracer, class: "text-center col-span-2 checkbox") %> diff --git a/priv/repo/migrations/20210903015537_create_ammo_types.exs b/priv/repo/migrations/20210903015537_create_ammo_types.exs index 8e554af8..9bdc56b2 100644 --- a/priv/repo/migrations/20210903015537_create_ammo_types.exs +++ b/priv/repo/migrations/20210903015537_create_ammo_types.exs @@ -20,7 +20,7 @@ defmodule Cannery.Repo.Migrations.CreateAmmoTypes do add :grains, :integer add :pressure, :string add :primer_type, :string - add :rimfire, :boolean, null: false, default: false + add :firing_type, :string add :tracer, :boolean, null: false, default: false add :incendiary, :boolean, null: false, default: false add :blank, :boolean, null: false, default: false