feat: unify page titles
This commit is contained in:
parent
e8ec620d57
commit
c933144920
37 changed files with 309 additions and 200 deletions
|
|
@ -59,7 +59,7 @@ defmodule MvWeb.UserLive.Form do
|
|||
{gettext("Back")}
|
||||
</.button>
|
||||
</:leading>
|
||||
{@page_title}
|
||||
{@content_title}
|
||||
<:actions>
|
||||
<.button
|
||||
form="user-form"
|
||||
|
|
@ -423,8 +423,9 @@ defmodule MvWeb.UserLive.Form do
|
|||
|
||||
defp mount_continue(user, params, socket) do
|
||||
actor = current_actor(socket)
|
||||
action = if is_nil(user), do: gettext("New"), else: gettext("Edit")
|
||||
page_title = action <> " " <> gettext("User")
|
||||
|
||||
content_title =
|
||||
if(is_nil(user), do: gettext("New"), else: gettext("Edit")) <> " " <> gettext("User")
|
||||
|
||||
# Only admins can link/unlink users to members (permission docs; prevents privilege escalation).
|
||||
can_manage_member_linking = can?(actor, :destroy, UserResource)
|
||||
|
|
@ -436,7 +437,7 @@ defmodule MvWeb.UserLive.Form do
|
|||
socket
|
||||
|> assign(:return_to, return_to(params["return_to"]))
|
||||
|> assign(user: user)
|
||||
|> assign(:page_title, page_title)
|
||||
|> Layouts.assign_page_title(content_title)
|
||||
|> assign(:can_manage_member_linking, can_manage_member_linking)
|
||||
|> assign(:can_assign_role, can_assign_role)
|
||||
|> assign(:roles, roles)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue