remove tag show page

This commit is contained in:
shibao 2021-09-10 22:24:19 -04:00 committed by oliviasculley
parent 5d4d8285fb
commit d028af0671
4 changed files with 0 additions and 57 deletions

View File

@ -27,7 +27,6 @@
<td><%= tag.text_color %></td>
<td>
<span><%= live_redirect "Show", to: Routes.tag_show_path(@socket, :show, tag) %></span>
<span><%= live_patch "Edit", to: Routes.tag_index_path(@socket, :edit, tag) %></span>
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: tag.id, data: [confirm: "Are you sure?"] %></span>
</td>

View File

@ -1,21 +0,0 @@
defmodule CanneryWeb.TagLive.Show do
use CanneryWeb, :live_view
alias Cannery.Tags
@impl true
def mount(_params, session, socket) do
{:ok, socket |> assign_defaults(session)}
end
@impl true
def handle_params(%{"id" => id}, _, socket) do
{:noreply,
socket
|> assign(:page_title, page_title(socket.assigns.live_action))
|> assign(:tag, Tags.get_tag!(id))}
end
defp page_title(:show), do: "Show Tag"
defp page_title(:edit), do: "Edit Tag"
end

View File

@ -1,32 +0,0 @@
<h1>Show Tag</h1>
<%= if @live_action in [:edit] do %>
<%= live_modal CanneryWeb.TagLive.FormComponent,
id: @tag.id,
title: @page_title,
action: @live_action,
tag: @tag,
return_to: Routes.tag_show_path(@socket, :show, @tag) %>
<% end %>
<ul>
<li>
<strong>Name:</strong>
<%= @tag.name %>
</li>
<li>
<strong>Bg-color:</strong>
<%= @tag.bg_color %>
</li>
<li>
<strong>Text-color:</strong>
<%= @tag.text_color %>
</li>
</ul>
<span><%= live_patch "Edit", to: Routes.tag_show_path(@socket, :edit, @tag), class: "button" %></span>
<span><%= live_redirect "Back", to: Routes.tag_index_path(@socket, :index) %></span>

View File

@ -54,9 +54,6 @@ defmodule CanneryWeb.Router do
live "/tags/new", TagLive.Index, :new
live "/tags/:id/edit", TagLive.Index, :edit
live "/tags/:id", TagLive.Show, :show
live "/tags/:id/show/edit", TagLive.Show, :edit
live "/ammo_types", AmmoTypeLive.Index, :index
live "/ammo_types/new", AmmoTypeLive.Index, :new
live "/ammo_types/:id/edit", AmmoTypeLive.Index, :edit