Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 16b62a7

Browse files
committed
different approach for impersonation header
1 parent a1957d7 commit 16b62a7

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

templates/admin/base_site.html

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
{% extends "admin/base_site.html" %}
22
{% load i18n %}
33

4-
{% block branding %}
5-
<h1 id="site-name">
6-
<a href="{% url 'admin:index' %}">
7-
{% trans 'Django administration' %}
8-
<span id="impersonation-notice" style="display: none;">
9-
- Impersonating (return to codecov.io and log out)
10-
</span>
11-
</a>
12-
</h1>
13-
{% endblock %}
14-
154
{% block extrahead %}
165
{{ block.super }}
176
<style>
@@ -49,10 +38,11 @@ <h1 id="site-name">
4938
// Add class to html element for theme variables
5039
document.documentElement.classList.add('impersonation');
5140

52-
// Show the impersonation notice
53-
const impersonationNotice = document.getElementById('impersonation-notice');
54-
if (impersonationNotice) {
55-
impersonationNotice.style.display = 'inline';
41+
// Find and replace the header text
42+
const siteNameLink = document.querySelector('#site-name a');
43+
if (siteNameLink) {
44+
const originalText = siteNameLink.textContent.trim();
45+
siteNameLink.textContent = originalText + ' - Impersonating (return to codecov.io and log out)';
5646
}
5747
}
5848
});

0 commit comments

Comments
 (0)