diff --git a/pluginHolder/views.py b/pluginHolder/views.py index b7394562b..69a8eb741 100644 --- a/pluginHolder/views.py +++ b/pluginHolder/views.py @@ -2481,16 +2481,26 @@ def _inject_plugin_settings_back_bar(response): if 'cp-plugin-settings-back' in body: return response label = escape(str(_('Back to installed Plugins'))) + # Inside #main-content only: avoids full-viewport strip over the sidebar (baseTemplate uses + # #sidebar + #main-content { margin-left: 260px; }). back_html = ( - '
' + '
' '' '' + label + '
' ) - if re.search(r']*>', body, flags=re.IGNORECASE): + main_content_m = re.search( + r'(]*>)', + body, + flags=re.IGNORECASE, + ) + if main_content_m: + pos = main_content_m.end() + body = body[:pos] + back_html + body[pos:] + elif re.search(r']*>', body, flags=re.IGNORECASE): body = re.sub( r'(]*>)', r'\1' + back_html,