objects: add compact quicksearch element
This commit is contained in:
parent
7cd77c75ba
commit
4f219992d8
|
@ -1,11 +1,12 @@
|
|||
<?php if (! $this->compact): ?>
|
||||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<h1><?= $this->escape($this->title) ?></h1>
|
||||
|
||||
<h1><?= $this->escape($this->title) ?><?= $this->quickSearch ?></h1>
|
||||
<span data-base-target="_next">
|
||||
<?= $this->addLink ?>
|
||||
</span>
|
||||
<?php if (count($table) || ($this->filterEditor && ! $this->filterEditor->getFilter()->isEmpty())): ?>
|
||||
<?php if ($this->filterEditor && ! $this->filterEditor->getFilter()->isEmpty()): ?>
|
||||
<?= $this->filterEditor ?>
|
||||
<?php endif ?>
|
||||
<?= $this->table->getPaginator() ?>
|
||||
|
|
|
@ -156,6 +156,21 @@ abstract class ActionController extends Controller
|
|||
return $this->view->tabs;
|
||||
}
|
||||
|
||||
protected function provideQuickSearch()
|
||||
{
|
||||
$htm = '<form action="%s" class="quicksearch inline" method="post">'
|
||||
. '<input type="text" name="q" value="" placeholder="%s" class="search" />'
|
||||
. '</form>';
|
||||
|
||||
$this->view->quickSearch = sprintf(
|
||||
$htm,
|
||||
$this->getRequest()->getUrl()->without('q')->without('page'),
|
||||
$this->translate('Search...')
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function setViewScript($name)
|
||||
{
|
||||
$this->_helper->viewRenderer->setNoController(true);
|
||||
|
|
|
@ -184,6 +184,35 @@ input[type=text], input[type=password], textarea, select {
|
|||
}
|
||||
}
|
||||
|
||||
form.quicksearch {
|
||||
float: right;
|
||||
|
||||
input.search {
|
||||
width: 8em;
|
||||
min-width: auto;
|
||||
border: none;
|
||||
background-size: 0.75em auto;
|
||||
background-position: 0.5em 0.75em;
|
||||
padding-left: 1.5em;
|
||||
&:focus {
|
||||
width: 16em;
|
||||
.transition(width 0.5s ease);
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
h1 form.quicksearch {
|
||||
font-size: 0.75em;
|
||||
font-weight: normal;
|
||||
padding-left: 1em;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#layout.twocols h1 form.quicksearch {
|
||||
float: right;
|
||||
}
|
||||
|
||||
ul.extensible-set {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
Loading…
Reference in New Issue