From bad1a23dfe063a38cb8f47d26a81572ebbd4e8bd Mon Sep 17 00:00:00 2001 From: shibao Date: Mon, 28 Mar 2022 23:56:56 -0400 Subject: [PATCH] fix ammo group overflow --- lib/cannery_web/live/ammo_group_live/index.ex | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/lib/cannery_web/live/ammo_group_live/index.ex b/lib/cannery_web/live/ammo_group_live/index.ex index c217dcd..d4ee814 100644 --- a/lib/cannery_web/live/ammo_group_live/index.ex +++ b/lib/cannery_web/live/ammo_group_live/index.ex @@ -121,19 +121,21 @@ defmodule CanneryWeb.AmmoGroupLive.Index do {staged, ~H""" - +
+ - <%= live_patch(dgettext("actions", "Record shots"), - to: Routes.ammo_group_index_path(Endpoint, :add_shot_group, ammo_group), - class: "btn btn-primary" - ) %> + <%= live_patch(dgettext("actions", "Record shots"), + to: Routes.ammo_group_index_path(Endpoint, :add_shot_group, ammo_group), + class: "mx-2 my-1 btn btn-primary" + ) %> +
"""} end @@ -174,11 +176,17 @@ defmodule CanneryWeb.AmmoGroupLive.Index do defp get_value_for_key("container", %{container: nil}), do: {nil, nil} defp get_value_for_key("container", %{container: %{name: container_name}} = ammo_group) do + assigns = %{ammo_group: ammo_group} + {container_name, - live_patch(container_name, - to: Routes.ammo_group_index_path(Endpoint, :move, ammo_group), - class: "btn btn-primary" - )} + ~H""" +
+ <%= live_patch(@ammo_group.container.name, + to: Routes.ammo_group_index_path(Endpoint, :move, @ammo_group), + class: "btn btn-primary" + ) %> +
+ """} end defp get_value_for_key(key, ammo_group),