chg: [instance:search_all] Added support of no results

pull/72/head
mokaddem 2021-09-10 14:22:28 +02:00
parent 1d541ff214
commit 464e6c6951
3 changed files with 19 additions and 18 deletions

View File

@ -24,4 +24,8 @@
$sections[] = $section;
}
echo implode('', $sections);
if (!empty($sections)) {
echo implode('', $sections);
} else {
echo sprintf('<span class="dropdown-item p-0 pb-1 text-center">%s</span>', __('- No result -'));
}

View File

@ -6,7 +6,6 @@
</span>
<button type="button" class="dropdown-toggle d-none" id="dropdownMenuSearchAll" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-reference="parent"></button>
<div class="global-search-result-container dropdown-menu dropdown-menu-right p-0 pt-2" aria-labelledby="dropdownMenuSearchAll">
<?= __('- No result -') ?>
</div>
</div>
<div class="header-menu d-flex ml-1">
@ -14,19 +13,3 @@
<?= $this->element('layouts/header/header-profile') ?>
</div>
</div>
<style>
.top-navbar .global-search-container {
position: relative;
}
#globalSearch {
padding-right: 26px;
}
.top-navbar .global-search-container .search-input-container > i.icon {
position: absolute;
right: 8px;
line-height: 38px;
}
</style>

View File

@ -154,6 +154,20 @@ main.content {
flex: 1 0 auto
}
.top-navbar .global-search-container {
position: relative;
}
.global-search-container #globalSearch {
padding-right: 26px;
}
.top-navbar .global-search-container .search-input-container > i.icon {
position: absolute;
right: 8px;
line-height: 38px;
}
.right-navbar div.header-menu a.nav-link {
margin: auto 0;
}