KhanovaSkola / khanovaskola-v3

https://khanovaskola.cz
MIT License
2 stars 3 forks source link

ks-165 Ve vyhledávání ve hlavičce nevyplňovat předchozí hodnotu #3

Closed worldbreak closed 9 years ago

Mikulas commented 9 years ago

Opravil jsem to takhle, rovnou jsem to rebasnul nad master

commit 9dcbc95a087922c3ebba1c5cd91ee09baec972db
Author: Mikulas <rullaf@gmail.com>
Date:   Fri Feb 27 15:27:29 2015 +0100

    remove search phrase from header search on results page

diff --git a/app/presenters/Search.php b/app/presenters/Search.php
index 5557c19..fe0764a 100644
--- a/app/presenters/Search.php
+++ b/app/presenters/Search.php
@@ -23,6 +23,11 @@ final class Search extends Presenter
        $this->redirectToEntity($this->orm->contents->getById($contentId));
    }

+   public function createComponentSearchResultsForm()
+   {
+       return $this->createComponent('search');
+   }
+
    public function renderResults($query, $page = NULL, $filter = NULL)
    {
        if (!Strings::trim($query))
@@ -30,9 +35,7 @@ final class Search extends Presenter
            $this->redirect('Homepage:default');
        }

-       /** @var TextInput $input */
-       $input = $this->getComponent('search-form-query');
-       $input->setDefaultValue($query);
+       $this['searchResultsForm-form-query']->setDefaultValue($query);

        $this->template->query = $query;
        $this->template->filter = $filter;
diff --git a/app/templates/views/Search/results.latte b/app/templates/views/Search/results.latte
index 34efa75..b3ca57d 100644
--- a/app/templates/views/Search/results.latte
+++ b/app/templates/views/Search/results.latte
@@ -11,7 +11,7 @@
         <main class="content">
             <div class="content-inner">
                 <section class="search-form">
-                    {control search, label => 'Hledáte'}
+                    {control searchResultsForm, label => 'Hledáte'}
                     <ul n:if="$search->results" class="list-unstyled result-count">
                         Nalezeno: {foreach $search->aggregations as $ag}{*
                             *}<a n:href="this, filter => $ag['key']">{*