upgrade to phoenix 1.7
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -60,11 +60,11 @@ defmodule MemexWeb.ContextLive.Index do
|
||||
end
|
||||
|
||||
def handle_event("search", %{"search" => %{"search_term" => ""}}, socket) do
|
||||
{:noreply, socket |> push_patch(to: Routes.context_index_path(Endpoint, :index))}
|
||||
{:noreply, socket |> push_patch(to: ~p"/contexts")}
|
||||
end
|
||||
|
||||
def handle_event("search", %{"search" => %{"search_term" => search_term}}, socket) do
|
||||
redirect_to = Routes.context_index_path(Endpoint, :search, search_term)
|
||||
redirect_to = ~p"/contexts/#{search_term}"
|
||||
{:noreply, socket |> push_patch(to: redirect_to)}
|
||||
end
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
<:actions :let={context}>
|
||||
<.link
|
||||
:if={Contexts.is_owner?(context, @current_user)}
|
||||
patch={Routes.context_index_path(@socket, :edit, context.slug)}
|
||||
patch={~p"/contexts/#{context}/edit"}
|
||||
aria-label={dgettext("actions", "edit %{context_slug}", context_slug: context.slug)}
|
||||
>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
@ -53,16 +53,12 @@
|
||||
</.live_component>
|
||||
<% end %>
|
||||
|
||||
<.link
|
||||
:if={@current_user}
|
||||
patch={Routes.context_index_path(@socket, :new)}
|
||||
class="self-end btn btn-primary"
|
||||
>
|
||||
<.link :if={@current_user} patch={~p"/contexts/new"} class="self-end btn btn-primary">
|
||||
<%= dgettext("actions", "new context") %>
|
||||
</.link>
|
||||
</div>
|
||||
|
||||
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.context_index_path(@socket, :index)}>
|
||||
<.modal :if={@live_action in [:new, :edit]} return_to={~p"/contexts"}>
|
||||
<.live_component
|
||||
module={MemexWeb.ContextLive.FormComponent}
|
||||
id={@context.id || :new}
|
||||
@ -70,6 +66,6 @@
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
context={@context}
|
||||
return_to={Routes.context_index_path(@socket, :index)}
|
||||
return_to={~p"/contexts"}
|
||||
/>
|
||||
</.modal>
|
||||
|
@ -38,7 +38,7 @@ defmodule MemexWeb.ContextLive.Show do
|
||||
socket =
|
||||
socket
|
||||
|> put_flash(:info, gettext("%{slug} deleted", slug: slug))
|
||||
|> push_navigate(to: Routes.context_index_path(Endpoint, :index))
|
||||
|> push_navigate(to: ~p"/contexts")
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
@ -4,11 +4,7 @@
|
||||
</h1>
|
||||
|
||||
<div class="flex flex-wrap space-x-1">
|
||||
<.link
|
||||
:for={tag <- @context.tags}
|
||||
navigate={Routes.context_index_path(Endpoint, :search, tag)}
|
||||
class="link"
|
||||
>
|
||||
<.link :for={tag <- @context.tags} navigate={~p"/contexts/#{tag}"} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
</div>
|
||||
@ -23,7 +19,7 @@
|
||||
<.link
|
||||
:if={Contexts.is_owner?(@context, @current_user)}
|
||||
class="btn btn-primary"
|
||||
patch={Routes.context_show_path(@socket, :edit, @context.slug)}
|
||||
patch={~p"/context/#{@context}/edit"}
|
||||
>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
</.link>
|
||||
@ -40,10 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<.modal
|
||||
:if={@live_action == :edit}
|
||||
return_to={Routes.context_show_path(@socket, :show, @context.slug)}
|
||||
>
|
||||
<.modal :if={@live_action == :edit} return_to={~p"/context/#{@context}"}>
|
||||
<.live_component
|
||||
module={MemexWeb.ContextLive.FormComponent}
|
||||
id={@context.id}
|
||||
@ -51,6 +44,6 @@
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
context={@context}
|
||||
return_to={Routes.context_show_path(@socket, :show, @context.slug)}
|
||||
return_to={~p"/context/#{@context}"}
|
||||
/>
|
||||
</.modal>
|
||||
|
Reference in New Issue
Block a user