forked from shibao/cannery
fix patch links to working properly
This commit is contained in:
parent
53bb0ddb03
commit
3dd6430105
@ -26,7 +26,7 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
|
||||
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
|
||||
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">
|
||||
<%= @ammo_group.ammo_type.name %>
|
||||
</h1>
|
||||
@ -71,7 +71,7 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
|
||||
<%= gettext("Container:") %>
|
||||
|
||||
<.link
|
||||
patch={Routes.container_show_path(Endpoint, :show, @ammo_group.container)}
|
||||
navigate={Routes.container_show_path(Endpoint, :show, @ammo_group.container)}
|
||||
class="link"
|
||||
>
|
||||
<%= @ammo_group.container.name %>
|
||||
|
@ -86,7 +86,7 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do
|
||||
<%= display_emoji("😔") %>
|
||||
</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!") %>
|
||||
</.link>
|
||||
<% else %>
|
||||
|
@ -17,7 +17,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
<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">
|
||||
<.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"
|
||||
>
|
||||
<img
|
||||
@ -43,7 +43,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
<%= if @current_user do %>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.tag_index_path(Endpoint, :index)}
|
||||
navigate={Routes.tag_index_path(Endpoint, :index)}
|
||||
class="text-primary-600 text-white hover:underline"
|
||||
>
|
||||
<%= gettext("Tags") %>
|
||||
@ -51,7 +51,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
</li>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.container_index_path(Endpoint, :index)}
|
||||
navigate={Routes.container_index_path(Endpoint, :index)}
|
||||
class="text-primary-600 text-white hover:underline"
|
||||
>
|
||||
<%= gettext("Containers") %>
|
||||
@ -59,7 +59,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
</li>
|
||||
<li class="mx-2 my-1">
|
||||
<.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"
|
||||
>
|
||||
<%= gettext("Catalog") %>
|
||||
@ -67,7 +67,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
</li>
|
||||
<li class="mx-2 my-1">
|
||||
<.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"
|
||||
>
|
||||
<%= gettext("Ammo") %>
|
||||
@ -75,7 +75,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
</li>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.range_index_path(Endpoint, :index)}
|
||||
navigate={Routes.range_index_path(Endpoint, :index)}
|
||||
class="text-primary-600 text-white hover:underline"
|
||||
>
|
||||
<%= gettext("Range") %>
|
||||
@ -84,7 +84,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
<%= if @current_user.role == :admin do %>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.invite_index_path(Endpoint, :index)}
|
||||
navigate={Routes.invite_index_path(Endpoint, :index)}
|
||||
class="text-primary-600 text-white hover:underline"
|
||||
>
|
||||
<%= gettext("Invites") %>
|
||||
@ -93,7 +93,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
<% end %>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.user_settings_path(Endpoint, :edit)}
|
||||
navigate={Routes.user_settings_path(Endpoint, :edit)}
|
||||
class="text-primary-600 text-white hover:underline truncate"
|
||||
>
|
||||
<%= @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 %>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.live_dashboard_path(Endpoint, :home)}
|
||||
navigate={Routes.live_dashboard_path(Endpoint, :home)}
|
||||
class="text-primary-600 text-white hover:underline"
|
||||
>
|
||||
<i class="fas fa-gauge"></i>
|
||||
@ -122,7 +122,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
<%= if Accounts.allow_registration?() do %>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.user_registration_path(Endpoint, :new)}
|
||||
navigate={Routes.user_registration_path(Endpoint, :new)}
|
||||
class="text-primary-600 text-white hover:underline truncate"
|
||||
>
|
||||
<%= dgettext("actions", "Register") %>
|
||||
@ -131,7 +131,7 @@ defmodule CanneryWeb.Components.Topbar do
|
||||
<% end %>
|
||||
<li class="mx-2 my-1">
|
||||
<.link
|
||||
patch={Routes.user_session_path(Endpoint, :new)}
|
||||
navigate={Routes.user_session_path(Endpoint, :new)}
|
||||
class="text-primary-600 text-white hover:underline truncate"
|
||||
>
|
||||
<%= dgettext("actions", "Log in") %>
|
||||
|
@ -133,7 +133,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
|
||||
{ammo_type.name,
|
||||
~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 %>
|
||||
</.link>
|
||||
"""}
|
||||
@ -202,7 +202,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
~H"""
|
||||
<div class="py-2 px-4 h-full space-x-4 flex justify-center items-center">
|
||||
<.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"
|
||||
data-qa={"view-#{@ammo_group.id}"}
|
||||
>
|
||||
@ -240,7 +240,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
~H"""
|
||||
<div class="min-w-20 py-2 px-4 h-full flex flew-wrap justify-center items-center">
|
||||
<.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"
|
||||
>
|
||||
<%= @ammo_group.container.name %>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<%= dgettext("prompts", "You'll need to") %>
|
||||
</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") %>
|
||||
</.link>
|
||||
</div>
|
||||
@ -27,7 +27,7 @@
|
||||
<%= dgettext("prompts", "You'll need to") %>
|
||||
</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") %>
|
||||
</.link>
|
||||
</div>
|
||||
|
@ -53,7 +53,7 @@
|
||||
<div class="flex flex-col justify-center items-center">
|
||||
<div class="flex flex-wrap justify-center items-center text-primary-600">
|
||||
<.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"
|
||||
data-qa="details"
|
||||
>
|
||||
|
@ -124,7 +124,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
|
||||
|
||||
~H"""
|
||||
<.link
|
||||
patch={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)}
|
||||
navigate={Routes.ammo_type_show_path(Endpoint, :show, @ammo_type)}
|
||||
class="link"
|
||||
data-qa={"view-name-#{@ammo_type.id}"}
|
||||
>
|
||||
@ -139,7 +139,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
|
||||
~H"""
|
||||
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
|
||||
<.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"
|
||||
data-qa={"view-#{@ammo_type.id}"}
|
||||
>
|
||||
|
@ -154,7 +154,10 @@ defmodule CanneryWeb.RangeLive.Index do
|
||||
:name ->
|
||||
{shot_group.ammo_group.ammo_type.name,
|
||||
~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 %>
|
||||
</.link>
|
||||
"""}
|
||||
|
@ -9,11 +9,11 @@
|
||||
<%= display_emoji("😔") %>
|
||||
</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?") %>
|
||||
</.link>
|
||||
<% 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") %>
|
||||
</.link>
|
||||
|
||||
|
@ -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?"
|
||||
|
||||
#: 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
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr "Sind sie sicher, dass sie die Schießkladde löschen möchten?"
|
||||
|
@ -193,7 +193,7 @@ msgid "Are you sure you want to unstage this ammo?"
|
||||
msgstr ""
|
||||
|
||||
#: 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
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr ""
|
||||
|
@ -212,7 +212,7 @@ msgid "Are you sure you want to unstage this ammo?"
|
||||
msgstr "Está seguro que desea desmontar esta munición?"
|
||||
|
||||
#: 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
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr ""
|
||||
|
@ -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 ?"
|
||||
|
||||
#: 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
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr "Êtes-vous certain·e de vouloir supprimer cet enregistrement de tir ?"
|
||||
|
@ -203,7 +203,7 @@ msgid "Are you sure you want to unstage this ammo?"
|
||||
msgstr ""
|
||||
|
||||
#: 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
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr ""
|
||||
|
@ -192,7 +192,7 @@ msgid "Are you sure you want to unstage this ammo?"
|
||||
msgstr ""
|
||||
|
||||
#: 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
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr ""
|
||||
|
Loading…
Reference in New Issue
Block a user