From 6755d75e2c2f8c1bbf302ea400a4e34bc7ae5280 Mon Sep 17 00:00:00 2001 From: master3395 Date: Fri, 27 Mar 2026 23:59:00 +0100 Subject: [PATCH] plugins: place settings back-link inside #main-content Avoid full-width bar over sidebar; rounded card-style bar; fallback after if template has no main-content. --- pluginHolder/views.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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 = ( - '
' + '' ) - 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,