41 lines
1.3 KiB
Elixir
41 lines
1.3 KiB
Elixir
defmodule MvWeb.UserLive.Show do
|
|
use MvWeb, :live_view
|
|
|
|
@impl true
|
|
def render(assigns) do
|
|
~H"""
|
|
<Layouts.app flash={@flash}>
|
|
<.header>
|
|
{gettext("User")} {@user.email}
|
|
<:subtitle>{gettext("This is a user record from your database.")}</:subtitle>
|
|
|
|
<:actions>
|
|
<.button navigate={~p"/users"}>
|
|
<.icon name="hero-arrow-left" />
|
|
</.button>
|
|
<.button variant="primary" navigate={~p"/users/#{@user}/edit?return_to=show"}>
|
|
<.icon name="hero-pencil-square" /> {gettext("Edit User")}
|
|
</.button>
|
|
</:actions>
|
|
</.header>
|
|
|
|
<.list>
|
|
<:item title={gettext("ID")}>{@user.id}</:item>
|
|
<:item title={gettext("Email")}>{@user.email}</:item>
|
|
<:item title={gettext("OIDC ID")}>{@user.oidc_id || gettext("Not set")}</:item>
|
|
<:item title={gettext("Password Authentication")}>
|
|
{if @user.hashed_password, do: gettext("Enabled"), else: gettext("Not enabled")}
|
|
</:item>
|
|
</.list>
|
|
</Layouts.app>
|
|
"""
|
|
end
|
|
|
|
@impl true
|
|
def mount(%{"id" => id}, _session, socket) do
|
|
{:ok,
|
|
socket
|
|
|> assign(:page_title, gettext("Show User"))
|
|
|> assign(:user, Ash.get!(Mv.Accounts.User, id, domain: Mv.Accounts))}
|
|
end
|
|
end
|