mirror of
https://github.com/unraid/webgui.git
synced 2026-02-26 20:29:46 -06:00
fix: enhance layout consistency in PageBuilder.php and MainContentTabless.php
- Wrapped elements in spans within PageBuilder.php to improve layout structure. - Added a span for layout consistency in MainContentTabless.php. - This change continues the effort to enhance visual consistency across the plugin.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<div class="title">
|
||||
<? $title = processTitle($page['Title']); ?>
|
||||
<?= tab_title($title, $page['root'], _var($page, 'Tag', false)) ?>
|
||||
<span class="right inline-flex flex-row items-center gap-1"></span>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
|
||||
|
||||
@@ -82,18 +82,19 @@ function tab_title($title,$path,$tag) {
|
||||
$title = str_replace($device,_(my_disk($device),3),$title);
|
||||
}
|
||||
$title = _(parse_text($title));
|
||||
$wrapperClasses = 'left inline-flex flex-row items-center gap-1';
|
||||
if (!$tag || substr($tag,-4)=='.png') {
|
||||
$file = "$path/icons/".($tag ?: strtolower(str_replace(' ','',$title)).".png");
|
||||
if (file_exists("$docroot/$file")) {
|
||||
return "<img src='/$file' class='icon' style='max-width: 18px; max-height: 18px; width: auto; height: auto; object-fit: contain;'>$title";
|
||||
return "<span class='$wrapperClasses'><img src='/$file' class='icon' style='max-width: 18px; max-height: 18px; width: auto; height: auto; object-fit: contain;'>$title</span>";
|
||||
} else {
|
||||
return "<i class='fa fa-th title'></i>$title";
|
||||
return "<span class='$wrapperClasses'><i class='fa fa-th title'></i>$title</span>";
|
||||
}
|
||||
} elseif (substr($tag,0,5)=='icon-') {
|
||||
return "<i class='$tag title'></i>$title";
|
||||
return "<span class='$wrapperClasses'><i class='$tag title'></i>$title</span>";
|
||||
} else {
|
||||
if (substr($tag,0,3)!='fa-') $tag = "fa-$tag";
|
||||
return "<i class='fa $tag title'></i>$title";
|
||||
return "<span class='$wrapperClasses'><i class='fa $tag title'></i>$title</span>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user