commit 7e4531239dd8722817f1385f74ffe5e6c30e1387
Author: Petr Lukašík <lukasik@rtsoft.cz>
Date:   Wed Jun 12 20:10:23 2019 +0200

    Re #7618 opravy požadavků

diff --git a/app/FrontModule/component/Catalogue/CatalogueSearchForm.latte b/app/FrontModule/component/Catalogue/CatalogueSearchForm.latte
index fcefbec..afe6ba5 100644
--- a/app/FrontModule/component/Catalogue/CatalogueSearchForm.latte
+++ b/app/FrontModule/component/Catalogue/CatalogueSearchForm.latte
@@ -128,7 +128,7 @@
                 {* Odesílací tlačítko *}
                 <div class="row">
                     <div class="col-12">
-                        {input submit class => 'btn btn-sm btn-outline-dark'}
+                        {input submit class => 'btn btn-outline-dark'}
                     </div>
                 </div>
 
diff --git a/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte b/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte
index 8743db1..6416f3b 100644
--- a/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte
+++ b/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte
@@ -1,89 +1,92 @@
-{form form class => 'form'}
-    <div class="form-group">
-        <div class="row">
-            <div class="col">
-                {label word1}
-                {input word1 class => 'form-control'}
-            </div>
-            <div class="col">
-                {label word2}
-                <div class="input-group">
-                    {input word2_condition class => 'form-control'}
-                    {input word2 class => 'form-control'}
-                </div>
-            </div>
-            <div class="col">
-                {label word3}
-                <div class="input-group">
-                    {input word3_condition class => 'form-control'}
-                    {input word3 class => 'form-control'}
+<fieldset>
+    <legend>Enter your conditions</legend>
+    {form form class => 'form'}
+        <div class="form-group">
+            <div class="row">
+                <div class="col">
+                    {label word1}
+                    {input word1 class => 'form-control'}
                 </div>
-            </div>
-        </div>
-        {input exact_match}
-        <hr>
-
-        <div class="search-options">
-            <div class="form-group row">
-                {label book class => 'col-sm-2 col-form-label'}
-                <div class="col-sm-3">
+                <div class="col">
+                    {label word2}
                     <div class="input-group">
-                        {input book_condition}
-                        {input book}
+                        {input word2_condition class => 'form-control'}
+                        {input word2 class => 'form-control'}
                     </div>
                 </div>
-            </div>
-            <div class="form-group row">
-                {label museum class => 'col-sm-2 col-form-label'}
-                <div class="col-sm-3">
+                <div class="col">
+                    {label word3}
                     <div class="input-group">
-                        {input museum_condition}
-                        {input museum}
+                        {input word3_condition class => 'form-control'}
+                        {input word3 class => 'form-control'}
                     </div>
                 </div>
             </div>
-            <div class="form-group row">
-                {label type class => 'col-sm-2 col-form-label'}
-                <div class="col-sm-3">
-                    <div class="input-group">
-                        {input type_condition}
-                        {input type}
+            {input exact_match}
+            <hr>
+
+            <div class="search-options">
+                <div class="form-group row">
+                    {label book class => 'col-sm-2 col-form-label'}
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            {input book_condition}
+                            {input book}
+                        </div>
                     </div>
                 </div>
-            </div>
-            <div class="form-group row">
-                {label origin class => 'col-sm-2 col-form-label'}
-                <div class="col-sm-3">
-                    <div class="input-group">
-                        {input origin_condition}
-                        {input origin}
+                <div class="form-group row">
+                    {label museum class => 'col-sm-2 col-form-label'}
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            {input museum_condition}
+                            {input museum}
+                        </div>
                     </div>
                 </div>
-            </div>
-            <div class="form-group row">
-                {label registration class => 'col-sm-2 col-form-label'}
-                <div class="col-sm-3">
-                    <div class="input-group">
-                        {input registration_condition}
-                        {input registration}
+                <div class="form-group row">
+                    {label type class => 'col-sm-2 col-form-label'}
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            {input type_condition}
+                            {input type}
+                        </div>
                     </div>
                 </div>
-            </div>
-            <div class="form-group row">
-                {label date class => 'col-sm-2 col-form-label'}
-                <div class="col-sm-3">
-                    <div class="input-group">
-                        {input date_condition}
-                        {input date}
+                <div class="form-group row">
+                    {label origin class => 'col-sm-2 col-form-label'}
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            {input origin_condition}
+                            {input origin}
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group row">
+                    {label registration class => 'col-sm-2 col-form-label'}
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            {input registration_condition}
+                            {input registration}
+                        </div>
+                    </div>
+                </div>
+                <div class="form-group row">
+                    {label date class => 'col-sm-2 col-form-label'}
+                    <div class="col-sm-3">
+                        <div class="input-group">
+                            {input date_condition}
+                            {input date}
+                        </div>
                     </div>
                 </div>
             </div>
         </div>
-    </div>
-    <div class="form-group row">
-        <div class="col-sm-10">
-            {input submit class => 'btn btn-outline-dark'}
+        <div class="row">
+            <div class="col-12">
+                {input submit class => 'btn btn-outline-dark'}
+            </div>
         </div>
-    </div>
 
-{/form}
+    {/form}
+</fieldset>
\ No newline at end of file
diff --git a/app/FrontModule/component/Transliteration/TransliterationSearchForm.php b/app/FrontModule/component/Transliteration/TransliterationSearchForm.php
index be00e30..ee92ed2 100644
--- a/app/FrontModule/component/Transliteration/TransliterationSearchForm.php
+++ b/app/FrontModule/component/Transliteration/TransliterationSearchForm.php
@@ -51,7 +51,6 @@ class TransliterationSearchForm extends Control
         $form = new Form();
 
         $form->addText('word1', 'Word 1')
