fix patch links to working properly

This commit is contained in:
shibao 2022-11-09 23:47:11 -05:00
parent 53bb0ddb03
commit 3dd6430105
15 changed files with 34 additions and 31 deletions

View File

@ -26,7 +26,7 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
border border-gray-400 rounded-lg shadow-lg hover:shadow-md border border-gray-400 rounded-lg shadow-lg hover:shadow-md
transition-all duration-300 ease-in-out" transition-all duration-300 ease-in-out"
> >
<.link patch={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)} class="mb-2 link"> <.link navigate={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)} class="mb-2 link">
<h1 class="title text-xl title-primary-500"> <h1 class="title text-xl title-primary-500">
<%= @ammo_group.ammo_type.name %> <%= @ammo_group.ammo_type.name %>
</h1> </h1>
@ -71,7 +71,7 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
<%= gettext("Container:") %> <%= gettext("Container:") %>
<.link <.link
patch={Routes.container_show_path(Endpoint, :show, @ammo_group.container)} navigate={Routes.container_show_path(Endpoint, :show, @ammo_group.container)}
class="link" class="link"
> >
<%= @ammo_group.container.name %> <%= @ammo_group.container.name %>

View File

@ -86,7 +86,7 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h2> </h2>
<.link patch={Routes.container_index_path(Endpoint, :new)} class="btn btn-primary"> <.link navigate={Routes.container_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "Add another container!") %> <%= dgettext("actions", "Add another container!") %>
</.link> </.link>
<% else %> <% else %>

View File

@ -17,7 +17,7 @@ defmodule CanneryWeb.Components.Topbar do
<div class="flex flex-col sm:flex-row justify-between items-center"> <div class="flex flex-col sm:flex-row justify-between items-center">
<div class="mb-4 sm:mb-0 sm:mr-8 flex flex-row justify-start items-center space-x-2"> <div class="mb-4 sm:mb-0 sm:mr-8 flex flex-row justify-start items-center space-x-2">
<.link <.link
patch={Routes.live_path(Endpoint, HomeLive)} navigate={Routes.live_path(Endpoint, HomeLive)}
class="inline mx-2 my-1 leading-5 text-xl text-white" class="inline mx-2 my-1 leading-5 text-xl text-white"
> >
<img <img
@ -43,7 +43,7 @@ defmodule CanneryWeb.Components.Topbar do
<%= if @current_user do %> <%= if @current_user do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.tag_index_path(Endpoint, :index)} navigate={Routes.tag_index_path(Endpoint, :index)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<%= gettext("Tags") %> <%= gettext("Tags") %>
@ -51,7 +51,7 @@ defmodule CanneryWeb.Components.Topbar do
</li> </li>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.container_index_path(Endpoint, :index)} navigate={Routes.container_index_path(Endpoint, :index)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<%= gettext("Containers") %> <%= gettext("Containers") %>
@ -59,7 +59,7 @@ defmodule CanneryWeb.Components.Topbar do
</li> </li>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.ammo_type_index_path(Endpoint, :index)} navigate={Routes.ammo_type_index_path(Endpoint, :index)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<%= gettext("Catalog") %> <%= gettext("Catalog") %>
@ -67,7 +67,7 @@ defmodule CanneryWeb.Components.Topbar do
</li> </li>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.ammo_group_index_path(Endpoint, :index)} navigate={Routes.ammo_group_index_path(Endpoint, :index)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<%= gettext("Ammo") %> <%= gettext("Ammo") %>
@ -75,7 +75,7 @@ defmodule CanneryWeb.Components.Topbar do
</li> </li>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.range_index_path(Endpoint, :index)} navigate={Routes.range_index_path(Endpoint, :index)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<%= gettext("Range") %> <%= gettext("Range") %>
@ -84,7 +84,7 @@ defmodule CanneryWeb.Components.Topbar do
<%= if @current_user.role == :admin do %> <%= if @current_user.role == :admin do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.invite_index_path(Endpoint, :index)} navigate={Routes.invite_index_path(Endpoint, :index)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<%= gettext("Invites") %> <%= gettext("Invites") %>
@ -93,7 +93,7 @@ defmodule CanneryWeb.Components.Topbar do
<% end %> <% end %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.user_settings_path(Endpoint, :edit)} navigate={Routes.user_settings_path(Endpoint, :edit)}
class="text-primary-600 text-white hover:underline truncate" class="text-primary-600 text-white hover:underline truncate"
> >
<%= @current_user.email %> <%= @current_user.email %>
@ -111,7 +111,7 @@ defmodule CanneryWeb.Components.Topbar do
<%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %> <%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.live_dashboard_path(Endpoint, :home)} navigate={Routes.live_dashboard_path(Endpoint, :home)}
class="text-primary-600 text-white hover:underline" class="text-primary-600 text-white hover:underline"
> >
<i class="fas fa-gauge"></i> <i class="fas fa-gauge"></i>
@ -122,7 +122,7 @@ defmodule CanneryWeb.Components.Topbar do
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.user_registration_path(Endpoint, :new)} navigate={Routes.user_registration_path(Endpoint, :new)}
class="text-primary-600 text-white hover:underline truncate" class="text-primary-600 text-white hover:underline truncate"
> >
<%= dgettext("actions", "Register") %> <%= dgettext("actions", "Register") %>
@ -131,7 +131,7 @@ defmodule CanneryWeb.Components.Topbar do
<% end %> <% end %>
<li class="mx-2 my-1"> <li class="mx-2 my-1">
<.link <.link
patch={Routes.user_session_path(Endpoint, :new)} navigate={Routes.user_session_path(Endpoint, :new)}
class="text-primary-600 text-white hover:underline truncate" class="text-primary-600 text-white hover:underline truncate"
> >
<%= dgettext("actions", "Log in") %> <%= dgettext("actions", "Log in") %>

