From 335addab5af3193086c3fc0e95b1da20f4db88e2 Mon Sep 17 00:00:00 2001 From: Inverle Date: Mon, 1 Sep 2025 23:45:54 +0200 Subject: CSS fixes for Swage (#7608) - Fixes for Swage - Buttons not showing correctly #7465 - Dropdown placement (some dropdowns couldn't fit in viewport) - Icons not appearing in some places due to color i.e. label management and subscription management page - Made `.form-group` and button inside search dropdown hover colors slightly darker, for better visibility - Nav menu style improvements on mobile - Smaller if not on main page - Align settings icon on configuration pages to the right - Support nav menu for feed statistics page - Text alignment in search dropdown - Ensure `input, select, textarea` don't overflow the page - Login link placement in anonymous view - Other fixes for - Add via bookmarklet page - About page - Shared HTML query page - Register page - Text visibility for debug log - Provide classes `layout.phtml` within ``: - `logged_in` if applicable - `controller_$NAME` if applicable - `file_$NAME` if applicable - Some other fixes --------- Co-authored-by: Alexandre Alapetite Co-authored-by: maTh <1645099+math-GH@users.noreply.github.com> --- app/layout/layout.phtml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 5e8b841ce..fc6675a40 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -2,19 +2,30 @@ declare(strict_types=1); /** @var FreshRSS_View $this */ FreshRSS::preLayout(); - $class = ''; + $class = []; + if (Minz_Request::controllerName() !== '') { + $class[] = 'controller_' . Minz_Request::controllerName(); + } else { + $class[] = 'file_' . pathinfo(is_string($_SERVER['SCRIPT_NAME'] ?? null) ? $_SERVER['SCRIPT_NAME'] : '', PATHINFO_FILENAME); + } $dir = ''; if (_t('gen.dir') === 'rtl') { $dir = ' dir="rtl"'; - $class = 'rtl '; + $class[] = 'rtl'; } - $class .= 'theme_' . FreshRSS_Context::userConf()->theme; + $class[] = 'theme_' . FreshRSS_Context::userConf()->theme; if (FreshRSS_Context::userConf()->darkMode !== 'no') { - $class .= ' darkMode_' . FreshRSS_Context::userConf()->darkMode; + $class[] = 'darkMode_' . FreshRSS_Context::userConf()->darkMode; + } + if (FreshRSS_Auth::hasAccess()) { + $class[] = 'logged_in'; } + $class = array_map( + fn($c) => preg_replace('/\s/', '', $c), $class + ); ?> - xml:lang="language ?>" class=""> + xml:lang="language ?>" class=""> -- cgit v1.2.3