diff --git a/lib/towerops_web/live/user_settings_live.ex b/lib/towerops_web/live/user_settings_live.ex index b73dbc03..75ebd6fb 100644 --- a/lib/towerops_web/live/user_settings_live.ex +++ b/lib/towerops_web/live/user_settings_live.ex @@ -14,6 +14,7 @@ defmodule ToweropsWeb.UserSettingsLive do socket = socket |> assign(:page_title, "Account Settings") + |> assign(:active_tab, "personal") |> assign_changesets() |> assign_profile_form() |> assign_credentials() @@ -27,6 +28,11 @@ defmodule ToweropsWeb.UserSettingsLive do {:ok, socket} end + @impl true + def handle_event("switch_tab", %{"tab" => tab}, socket) do + {:noreply, assign(socket, :active_tab, tab)} + end + @impl true def handle_event("update_profile", %{"user" => user_params}, socket) do user = socket.assigns.current_scope.user @@ -240,303 +246,438 @@ defmodule ToweropsWeb.UserSettingsLive do
+- Update your name, avatar, and timezone preferences. -
-+ Update your name, avatar, and timezone preferences. +
+- Enter a URL to an avatar image or use a service like Gravatar. -
-- Update your email address. You'll receive a confirmation link to verify the new address. -
-- Update your password. You'll be logged out and need to sign in again with your new password. -
-- Create API tokens to access Towerops programmatically. Tokens are scoped to a specific organization. -
++ Update your email address. You'll receive a confirmation link to verify the new address. +
+- Get started by creating a new API token. -
-+ Update your password. You'll be logged out and need to sign in again with your new password. +
++ Create API tokens to access Towerops programmatically. Tokens are scoped to a specific organization. +
++ Get started by creating a new API token. +
++ {token.name} +
+{token.organization.name}
++ <%= if token.last_used_at do %> + Last used {Calendar.strftime(token.last_used_at, "%B %d, %Y")} + <% else %> + Never used + <% end %> +
+- {token.name} -
-{token.organization.name}
-- <%= if token.last_used_at do %> - Last used {Calendar.strftime(token.last_used_at, "%B %d, %Y")} - <% else %> - Never used - <% end %> -
-- Manage mobile devices that receive push notifications for alerts. -
-+ Manage mobile devices that receive push notifications for alerts. +
+- Add a mobile device to receive push notifications for alerts. -
-+ Add a mobile device to receive push notifications for alerts. +
++ {session.device_name || "Unknown Device"} +
+ <%= if session.alerts_enabled do %> + + <.icon name="hero-bell" class="h-3 w-3" /> Alerts On + + <% else %> + + <.icon name="hero-bell-slash" class="h-3 w-3" /> Alerts Off + + <% end %> +{session.device_os} • {session.app_version}
+Last used {Calendar.strftime(session.last_used_at, "%B %d, %Y")}
+- {session.device_name || "Unknown Device"} -
- <%= if session.alerts_enabled do %> - - <.icon name="hero-bell" class="h-3 w-3" /> Alerts On - - <% else %> - - <.icon name="hero-bell-slash" class="h-3 w-3" /> Alerts Off - - <% end %> -{session.device_os} • {session.app_version}
-Last used {Calendar.strftime(session.last_used_at, "%B %d, %Y")}
-- Use your device's biometrics (Face ID, Touch ID, Windows Hello) or security keys to sign in. -
-+ Use your device's biometrics (Face ID, Touch ID, Windows Hello) or security keys to sign in. +
+- Please confirm your email address before registering a passkey. Check your inbox for the confirmation link. -
-+ Please confirm your email address before registering a passkey. Check your inbox for the confirmation link. +
++ Add a passkey to enable quick, secure sign-in with biometrics. +
+ <%= if @can_register_passkey do %> ++ {credential.name} +
+- Add a passkey to enable quick, secure sign-in with biometrics. -
<%= if @can_register_passkey do %> -- {credential.name} -
-