Use inline styles for cPanel navbar to avoid Jupiter CSS conflicts

cPanel's Jupiter theme overrides DaisyUI's .navbar component class.
Replace with plain flex layout using inline styles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-05 19:33:56 +02:00
parent e7bf2e11e2
commit 5ffd365c43

View File

@@ -13,6 +13,7 @@ my $_logo_data_uri = '';
my @NAV_ITEMS = (
{ url => 'index.live.cgi', label => 'Select Source' },
{ url => 'restore.live.cgi', label => 'Restore' },
{ url => 'logs.live.cgi', label => 'Logs' },
);
# ── HTML Escaping ─────────────────────────────────────────────
@@ -34,34 +35,26 @@ sub render_nav {
my ($current_page) = @_;
my $logo = '';
if ($_logo_data_uri) {
$logo = qq{<div class="flex items-center gap-2">}
. qq{<img src="$_logo_data_uri" alt="" class="h-12 w-auto">}
. qq{<span class="text-3xl font-bold leading-none">GNIZA <span class="text-secondary">Backup</span></span>}
. qq{</div>};
$logo = qq{<img src="$_logo_data_uri" alt="" style="height:3rem;width:auto">}
. qq{<span class="text-3xl font-bold leading-none">GNIZA <span class="text-secondary">Backup</span></span>};
}
my $menu_items = '';
for my $item (@NAV_ITEMS) {
my $active = ($item->{url} eq $current_page) ? ' active' : '';
my $is_active = ($item->{url} eq $current_page);
my $label = esc($item->{label});
$menu_items .= qq{<li><a class="no-underline$active" href="$item->{url}">$label</a></li>\n};
my $style = $is_active
? 'style="font-weight:600;color:inherit"'
: 'style="color:inherit;opacity:0.7"';
$menu_items .= qq{<a class="no-underline" href="$item->{url}" $style>$label</a>\n};
}
my $html = qq{<div class="navbar bg-base-200 rounded-box mb-5">\n};
$html .= qq{ <div class="navbar-start">\n};
# Use inline styles to avoid cPanel Jupiter CSS conflicts with DaisyUI navbar
my $html = qq{<div class="bg-base-200 rounded-box mb-5" style="display:flex;align-items:center;justify-content:space-between;padding:0.5rem 1rem;min-height:4rem">\n};
$html .= qq{ <div style="display:flex;align-items:center;gap:0.5rem">\n};
$html .= qq{ $logo\n} if $logo;
$html .= qq{ </div>\n};
$html .= qq{ <div class="navbar-end hidden lg:flex">\n};
$html .= qq{ <ul class="menu menu-horizontal gap-1">\n};
$html .= qq{ $menu_items};
$html .= qq{ </ul>\n};
$html .= qq{ </div>\n};
$html .= qq{ <div class="navbar-end lg:hidden">\n};
$html .= qq{ <details class="dropdown dropdown-end">\n};
$html .= qq{ <summary class="btn btn-ghost btn-sm"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /></svg></summary>\n};
$html .= qq{ <ul class="dropdown-content menu bg-base-200 rounded-box shadow-sm mt-2 w-52 p-2">\n};
$html .= qq{ $menu_items};
$html .= qq{ </ul>\n};
$html .= qq{ </details>\n};
$html .= qq{ <div style="display:flex;align-items:center;gap:1.5rem;font-size:0.95rem">\n};
$html .= qq{ $menu_items};
$html .= qq{ </div>\n};
$html .= qq{</div>\n};
return $html;