From d8bbb2884dad6ff9832596ddad551d605a5d0f5b Mon Sep 17 00:00:00 2001 From: Jeremy Childers Date: Tue, 18 Aug 2026 16:54:37 -0400 Subject: [PATCH 1/6] Story 2584: Webpage Integration Account Connection Card --- config/urls.py | 6 ++ .../includes/_account_connections_card.html | 21 ++++-- templates/v3/includes/_dialog.html | 9 ++- templates/v3/user_profile_edit.html | 2 +- users/models.py | 9 +++ users/views.py | 75 ++++++++++++++----- 6 files changed, 95 insertions(+), 27 deletions(-) diff --git a/config/urls.py b/config/urls.py index 627dfa04c..2cd028e4c 100644 --- a/config/urls.py +++ b/config/urls.py @@ -75,6 +75,7 @@ DeleteUserView, CancelDeletionView, DeleteImmediatelyView, + DisconnectSocialAccountView, ) from versions.api import ImportVersionsView, VersionViewSet from versions.converters import BoostVersionSlugConverter @@ -153,6 +154,11 @@ path("accounts/", include("allauth.urls")), path("users/me/", CurrentUserProfileView.as_view(), name="profile-account"), path("users/me/delete/", DeleteUserView.as_view(), name="profile-delete"), + path( + "users/me/disconnect-social//", + DisconnectSocialAccountView.as_view(), + name="profile-disconnect-social", + ), path( "users/me/cancel-delete/", CancelDeletionView.as_view(), diff --git a/templates/v3/includes/_account_connections_card.html b/templates/v3/includes/_account_connections_card.html index e538e73c2..6e0ee1529 100644 --- a/templates/v3/includes/_account_connections_card.html +++ b/templates/v3/includes/_account_connections_card.html @@ -5,12 +5,13 @@ Variables: heading (str, optional) — card heading, default "Account connections" connections (list of dict) — connection items, each with: - .platform (str) — icon key: "github" or "google" - .label (str) — display name, e.g. "GitHub" - .connected (bool) — whether the account is linked - .status_text (str) — status label, e.g. "Connected" or "Not connected" - .action_label (str) — button text, e.g. "Manage" or "Connect" - .action_url (str) — button destination URL + .platform (str) — icon key: "github" or "google" + .label (str) — display name, e.g. "GitHub" + .connected (bool) — whether the account is linked + .status_text (str) — status label, e.g. "Connected" or "Not connected" + .action_label (str) — button text, e.g. "Manage" or "Connect" + .action_url (str) — button destination URL + .disconnect_text (str) — text displayed in the disconnect modal Usage: {% include "v3/includes/_account_connections_card.html" with heading="Account connections" connections=account_connections %} @@ -34,3 +35,11 @@ {% endfor %} + +{% for conn in connections %} + {% url 'profile-disconnect-social' platform=conn.platform as disconnect_url %} +
+ {% csrf_token %} + {% include 'v3/includes/_dialog.html' with dialog_id="disconnect-"|add:conn.platform title="Disconnect "|add:conn.label|add:" ?" description=conn.disconnect_text primary_style="error" primary_label="Disconnect" secondary_label="Cancel" submit=True only %} +
+{% endfor %} diff --git a/templates/v3/includes/_dialog.html b/templates/v3/includes/_dialog.html index 89e6a0d33..0137620ca 100644 --- a/templates/v3/includes/_dialog.html +++ b/templates/v3/includes/_dialog.html @@ -15,6 +15,7 @@ secondary_style (optional): Button style for secondary action. Default "primary". primary_url (optional): URL for primary button. Defaults to "" (renders as