View File

@ -133,7 +133,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
{ammo_type.name, {ammo_type.name,
~H""" ~H"""
<.link patch={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)} class="link"> <.link navigate={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)} class="link">
<%= @ammo_type.name %> <%= @ammo_type.name %>
</.link> </.link>
"""} """}
@ -202,7 +202,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
~H""" ~H"""
<div class="py-2 px-4 h-full space-x-4 flex justify-center items-center"> <div class="py-2 px-4 h-full space-x-4 flex justify-center items-center">
<.link <.link
patch={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)} navigate={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)}
class="text-primary-600 link" class="text-primary-600 link"
data-qa={"view-#{@ammo_group.id}"} data-qa={"view-#{@ammo_group.id}"}
> >
@ -240,7 +240,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
~H""" ~H"""
<div class="min-w-20 py-2 px-4 h-full flex flew-wrap justify-center items-center"> <div class="min-w-20 py-2 px-4 h-full flex flew-wrap justify-center items-center">
<.link <.link
patch={Routes.container_show_path(Endpoint, :show, @ammo_group.container)} navigate={Routes.container_show_path(Endpoint, :show, @ammo_group.container)}
class="mx-2 my-1 link" class="mx-2 my-1 link"
> >
<%= @ammo_group.container.name %> <%= @ammo_group.container.name %>

View File

@ -17,7 +17,7 @@
<%= dgettext("prompts", "You'll need to") %> <%= dgettext("prompts", "You'll need to") %>
</h2> </h2>
<.link patch={Routes.container_index_path(Endpoint, :new)} class="btn btn-primary"> <.link navigate={Routes.container_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "add a container first") %> <%= dgettext("actions", "add a container first") %>
</.link> </.link>
</div> </div>
@ -27,7 +27,7 @@
<%= dgettext("prompts", "You'll need to") %> <%= dgettext("prompts", "You'll need to") %>
</h2> </h2>
<.link patch={Routes.ammo_type_index_path(Endpoint, :new)} class="btn btn-primary"> <.link navigate={Routes.ammo_type_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "add an ammo type first") %> <%= dgettext("actions", "add an ammo type first") %>
</.link> </.link>
</div> </div>

View File

