From b622bf90669730aac7e36b6025108a93b2b40339 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 12 Jun 2025 16:33:13 +0200 Subject: [PATCH 1/2] Add links to impersonate under "Debug" modal --- .../templates/projects/partials/header.html | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/readthedocsext/theme/templates/projects/partials/header.html b/readthedocsext/theme/templates/projects/partials/header.html index 9f0c1bf6..940f743b 100644 --- a/readthedocsext/theme/templates/projects/partials/header.html +++ b/readthedocsext/theme/templates/projects/partials/header.html @@ -1,5 +1,5 @@ {% load blocktrans trans from i18n %} -{% load is_admin from privacy_tags %} +{% load is_admin admins from privacy_tags %} {% load gravatar_url from gravatar %} {% load get_spam_score readthedocs_language_name readthedocs_language_name_local from ext_theme_tags %} @@ -201,6 +201,28 @@ and also know what rules are matching this project. {% endcomment %}
+

{% trans "Impersonate" %}

+
{% trans "Project maintainer" %}
+
+ {% for user in project|admins %} + + {% endfor %} + +
+ + {% if USE_ORGANIZATIONS %} +
{% trans "Organization owner" %}
+
+ {% for owner in organization|admins %} + + {% endfor %} +
+ {% endif %} + {% if not USE_ORGANIZATIONS %}

{% trans "Spam" %}

{% trans "Spam score" %}
From c84d1a29c2eea575506ac59052a745e20814425e Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 16 Jun 2025 11:41:34 +0200 Subject: [PATCH 2/2] Wrap the modal inside `is_staff` condition --- .../templates/projects/partials/header.html | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/readthedocsext/theme/templates/projects/partials/header.html b/readthedocsext/theme/templates/projects/partials/header.html index 940f743b..82f680fe 100644 --- a/readthedocsext/theme/templates/projects/partials/header.html +++ b/readthedocsext/theme/templates/projects/partials/header.html @@ -193,57 +193,59 @@
-