forked from shibao/cannery
rename ammo type to type
This commit is contained in:
@ -86,19 +86,19 @@ defmodule CanneryWeb.ContainerLive.Show do
|
||||
{:noreply, socket |> assign(:view_table, !view_table) |> render_container()}
|
||||
end
|
||||
|
||||
def handle_event("change_class", %{"ammo_type" => %{"class" => "rifle"}}, socket) do
|
||||
def handle_event("change_class", %{"type" => %{"class" => "rifle"}}, socket) do
|
||||
{:noreply, socket |> assign(:class, :rifle) |> render_container()}
|
||||
end
|
||||
|
||||
def handle_event("change_class", %{"ammo_type" => %{"class" => "shotgun"}}, socket) do
|
||||
def handle_event("change_class", %{"type" => %{"class" => "shotgun"}}, socket) do
|
||||
{:noreply, socket |> assign(:class, :shotgun) |> render_container()}
|
||||
end
|
||||
|
||||
def handle_event("change_class", %{"ammo_type" => %{"class" => "pistol"}}, socket) do
|
||||
def handle_event("change_class", %{"type" => %{"class" => "pistol"}}, socket) do
|
||||
{:noreply, socket |> assign(:class, :pistol) |> render_container()}
|
||||
end
|
||||
|
||||
def handle_event("change_class", %{"ammo_type" => %{"class" => _all}}, socket) do
|
||||
def handle_event("change_class", %{"type" => %{"class" => _all}}, socket) do
|
||||
{:noreply, socket |> assign(:class, :all) |> render_container()}
|
||||
end
|
||||
|
||||
|
@ -89,7 +89,7 @@
|
||||
<.form
|
||||
:let={f}
|
||||
for={%{}}
|
||||
as={:ammo_type}
|
||||
as={:type}
|
||||
phx-change="change_class"
|
||||
phx-submit="change_class"
|
||||
class="flex items-center"
|
||||
@ -126,16 +126,16 @@
|
||||
<%= if @view_table do %>
|
||||
<.live_component
|
||||
module={CanneryWeb.Components.PackTableComponent}
|
||||
id="ammo-type-show-table"
|
||||
id="type-show-table"
|
||||
packs={@packs}
|
||||
current_user={@current_user}
|
||||
show_used={false}
|
||||
>
|
||||
<:ammo_type :let={%{name: ammo_type_name} = ammo_type}>
|
||||
<.link navigate={Routes.ammo_type_show_path(Endpoint, :show, ammo_type)} class="link">
|
||||
<%= ammo_type_name %>
|
||||
<:type :let={%{name: type_name} = type}>
|
||||
<.link navigate={Routes.type_show_path(Endpoint, :show, type)} class="link">
|
||||
<%= type_name %>
|
||||
</.link>
|
||||
</:ammo_type>
|
||||
</:type>
|
||||
</.live_component>
|
||||
<% else %>
|
||||
<div class="flex flex-wrap justify-center items-stretch">
|
||||
|
Reference in New Issue
Block a user