@ -53,7 +53,7 @@
<div class="flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center">
<div class="flex flex-wrap justify-center items-center text-primary-600"> <div class="flex flex-wrap justify-center items-center text-primary-600">
<.link <.link
patch={Routes.ammo_type_show_path(Endpoint, :show, @ammo_group.ammo_type)} navigate={Routes.ammo_type_show_path(Endpoint, :show, @ammo_group.ammo_type)}
class="mx-4 my-2 btn btn-primary" class="mx-4 my-2 btn btn-primary"
data-qa="details" data-qa="details"
> >

View File

@ -124,7 +124,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
~H""" ~H"""
<.link <.link
patch={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)} navigate={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)}
class="link" class="link"
data-qa={"view-name-#{@ammo_type.id}"} data-qa={"view-name-#{@ammo_type.id}"}
> >
@ -139,7 +139,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
~H""" ~H"""
<div class="px-4 py-2 space-x-4 flex justify-center items-center"> <div class="px-4 py-2 space-x-4 flex justify-center items-center">
<.link <.link
patch={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)} navigate={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)}
class="text-primary-600 link" class="text-primary-600 link"
data-qa={"view-#{@ammo_type.id}"} data-qa={"view-#{@ammo_type.id}"}
> >

View File

@ -154,7 +154,10 @@ defmodule CanneryWeb.RangeLive.Index do
:name -> :name ->
{shot_group.ammo_group.ammo_type.name, {shot_group.ammo_group.ammo_type.name,
~H""" ~H"""
<.link patch={Routes.ammo_group_show_path(Endpoint, :show, @shot_group.ammo_group)} class="link"> <.link
navigate={Routes.ammo_group_show_path(Endpoint, :show, @shot_group.ammo_group)}
class="link"
>
<%= @shot_group.ammo_group.ammo_type.name %> <%= @shot_group.ammo_group.ammo_type.name %>
</.link> </.link>
"""} """}

View File

@ -9,11 +9,11 @@
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
</h1> </h1>
<.link patch={Routes.ammo_group_index_path(Endpoint, :index)} class="btn btn-primary"> <.link navigate={Routes.ammo_group_index_path(Endpoint, :index)} class="btn btn-primary">
<%= dgettext("actions", "Why not get some ready to shoot?") %> <%= dgettext("actions", "Why not get some ready to shoot?") %>
</.link> </.link>
<% else %> <% else %>
<.link patch={Routes.ammo_group_index_path(Endpoint, :index)} class="btn btn-primary"> <.link navigate={Routes.ammo_group_index_path(Endpoint, :index)} class="btn btn-primary">
<%= dgettext("actions", "Stage ammo") %> <%= dgettext("actions", "Stage ammo") %>
</.link> </.link>

View File

@ -213,7 +213,7 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "Sind sie sicher, dass Sie diese Munition demarkieren möchten?" msgstr "Sind sie sicher, dass Sie diese Munition demarkieren möchten?"
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.ex:181 #: lib/cannery_web/live/range_live/index.ex:184
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "Sind sie sicher, dass sie die Schießkladde löschen möchten?" msgstr "Sind sie sicher, dass sie die Schießkladde löschen möchten?"

View File

@ -193,7 +193,7 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "" msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.ex:181 #: lib/cannery_web/live/range_live/index.ex:184
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""

View File

@ -212,7 +212,7 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "Está seguro que desea desmontar esta munición?" msgstr "Está seguro que desea desmontar esta munición?"
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.ex:181 #: lib/cannery_web/live/range_live/index.ex:184
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""

View File

@ -214,7 +214,7 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "Êtes-vous certain·e de vouloir désélectionner cette munition?" msgstr "Êtes-vous certain·e de vouloir désélectionner cette munition?"
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.ex:181 #: lib/cannery_web/live/range_live/index.ex:184
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "Êtes-vous certain·e de vouloir supprimer cet enregistrement de tir?" msgstr "Êtes-vous certain·e de vouloir supprimer cet enregistrement de tir?"

View File

@ -203,7 +203,7 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "" msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.ex:181 #: lib/cannery_web/live/range_live/index.ex:184
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""

View File

@ -192,7 +192,7 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "" msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.ex:181 #: lib/cannery_web/live/range_live/index.ex:184
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""