mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Repeat search pattern in form above page
This commit is contained in:
parent
a6e118f37d
commit
5a2b8cc040
@ -45,7 +45,8 @@ class SearchController extends Controller
|
|||||||
return $this->render('ChillMainBundle:Search:error.html.twig',
|
return $this->render('ChillMainBundle:Search:error.html.twig',
|
||||||
array(
|
array(
|
||||||
'message' => $this->get('translator')->trans("Your search is empty. "
|
'message' => $this->get('translator')->trans("Your search is empty. "
|
||||||
. "Please provide search terms.")
|
. "Please provide search terms."),
|
||||||
|
'pattern' => $pattern
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -64,7 +65,8 @@ class SearchController extends Controller
|
|||||||
return $this->render('ChillMainBundle:Search:error.html.twig',
|
return $this->render('ChillMainBundle:Search:error.html.twig',
|
||||||
array(
|
array(
|
||||||
"message" => $this->get('translator')->trans("The domain %domain% "
|
"message" => $this->get('translator')->trans("The domain %domain% "
|
||||||
. "is unknow. Please check your search.", array('%domain%' => $ex->getDomain()))
|
. "is unknow. Please check your search.", array('%domain%' => $ex->getDomain())),
|
||||||
|
'pattern' => $pattern
|
||||||
));
|
));
|
||||||
} catch (UnknowSearchNameException $ex) {
|
} catch (UnknowSearchNameException $ex) {
|
||||||
throw $this->createNotFoundException("The name ".$ex->getName()." is not found");
|
throw $this->createNotFoundException("The name ".$ex->getName()." is not found");
|
||||||
@ -72,13 +74,14 @@ class SearchController extends Controller
|
|||||||
return $this->render('ChillMainBundle:Search:error.html.twig',
|
return $this->render('ChillMainBundle:Search:error.html.twig',
|
||||||
array(
|
array(
|
||||||
"message" => $this->get('translator')->trans('Invalid terms').
|
"message" => $this->get('translator')->trans('Invalid terms').
|
||||||
": ".$this->get('translator')->trans($ex->getMessage())
|
": ".$this->get('translator')->trans($ex->getMessage()),
|
||||||
|
'pattern' => $pattern
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $this->render('ChillMainBundle:Search:list.html.twig',
|
return $this->render('ChillMainBundle:Search:list.html.twig',
|
||||||
array('results' => $results)
|
array('results' => $results, 'pattern' => $pattern)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#}
|
#}
|
||||||
{% extends "ChillMainBundle::layout.html.twig" %}
|
{% extends "ChillMainBundle::layout.html.twig" %}
|
||||||
|
|
||||||
|
{% set _search_pattern = pattern %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<p>{{ message }}</p>
|
<p>{{ message }}</p>
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#}
|
#}
|
||||||
{% extends "ChillMainBundle::layout.html.twig" %}
|
{% extends "ChillMainBundle::layout.html.twig" %}
|
||||||
|
|
||||||
|
{% set _search_pattern = pattern %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% for result in results %}
|
{% for result in results %}
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid-4 navigation-search">
|
<div class="grid-4 navigation-search">
|
||||||
<form action="{{ path('chill_main_search') }}" method="get">
|
<form action="{{ path('chill_main_search') }}" method="get">
|
||||||
<input name="q" type="search" placeholder="{{ 'Search'|trans }}" />
|
<input name="q" type="search" placeholder="{{ 'Search'|trans }}" {% if _search_pattern is defined %}value="{{ _search_pattern }}"{% endif %}/>
|
||||||
<button type="submit" class="sc-button white border"><i class="fa fa-search"></i></button>
|
<button type="submit" class="sc-button white border"><i class="fa fa-search"></i></button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user