-            ->addRule(Form::REQUIRED, 'Field %label is required.')
             ->setAttribute("autofocus");
         $form->addText('word2', 'Word 2');
         $form->addSelect('word2_condition', '', ESearchFormOperators::$wordSelectLabels);
@@ -85,6 +84,8 @@ class TransliterationSearchForm extends Control
         $form->addSubmit('submit', 'Search');
         $form->onSuccess[] = [$this, 'formSuccess'];
 
+        $form->setDefaults($this->getDefaults());
+
         return $form;
     }
 
@@ -95,9 +96,22 @@ class TransliterationSearchForm extends Control
         $this->transliterationSearchModel->setSearchTerms($values);
         $this->presenter->redirect('Transliteration:searchResult');
     }
+
+    private function getDefaults()
+    {
+        $defaults = [];
+
+        if (!empty($this->transliterationSearchModel->getSearchTerms()))
+        {
+            $defaults = $this->transliterationSearchModel->getSearchTerms();
+        }
+
+        return $defaults;
+    }
 }
 
-interface ITransliterationSearchFormFactory{
+interface ITransliterationSearchFormFactory
+{
     /**
      * @return TransliterationSearchForm
      */
diff --git a/app/FrontModule/component/Transliteration/TransliterationSearchResultList.php b/app/FrontModule/component/Transliteration/TransliterationSearchResultList.php
index 1457ec9..95c4e51 100644
--- a/app/FrontModule/component/Transliteration/TransliterationSearchResultList.php
+++ b/app/FrontModule/component/Transliteration/TransliterationSearchResultList.php
@@ -87,11 +87,6 @@ class TransliterationSearchResultList extends Control
         {
             $this->presenter->redirect('Transliteration:search');
         }
-
-        if(!$this->searchTerms['word1'])
-        {
-            $this->presenter->redirect('Transliteration:search');
-        }
     }
 
 
diff --git a/app/FrontModule/presenters/TransliterationPresenter.php b/app/FrontModule/presenters/TransliterationPresenter.php
index 7ede746..a909ed7 100644
--- a/app/FrontModule/presenters/TransliterationPresenter.php
+++ b/app/FrontModule/presenters/TransliterationPresenter.php
@@ -70,11 +70,28 @@ class TransliterationPresenter extends BaseUserPresenter
         $this->transliterationViewFactory = $transliterationViewFactory;
     }
 
+    /**
+     * Zobrazení daného článku
+     *
+     * @param $id
+     */
     public function actionView($id)
     {
         $this->template->id = $id;
     }
 
+    /**
+     * Handle pro resetování hodnot formuláře
+     */
+    public function handleSearchFormReset()
+    {
+        if ($this->isAjax())
+        {
+            $this->transliterationSearchModel->clearSearchTerms();
+            $this->redrawControl('searchForm');
+        }
+    }
+
     public function createComponentTransliterationView()
     {
         return $this->transliterationViewFactory->create();
diff --git a/app/FrontModule/templates/Transliteration/search.latte b/app/FrontModule/templates/Transliteration/search.latte
index b2a9bbd..d6367ed 100644
--- a/app/FrontModule/templates/Transliteration/search.latte
+++ b/app/FrontModule/templates/Transliteration/search.latte
@@ -1,6 +1,29 @@
 {block content}
-    <div class="display-5">Search in transliterations</div>
+    <div class="row">
+        <div class="col-10">
+            <div class="display-5">Search in transliterations</div>
+        </div>
+        <div class="col-2 text-right">
+            <a n:href="searchFormReset!" class="btn btn-sm btn-danger ajax"><span class="fa fa-fw fa-bars"></span> Reset form</a>
+        </div>
+    </div>
     <hr>
-    {control transliterationSearchForm}
-    {control keyboard}
-{/block}
\ No newline at end of file
+
+    {snippet searchForm}
+        {control transliterationSearchForm}
+    {/snippet}
+
+    <div class="row mt-4">
+        <div class="col-12">
+            {control keyboard}
+        </div>
+    </div>
+{/block}
+
+{block scripts}
+<script>
+    $(function ()
+    {
+        $.nette.init();
+    });
+</script>
\ No newline at end of file
diff --git a/app/model/TransliterationSearchModel.php b/app/model/TransliterationSearchModel.php
index 3557dea..e4171b3 100644
--- a/app/model/TransliterationSearchModel.php
+++ b/app/model/TransliterationSearchModel.php
@@ -41,4 +41,12 @@ class TransliterationSearchModel
     {
         return $this->section->searchTerms;
     }
+
+    /**
+     * Vyčištění vyhledávaných termínů
+     */
+    public function clearSearchTerms()
+    {
+        unset($this->section->searchTerms);
+    }
 }
\ No newline at end of file
diff --git a/app/templates/@menu.latte b/app/templates/@menu.latte
index 3ea554a..ba5cc6a 100644
--- a/app/templates/@menu.latte
+++ b/app/templates/@menu.latte
@@ -25,7 +25,7 @@
             <a class="nav-link" href="/utf/signs.html">Catalogue of cuneiform signs</a>
         </li>
         <li class="nav-item">
-            <a class="nav-link" href="/multidic">Dictionary</a>
+            <a class="nav-link" href="/multidic">Other dictionaries</a>
         </li>
         <li class="nav-item">
             <a n:class="nav-link, $presenter->isLinkCurrent(':Front:Contact:default') ? active" n:href=":Front:Contact:default">Contact
diff --git a/www/favicon.ico b/www/favicon.ico
index b20cfd0..0555b2e 100644
Binary files a/www/favicon.ico and b/www/favicon.ico differ
