Search: split result and search hint

There was an ugly if/else in the view script, this patch creates two
of them and adds friendlier search suggestions.
This commit is contained in:
Thomas Gelf 2014-05-28 11:13:41 +00:00
parent 92f454c36d
commit f7c5119424
3 changed files with 20 additions and 7 deletions

View File

@ -16,7 +16,14 @@ class SearchController extends ActionController
$this->setAutorefreshInterval(10);
$search = $this->_request->getParam('q');
if (! $search) {
$this->view->hint = $this->translate('Ready to search, waiting for your input');
$this->view->tabs = Widget::create('tabs')->add(
'search',
array(
'title' => $this->translate('Search'),
'url' => '/search',
)
)->activate('search');
$this->render('hint');
return;
}
$dashboard = Widget::create('dashboard')->createPane($this->translate('Search'));

View File

@ -0,0 +1,12 @@
<div class="controls">
<?= $this->tabs ?>
</div>
<div class="content">
<h1><?= $this->translate("I'm ready to search, waiting for your input") ?></h1>
<p><strong><?= $this->translate('Hint') ?>: </strong><?= $this->translate(
'Please use the asterisk (*) as a placeholder for wildcard searches.'
. " For convenience I'll always add a wildcard after the last character"
. ' you typed.'
) ?></p>
</div>

View File

@ -2,12 +2,6 @@
<?= $this->tabs ?>
</div>
<?php if ($this->dashboard): ?>
<div class="content dashboard">
<?= $this->dashboard ?>
</div>
<?php else: ?>
<div class="content">
<strong><?= $this->hint ?></strong>
</div>
<?php endif ?>