fix: show maintainance and impersonate on primary nav

This commit is contained in:
Ejaaz Khan 2026-01-25 18:08:33 +05:30
parent 7edf1cfb7b
commit cfe8841d23
4 changed files with 12 additions and 21 deletions

View file

@ -37,7 +37,6 @@ frappe.ui.form.Sidebar = class {
this.setup_keyboard_shortcuts();
this.show_auto_repeat_status();
frappe.ui.form.setup_user_image_event(this.frm);
this.indicator = $(this.sidebar).find(".sidebar-meta-details .indicator-pill");
this.setup_copy_event();
this.make_like();
this.setup_print();

View file

@ -72,6 +72,17 @@
</div>
<button class="btn btn-primary btn-sm hide primary-action"></button>
</div>
{% if (frappe.boot.read_only) { %}
<span class="ml-3 indicator-pill yellow no-indicator-dot read-only-banner" title="{%= __(" Your site is undergoing
maintenance or being updated.") %}">
{%= __("Read Only Mode") %}
</span>
{% } %}
{% if (frappe.boot.user.impersonated_by) { %}
<span class="ml-3 indicator-pill red no-indicator-dot" title="{%= __(" You are impersonating as another user.") %}">
{%= __("Impersonating {0}", [frappe.boot.user.name]) %}
</span>
{% } %}
</div>
</div>
</div>

View file

@ -145,7 +145,7 @@ frappe.ui.Page = class Page {
this.container = this.wrapper.find(".page-body");
this.sidebar = this.wrapper.find(".layout-side-section");
this.footer = this.wrapper.find(".layout-footer");
this.indicator = this.wrapper.find(".indicator-pill");
this.indicator = this.wrapper.find(".title-area .indicator-pill");
this.page_actions = this.wrapper.find(".page-actions");
this.filters = this.wrapper.find(".filters");

View file

@ -1,23 +1,4 @@
<div class="sticky-top">
{% if (frappe.boot.read_only || frappe.boot.user.impersonated_by) { %}
<header class="navbar navbar-expand" role="navigation">
<div class="container">
<div class="collapse navbar-collapse justify-content-end">
{% if (frappe.boot.read_only) { %}
<span class="indicator-pill yellow no-indicator-dot read-only-banner" title="{%= __("Your site is undergoing maintenance or being updated.") %}">
{%= __("Read Only Mode") %}
</span>
{% } %}
{% if (frappe.boot.user.impersonated_by) { %}
<span class="indicator-pill red no-indicator-dot" title="{%= __("You are impersonating as another user.") %}">
{%= __("Impersonating {0}", [frappe.boot.user.name]) %}
</span>
{% } %}
</div>
</div>
</header>
{% endif %}
{% if !localStorage.getItem("dismissed_announcement_widget") && strip_html(navbar_settings.announcement_widget) != '' %}
<div class="announcement-widget form-message p-2 m-0" style="position: relative; z-index: -1; border-radius: 0; background-color: var(--bg-blue);">
<div class="container flex justify-between align-center mx-auto">