commit f67d41dd97c647512453c2c27d4136f6deefa5c9
Author: Jan Šedivý <honza.seeda@gmail.com>
Date:   Wed Apr 17 10:45:46 2019 +0200

    Re #7323 Vytvoření presenteru pro transliterace, komponenta pro formulář vyhledávání textů

diff --git a/app/component/Transliteration/TransliterationSearchForm.latte b/app/component/Transliteration/TransliterationSearchForm.latte
new file mode 100644
index 0000000..233e0c8
--- /dev/null
+++ b/app/component/Transliteration/TransliterationSearchForm.latte
@@ -0,0 +1,418 @@
+<form action="search-result.html" method="post" enctype="multipart/form-data">
+    <div class="form-group">
+        <div class="row">
+            <div class="col">
+                <label for="word1">Word 1:</label>
+                <input type="text" class="form-control" id="word1">
+            </div>
+            <div class="col">
+                <label for="word2">Word 2:</label>
+
+                <div class="input-group">
+
+                    <select name="word2-op" class="form-control">
+                        <option value="">- NOT USED -</option>
+                        <option value="and">AND</option>
+                        <option value="or">OR</option>
+                        <option value="not">AND NOT</option>
+                    </select>
+                    <input id="word2" type="text" class="form-control">
+                </div>
+            </div>
+            <div class="col">
+                <label for="word3">Word 3:</label>
+
+                <div class="input-group">
+
+                    <select name="word3-op" class="form-control">
+                        <option value="">- NOT USED -</option>
+                        <option value="and">AND</option>
+                        <option value="or">OR</option>
+                        <option value="not">AND NOT</option>
+                    </select>
+                    <input id="word3" type="text" class="form-control">
+                </div>
+            </div>
+        </div>
+        <input name="exact-match" id="exact-match" type="checkbox">
+        <label for="exact-match">Exact Match</label>
+        <br>
+        <input name="work-with-lists" id="work-with-lists" type="checkbox">
+        <label for="work-with-lists">Work with a list of names: </label>
+        <input type="radio" name="list-of-names-radio" id="personal-radio" value="personal">
+        <label for="personal-radio">Personal names</label>
+        <input type="radio" name="list-of-names-radio" id="divine-radio" value="divine">
+        <label for="divine-radio">Divine names</label>
+        <br>
+        <a href="/nobtc/app/webroot/pages/hints-for-search">Hints for search</a>
+        <hr>
+
+        <div class="search-options">
+            <div class="form-group row">
+                <label for="book" class="col-sm-2 col-form-label">Book</label>
+                <div class="col-sm-3">
+                    <div class="input-group">
+
+                        <select name="book-op" class="form-control">
+                            <option value="equals">
+                                equals
+                            </option>
+                            <option value="not equals">
+                                not equals
+                            </option>
+                            <option value="contains" selected="selected">
+                                contains
+                            </option>
+                            <option value="begins with">
+                                begins with
+                            </option>
+                            <option value="ends with">
+                                ends with
+                            </option>
+                        </select>
+                        <input type="text" id="book" name="book" class="form-control">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                <label for="museum-no" class="col-sm-2 col-form-label">Museum number</label>
+                <div class="col-sm-3">
+                    <div class="input-group">
+
+                        <select name="museum-no-op" class="form-control">
+                            <option value="equals">
+                                equals
+                            </option>
+                            <option value="not equals">
+                                not equals
+                            </option>
+                            <option value="contains" selected="selected">
+                                contains
+                            </option>
+                            <option value="begins with">
+                                begins with
+                            </option>
+                            <option value="ends with">
+                                ends with
+                            </option>
+                        </select>
+                        <input type="text" name="museum-no" id="museum-no" class="form-control">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                <label for="id_book_type" class="col-sm-2 col-form-label">Type</label>
+                <div class="col-sm-3">
+                    <div class="input-group">
+
+                        <select name="book-type-op" class="form-control">
+                            <option value="is">
+                                is
+                            </option>
+                            <option value="is not">
+                                is not
+                            </option>
+                        </select>
+                        <select name="id_book_type" id="id_book_type" class="form-control">
+
+                            <option value="0" label="- NOT SELECTED -">
+                                - NOT SELECTED -
+                            </option>
+                            <option value="1" label="letter">
+                                letter
+                            </option>
+                            <option value="2" label="document">
+                                document
+                            </option>
+                            <option value="3" label="epic">
+                                epic
+                            </option>
+                            <option value="4" label="hymn">
+                                hymn
+                            </option>
+                            <option value="5" label="incantation">
+                                incantation
+                            </option>
+                            <option value="6" label="legal text">
+                                legal text
+                            </option>
+                            <option value="8" label="mathematics">
+                                mathematics
+                            </option>
+                            <option value="9" label="omina">
+                                omina
+                            </option>
+                            <option value="10" label="other">
+                                other
+                            </option>
+                            <option value="11" label="royal inscription">
+                                royal inscription
+                            </option>
+                            <option value="13" label="school text">
+                                school text
+                            </option>
+
+                        </select>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                <label for="id_origin" class="col-sm-2 col-form-label">Origin</label>
+                <div class="col-sm-3">
+                    <div class="input-group">
+
+                        <select name="origin-op" class="form-control">
+                            <option value="is">
+                                is
+                            </option>
+                            <option value="is not">
+                                is not
+                            </option>
+                        </select>
+                        <select name="id_origin" id="id_origin" class="form-control">
+
+                            <option value="0" label="- NOT SELECTED -">
+                                / - NOT SELECTED -
+                            </option>
+                            <option value="9" label="Tell Ḫarīrī">
+                                Mari / Tell Ḫarīrī
+                            </option>
+                            <option value="10" label="Išān Baḫriyāt">
+                                Isin / Išān Baḫriyāt
+                            </option>
+                            <option value="11" label="Nuffar">
+                                Nippur / Nuffar
+                            </option>
+                            <option value="1" label="Babylon">
+                                Bābili / Babylon
+                            </option>
+                            <option value="2" label="Tell Inġarra, Tell al-Uḫaimir">
+                                Kiš / Tell Inġarra, Tell al-Uḫaimir
+                            </option>
+                            <option value="3" label="Abū Ḫaṭab">
+                                Kisurra / Abū Ḫaṭab
+                            </option>
+                            <option value="4" label="unknown">
+                                Lagaba / unknown
+                            </option>
+                            <option value="5" label="as-Sankara">
+                                Larsa / as-Sankara
+                            </option>
+                            <option value="6" label="Tell Harmal">
+                                Šaduppûm / Tell Harmal
+                            </option>
+                            <option value="12" label="Tell Asmar">
+                                Ešnunna / Tell Asmar
+                            </option>
+                            <option value="13" label="Tell al-Muqaiyar">
+                                Ur / Tell al-Muqaiyar
+                            </option>
+                            <option value="14" label="Tulūl al-Ḫumr">
+                                - / Tulūl al-Ḫumr
+                            </option>
+                            <option value="15" label="Tell Abū Duwari">
+                                Maškan-šāpir / Tell Abū Duwari
+                            </option>
+                            <option value="16" label="Khafajah">
+                                / Khafajah
+                            </option>
+                            <option value="17" label="Borsippa, Birs Nimrūd">
+                                Barsip / Borsippa, Birs Nimrūd
+                            </option>
+                            <option value="18" label="Tell Abū Ḫabba">
+                                Sippar / Tell Abū Ḫabba
+                            </option>
+                            <option value="19" label="Tell Muḫammad">
+                                Diniktum? / Tell Muḫammad
+                            </option>
+                            <option value="21" label="Khafajah">
+                                Dūr-Samsu-iluna / Khafajah
+                            </option>
+                            <option value="22" label="">
+                                unknown /
+                            </option>
+                            <option value="24" label="Sūsa">
+                                Šūšan / Sūsa
+                            </option>
+                            <option value="23" label="Warka">
+                                Uruk / Warka
+                            </option>
+                            <option value="25" label="Ishchali">
+                                Nērebtum? / Ishchali
+                            </option>
+                            <option value="26" label="Cytheria (island)">
+                                / Cytheria (island)
+                            </option>
+                            <option value="27" label="Cyprus">
+                                Iadnāna / Cyprus
+                            </option>
+                            <option value="29" label="Qalʾat Šarqāṭ">
+                                Aššur / Qalʾat Šarqāṭ
+                            </option>
+                            <option value="28" label="Tell Ḫaddād">
+                                Mê-Turran / Tell Ḫaddād
+                            </option>
+                            <option value="30" label="Tell Leilān">
+                                Šubat-Enlil / Tell Leilān
+                            </option>
+                            <option value="31" label="Acem Höyük">
+                                ? / Acem Höyük
+                            </option>
+                            <option value="32" label="Tell al-ʾAšāra">
+                                Terqa / Tell al-ʾAšāra
+                            </option>
+                            <option value="33" label="Išān Dhaḫāk">
+                                / Išān Dhaḫāk
+                            </option>
+                            <option value="34" label="Tell ad-Dibāʾī">
+                                Zaralulu / Tell ad-Dibāʾī
+                            </option>
+                            <option value="35" label="Tell al-Suleimaḫ">
+                                Batir? / Tell al-Suleimaḫ
+                            </option>
+                            <option value="36" label="Bardi Sanjian in Bītwāta">
+                                / Bardi Sanjian in Bītwāta
+                            </option>
+                            <option value="37" label="near Tūz Ḫurmati">
+                                Ḫuršītum? / near Tūz Ḫurmati
+                            </option>
+                            <option value="38" label="Tell Šamšāra">
+                                Šušarrā / Tell Šamšāra
+                            </option>
+                            <option value="39" label="Dura-Europos">
+                                Damara / Dura-Europos
+                            </option>
+                            <option value="20" label="Tell ar-Rimāḫ">
+                                Qaṭṭarā / Tell ar-Rimāḫ
+                            </option>
+                            <option value="40" label="Tell Açana">
+                                Alalaḫ / Tell Açana
+                            </option>
+                            <option value="7" label="Rās aš-Šamra">
+                                Ugarit / Rās aš-Šamra
+                            </option>
+                            <option value="41" label="Tell Mardiḫ">
+                                Ebla / Tell Mardiḫ
+                            </option>
+                            <option value="42" label="Hillah (near Babylon)">
+                                / Hillah (near Babylon)
+                            </option>
+                            <option value="43" label="Bismāya">
+                                Adab / Bismāya
+                            </option>
+                            <option value="44" label="al-Hibā">
+                                Lagaš / al-Hibā
+                            </option>
+                            <option value="45" label="Tell ed-Dēr">
+                                Sippar-Iaḫrūrum / Tell ed-Dēr
+                            </option>
+                            <option value="46" label="Tell Dulaiḫim or Tell Muḫaṭṭaṭ">
+                                Dilbat / Tell Dulaiḫim or Tell Muḫaṭṭaṭ
+                            </option>
+
+                        </select>
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                <label for="reg_no" class="col-sm-2 col-form-label">Registration / Ex. number</label>
+                <div class="col-sm-3">
+                    <div class="input-group">
+
+                        <select name="reg_no-op" class="form-control">
+                            <option value="equals">
+                                equals
+                            </option>
+                            <option value="not equals">
+                                not equals
+                            </option>
+                            <option value="contains" selected="selected">
+                                contains
+                            </option>
+                            <option value="begins with">
+                                begins with
+                            </option>
+                            <option value="ends with">
+                                ends with
+                            </option>
+                        </select>
+                        <input type="text" id="reg_no" name="reg_no" class="form-control">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                <label for="date" class="col-sm-2 col-form-label">Date</label>
+                <div class="col-sm-3">
+                    <div class="input-group">
+
+                        <select name="date-op" class="form-control">
+                            <option value="equals">
+                                equals
+                            </option>
+                            <option value="not equals">
+                                not equals
+                            </option>
+                            <option value="contains" selected="selected">
+                                contains
+                            </option>
+                            <option value="begins with">
+                                begins with
+                            </option>
+                            <option value="ends with">
+                                ends with
+                            </option>
+                        </select>
+                        <input type="text" id="date" name="date" class="form-control">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <hr>
+
+        <label for="line-count">Representation of search result:</label>
+        <div class="form-inline">
+            <div class="form-group">
+                <small class="text-muted">
+                    Print
+                </small>
+                <select name="line-count" id="line-count" class="form-control form-control-sm mx-sm-3">
+                    <option value="0" selected="selected">0</option>
+                    <option value="1">1</option>
+                    <option value="2">2</option>
+                    <option value="3">3</option>
+                    <option value="5">5</option>
+                    <option value="10">10</option>
+                    <option value="15">15</option>
+                </select>
+                <small id="passwordHelpInline" class="text-muted">
+                    lines before and after found line.
+                </small>
+            </div>
+        </div>
+        <div class="form-inline">
+            <div class="form-group">
+                <small class="text-muted">
+                    Show
+                </small>
+                <select name="r_limit" class="form-control form-control-sm mx-sm-3">
+                    <option value="1">1</option>
+                    <option value="2">2</option>
+                    <option value="3">3</option>
+                    <option value="5" selected="selected">5</option>
+                    <option value="10">10</option>
+                    <option value="15">15</option>
+                    <option value="30">30</option>
+                </select>
+                <small class="text-muted">
+                    found transliteration per site.
+                </small>
+            </div>
+        </div>
+    </div>
+    <div class="form-group row">
+        <div class="col-sm-10">
+            <button type="submit" class="btn btn-outline-dark">Search</button>
+        </div>
+    </div>
+
+</form>
diff --git a/app/component/Transliteration/TransliterationSearchForm.php b/app/component/Transliteration/TransliterationSearchForm.php
new file mode 100644
index 0000000..f38da8d
--- /dev/null
+++ b/app/component/Transliteration/TransliterationSearchForm.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Components;
+
+use Nette\Application\UI\Control;
+use Nette\Forms\Form;
+
+class TransliterationSearchForm extends Control
+{
+    public function render()
+    {
+        $this->template->setFile(__DIR__ . '/TransliterationSearchForm.latte');
+        $this->template->render();
+    }
+
+    public function createComponentForm()
+    {
+        $form = new Form();
+        $form->addText('word1', 'Word 1');
+        $form->addText('word2', 'Word 2');
+        $form->addSelect('word2_condition', '');
+        $form->addText('word3', 'Word 3');
+        $form->addSelect('word3_condition', '');
+
+        $form->addSubmit('submit', 'Search');
+
+        $form->onSuccess[] = [$this, 'formSubmit'];
+
+        return $form;
+    }
+
+    public function formSubmit()
+    {
+
+    }
+}
+
+interface ITransliterationSearchFormFactory{
+    /**
+     * @return TransliterationSearchForm
+     */
+    public function create();
+}
\ No newline at end of file
diff --git a/app/config/components.neon b/app/config/components.neon
index 47713fa..6dca720 100644
--- a/app/config/components.neon
+++ b/app/config/components.neon
@@ -3,4 +3,5 @@ services:
     - App\Components\IExampleGirdFactory
 
     # Formuláře
