From d028af0671453545e6f6e9c1a7a673793da5791b Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 10 Sep 2021 22:24:19 -0400 Subject: [PATCH] remove tag show page --- lib/cannery_web/live/tag_live/index.html.leex | 1 - lib/cannery_web/live/tag_live/show.ex | 21 ------------ lib/cannery_web/live/tag_live/show.html.leex | 32 ------------------- lib/cannery_web/router.ex | 3 -- 4 files changed, 57 deletions(-) delete mode 100644 lib/cannery_web/live/tag_live/show.ex delete mode 100644 lib/cannery_web/live/tag_live/show.html.leex diff --git a/lib/cannery_web/live/tag_live/index.html.leex b/lib/cannery_web/live/tag_live/index.html.leex index 4a57721f..766ff116 100644 --- a/lib/cannery_web/live/tag_live/index.html.leex +++ b/lib/cannery_web/live/tag_live/index.html.leex @@ -27,7 +27,6 @@ <%= tag.text_color %> - <%= live_redirect "Show", to: Routes.tag_show_path(@socket, :show, tag) %> <%= live_patch "Edit", to: Routes.tag_index_path(@socket, :edit, tag) %> <%= link "Delete", to: "#", phx_click: "delete", phx_value_id: tag.id, data: [confirm: "Are you sure?"] %> diff --git a/lib/cannery_web/live/tag_live/show.ex b/lib/cannery_web/live/tag_live/show.ex deleted file mode 100644 index d0e38b7a..00000000 --- a/lib/cannery_web/live/tag_live/show.ex +++ /dev/null @@ -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 diff --git a/lib/cannery_web/live/tag_live/show.html.leex b/lib/cannery_web/live/tag_live/show.html.leex deleted file mode 100644 index 9201b57c..00000000 --- a/lib/cannery_web/live/tag_live/show.html.leex +++ /dev/null @@ -1,32 +0,0 @@ -

Show Tag

- -<%= 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 %> - - - -<%= live_patch "Edit", to: Routes.tag_show_path(@socket, :edit, @tag), class: "button" %> -<%= live_redirect "Back", to: Routes.tag_index_path(@socket, :index) %> diff --git a/lib/cannery_web/router.ex b/lib/cannery_web/router.ex index 43dfbab3..eaad88b8 100644 --- a/lib/cannery_web/router.ex +++ b/lib/cannery_web/router.ex @@ -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