feat: unify page titles
This commit is contained in:
parent
e8ec620d57
commit
c933144920
37 changed files with 309 additions and 200 deletions
|
|
@ -29,7 +29,7 @@ defmodule MvWeb.RoleLive.Form do
|
|||
{gettext("Back")}
|
||||
</.button>
|
||||
</:leading>
|
||||
{@page_title}
|
||||
{@content_title}
|
||||
<:actions>
|
||||
<.button phx-disable-with={gettext("Saving...")} variant="primary" type="submit">
|
||||
{gettext("Save")}
|
||||
|
|
@ -94,14 +94,13 @@ defmodule MvWeb.RoleLive.Form do
|
|||
def mount(params, _session, socket) do
|
||||
case params["id"] do
|
||||
nil ->
|
||||
action = gettext("New")
|
||||
page_title = action <> " " <> gettext("Role")
|
||||
content_title = gettext("New") <> " " <> gettext("Role")
|
||||
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(:return_to, return_to(params["return_to"]))
|
||||
|> assign(:role, nil)
|
||||
|> assign(:page_title, page_title)
|
||||
|> Layouts.assign_page_title(content_title)
|
||||
|> assign_form()}
|
||||
|
||||
id ->
|
||||
|
|
@ -113,14 +112,13 @@ defmodule MvWeb.RoleLive.Form do
|
|||
actor: socket.assigns[:current_user]
|
||||
) do
|
||||
{:ok, role} ->
|
||||
action = gettext("Edit")
|
||||
page_title = action <> " " <> gettext("Role")
|
||||
content_title = gettext("Edit") <> " " <> gettext("Role")
|
||||
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(:return_to, return_to(params["return_to"]))
|
||||
|> assign(:role, role)
|
||||
|> assign(:page_title, page_title)
|
||||
|> Layouts.assign_page_title(content_title)
|
||||
|> assign_form()}
|
||||
|
||||
{:error, %Ash.Error.Invalid{errors: [%Ash.Error.Query.NotFound{} | _]}} ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue