mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-19 15:18:02 -04:00
Include favicon and username in search results (#736)
This commit is contained in:
committed by
Leendert de Borst
parent
55c75ec094
commit
33ebbf0fd5
@@ -44,9 +44,20 @@
|
||||
{
|
||||
var result = SearchResults[i];
|
||||
<div
|
||||
class="search-result @(i == SelectedIndex ? "bg-gray-100 dark:bg-gray-700" : "") px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700"
|
||||
class="search-result @(i == SelectedIndex ? "bg-gray-100 dark:bg-gray-700" : "") px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center"
|
||||
@onclick="() => SelectResult(result)">
|
||||
@result.Service.Name <span class="text-gray-500">(@result.Alias.Email)</span>
|
||||
<DisplayFavicon FaviconBytes="@result.Service.Logo" Width="24" />
|
||||
<div class="ml-2">
|
||||
<div>@result.Service.Name</div>
|
||||
@if (!string.IsNullOrEmpty(result.Alias.Email))
|
||||
{
|
||||
<span class="text-gray-500">(@result.Alias.Email)</span>
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(result.Username))
|
||||
{
|
||||
<span class="text-gray-500">(@result.Username)</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -122,7 +133,8 @@
|
||||
query = query.Where(x =>
|
||||
(x.Service.Name != null && EF.Functions.Like(x.Service.Name.ToLower(), $"%{term}%")) ||
|
||||
(x.Alias.Email != null && EF.Functions.Like(x.Alias.Email.ToLower(), $"%{term}%")) ||
|
||||
(x.Username != null && EF.Functions.Like(x.Username.ToLower(), $"%{term}%"))
|
||||
(x.Username != null && EF.Functions.Like(x.Username.ToLower(), $"%{term}%")) ||
|
||||
(x.Service.Url != null && EF.Functions.Like(x.Service.Url.ToLower(), $"%{term}%"))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user