-    - App\Components\ILoginFormFactory
\ No newline at end of file
+    - App\Components\ILoginFormFactory
+    - App\Components\ITransliterationSearchFormFactory
\ No newline at end of file
diff --git a/app/config/config.local.example.neon b/app/config/config.local.example.neon
index 44393b4..04db7b5 100644
--- a/app/config/config.local.example.neon
+++ b/app/config/config.local.example.neon
@@ -2,6 +2,6 @@ parameters:
 
 
 database:
-	dsn: 'mysql:host=127.0.0.1;dbname=test'
-	user:
-	password:
+	dsn: 'mysql:host=filek.cz;dbname=klinopis'
+	user: dbowner
+	password: db486ex12
diff --git a/app/presenters/TransliterationPresenter.php b/app/presenters/TransliterationPresenter.php
new file mode 100644
index 0000000..487e969
--- /dev/null
+++ b/app/presenters/TransliterationPresenter.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Presenters;
+
+
+use App\Components\ITransliterationSearchFormFactory;
+use Nette\Application\UI\Presenter;
+
+class TransliterationPresenter extends Presenter
+{
+    /** @var ITransliterationSearchFormFactory */
+    private $transliterationSearchFormFactory;
+
+    public function __construct(ITransliterationSearchFormFactory $transliterationSearchFormFactory)
+    {
+        parent::__construct();
+
+        $this->transliterationSearchFormFactory = $transliterationSearchFormFactory;
+    }
+
+
+    public function actionSearch(){
+
+    }
+
+    public function createComponentTransliterationSearchForm()
+    {
+        return $this->transliterationSearchFormFactory->create();
+    }
+}
\ No newline at end of file
diff --git a/app/presenters/templates/@layout.latte b/app/presenters/templates/@layout.latte
index b640850..ddb016b 100644
--- a/app/presenters/templates/@layout.latte
+++ b/app/presenters/templates/@layout.latte
@@ -54,7 +54,7 @@
 <nav class="navbar navbar-expand-lg navbar-dark bg-primary" style="background-color: #003366 !important;">
     <ul class="navbar-nav mr-auto">
         <li class="nav-item">
-            <a class="nav-link" href="search-texts.html">Search & edit texts</a>
+            <a class="nav-link" n:href="Transliteration:search">Search & edit texts</a>
         </li>
         <li class="nav-item">
             <a class="nav-link" href="#">Search dictionary</a>
diff --git a/app/presenters/templates/Transliteration/search.latte b/app/presenters/templates/Transliteration/search.latte
new file mode 100644
index 0000000..e69de29
