mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	Repeat search pattern in form above page
This commit is contained in:
		| @@ -45,7 +45,8 @@ class SearchController extends Controller | ||||
|             return $this->render('ChillMainBundle:Search:error.html.twig', | ||||
|                   array( | ||||
|                      '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',  | ||||
|                   array( | ||||
|                      "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) { | ||||
|             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',  | ||||
|                   array( | ||||
|                      "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',  | ||||
|               array('results' => $results)  | ||||
|               array('results' => $results, 'pattern' => $pattern)  | ||||
|               ); | ||||
|     } | ||||
|      | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
| #} | ||||
| {%  extends "ChillMainBundle::layout.html.twig" %} | ||||
|  | ||||
| {% set _search_pattern = pattern %} | ||||
|  | ||||
| {%  block content %} | ||||
|  | ||||
|     <p>{{ message }}</p> | ||||
|   | ||||
| @@ -16,6 +16,8 @@ | ||||
| #} | ||||
| {%  extends "ChillMainBundle::layout.html.twig" %} | ||||
|  | ||||
| {% set _search_pattern = pattern %} | ||||
|  | ||||
| {%  block content %} | ||||
|  | ||||
| {% for result in results %} | ||||
|   | ||||
| @@ -33,7 +33,7 @@ | ||||
|         </div> | ||||
|         <div class="grid-4 navigation-search"> | ||||
|             <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> | ||||
|             </form> | ||||
|         </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user