mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 15:24:05 +02:00
Replace search icon png with fontawesome icon
This commit is contained in:
parent
0eea5cae51
commit
aa7a60c893
@ -8,6 +8,7 @@ $searchDashboard->setUser($this->Auth()->getUser());
|
|||||||
|
|
||||||
if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?>
|
if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?>
|
||||||
<form action="<?= $this->href('search') ?>" method="get" role="search" class="search-control">
|
<form action="<?= $this->href('search') ?>" method="get" role="search" class="search-control">
|
||||||
|
<i class="icon fa-search fa search-icon"></i>
|
||||||
<input type="text" name="q" id="search" class="search search-input" required
|
<input type="text" name="q" id="search" class="search search-input" required
|
||||||
placeholder="<?= $this->translate('Search') ?> …"
|
placeholder="<?= $this->translate('Search') ?> …"
|
||||||
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
|
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
|
|
||||||
namespace Icinga\Web\Widget;
|
namespace Icinga\Web\Widget;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Icinga\Application\Icinga;
|
||||||
|
use Icinga\Data\Filter\Filter;
|
||||||
|
use Icinga\Data\Filter\FilterChain;
|
||||||
|
use Icinga\Data\Filter\FilterExpression;
|
||||||
|
use Icinga\Data\Filter\FilterOr;
|
||||||
use Icinga\Data\Filterable;
|
use Icinga\Data\Filterable;
|
||||||
use Icinga\Data\FilterColumns;
|
use Icinga\Data\FilterColumns;
|
||||||
use Icinga\Data\Filter\Filter;
|
|
||||||
use Icinga\Data\Filter\FilterExpression;
|
|
||||||
use Icinga\Data\Filter\FilterChain;
|
|
||||||
use Icinga\Data\Filter\FilterOr;
|
|
||||||
use Icinga\Web\Url;
|
|
||||||
use Icinga\Application\Icinga;
|
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Web\Notification;
|
use Icinga\Web\Notification;
|
||||||
use Exception;
|
use Icinga\Web\Url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter
|
* Filter
|
||||||
@ -738,7 +738,8 @@ class FilterEditor extends AbstractWidget
|
|||||||
|
|
||||||
$html = ' <form method="post" class="search inline" action="'
|
$html = ' <form method="post" class="search inline" action="'
|
||||||
. $preservedUrl
|
. $preservedUrl
|
||||||
. '"><input type="text" name="q" class="search search-input" value="" placeholder="'
|
. '"><i class="icon fa-search fa search-icon"></i>'
|
||||||
|
. '<input type="text" name="q" class="search search-input" value="" placeholder="'
|
||||||
. t('Search...')
|
. t('Search...')
|
||||||
. '" /></form>';
|
. '" /></form>';
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ use ipl\Html\FormElement\InputElement;
|
|||||||
use ipl\Html\HtmlElement;
|
use ipl\Html\HtmlElement;
|
||||||
use ipl\Web\Control\SearchBar\Suggestions;
|
use ipl\Web\Control\SearchBar\Suggestions;
|
||||||
use ipl\Web\Url;
|
use ipl\Web\Url;
|
||||||
|
use ipl\Web\Widget\Icon;
|
||||||
|
|
||||||
class SingleValueSearchControl extends Form
|
class SingleValueSearchControl extends Form
|
||||||
{
|
{
|
||||||
@ -106,6 +107,8 @@ class SingleValueSearchControl extends Form
|
|||||||
{
|
{
|
||||||
$suggestionsId = Icinga::app()->getRequest()->protectId('single-value-suggestions');
|
$suggestionsId = Icinga::app()->getRequest()->protectId('single-value-suggestions');
|
||||||
|
|
||||||
|
$this->addHtml(new Icon('search', Attributes::create(['class' => 'search-icon'])));
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
$this->searchParameter,
|
$this->searchParameter,
|
||||||
|
@ -21,35 +21,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form > .search-icon {
|
||||||
|
position: absolute;
|
||||||
|
left: 0.25em;
|
||||||
|
top: ~"calc(50% - 0.5em)";
|
||||||
|
pointer-events: none;
|
||||||
|
color: @menu-color;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
form:has(> .search-icon) {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.controls input.search,
|
.controls input.search,
|
||||||
input.search {
|
input.search {
|
||||||
.transition(border 0.3s ease);
|
.transition(border 0.3s ease);
|
||||||
.transition(background-image 0.2s ease);
|
|
||||||
|
|
||||||
background-image: url(../img/icons/search_white.png);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 1em 1em;
|
|
||||||
background-position: .25em center;
|
|
||||||
outline: none;
|
outline: none;
|
||||||
padding-left: 1.5em;
|
padding-left: 1.5em;
|
||||||
width: 20em;
|
width: 20em;
|
||||||
|
|
||||||
&:focus {
|
|
||||||
background-image: url(../img/icons/search_icinga_blue.png);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus:not([readonly]) {
|
&:focus:not([readonly]) {
|
||||||
border-color: @icinga-blue;
|
border-color: @icinga-blue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@light-mode: {
|
form:has(input.search:focus) > .search-icon {
|
||||||
#menu input.search,
|
color: @icinga-blue;
|
||||||
.controls input.search,
|
|
||||||
input.search {
|
|
||||||
background-image: url(../img/icons/search.png);
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
.backend-selection,
|
.backend-selection,
|
||||||
.pagination-control,
|
.pagination-control,
|
||||||
|
@ -210,9 +210,12 @@
|
|||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#menu .search-icon {
|
||||||
|
left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
#menu input.search {
|
#menu input.search {
|
||||||
background: transparent url('../img/icons/search_white.png') no-repeat 1em center;
|
background-color: @menu-bg-color;
|
||||||
background-size: 1em auto;
|
|
||||||
border: none;
|
border: none;
|
||||||
color: @menu-color;
|
color: @menu-color;
|
||||||
line-height: 2.167em;
|
line-height: 2.167em;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user