From b43e8c4a61a485f558afe9c099a9d44eb7144b58 Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Thu, 21 Mar 2024 15:25:40 +0800 Subject: [PATCH] feat: add fragment redirect for web home --- .../templates/components/sidebar.html | 21 +++++++++++ admin_frontend/templates/oc | 0 admin_frontend/templates/pages/login.html | 36 ++++++++++++++----- src/biz/workspace/ops.rs | 2 +- 4 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 admin_frontend/templates/oc diff --git a/admin_frontend/templates/components/sidebar.html b/admin_frontend/templates/components/sidebar.html index 2141bf71..2500d469 100644 --- a/admin_frontend/templates/components/sidebar.html +++ b/admin_frontend/templates/components/sidebar.html @@ -3,6 +3,7 @@ class="sidebar-item" hx-target="#sidebar-content" hx-get="/web/components/user/navigate" + data-section="navigate" > Navigate @@ -10,6 +11,7 @@ class="sidebar-item" hx-target="#sidebar-content" hx-get="/web/components/user/change-password" + data-section="change-password" > Change Password @@ -17,6 +19,7 @@ class="sidebar-item" hx-target="#sidebar-content" hx-get="/web/components/user/invite" + data-section="invite" > Invite @@ -24,6 +27,7 @@ class="sidebar-item" hx-target="#sidebar-content" hx-get="/web/components/user/user-usage" + data-section="user-usage" > User Usage @@ -31,7 +35,24 @@ class="sidebar-item" hx-target="#sidebar-content" hx-get="/web/components/user/workspace-usage" + data-section="workspace-usage" > Workspace Usage + + diff --git a/admin_frontend/templates/oc b/admin_frontend/templates/oc new file mode 100644 index 00000000..e69de29b diff --git a/admin_frontend/templates/pages/login.html b/admin_frontend/templates/pages/login.html index b52e011d..ad33401a 100644 --- a/admin_frontend/templates/pages/login.html +++ b/admin_frontend/templates/pages/login.html @@ -109,24 +109,44 @@ {% endblock %} diff --git a/src/biz/workspace/ops.rs b/src/biz/workspace/ops.rs index cf83346c..92dcd4d0 100644 --- a/src/biz/workspace/ops.rs +++ b/src/biz/workspace/ops.rs @@ -181,7 +181,7 @@ pub async fn invite_workspace_members( email: invitation.email.clone(), ..Default::default() }, - Some("/web/home#invite".to_owned()), + Some("/web/home#redirect_to=invite".to_owned()), ) .await?;