commit 62876c54f607541ffa6d5b4348ee2bf1880f84c8
Author: Filip Jani <jsem@filek.cz>
Date:   Fri May 24 00:21:25 2019 +0200

    Re #7504 odstranění ukázkového dyn. formuláře a úprava formátování kódu

diff --git a/app/AdminModule/component/Example/ExampleDynamic.latte b/app/AdminModule/component/Example/ExampleDynamic.latte
deleted file mode 100644
index a6ac10f..0000000
--- a/app/AdminModule/component/Example/ExampleDynamic.latte
+++ /dev/null
@@ -1,48 +0,0 @@
-{form form}
-    <div class="row mb-2">
-        <div class="col-1">
-            {label element}
-        </div>
-        <div class="col-9">
-            {input element}
-        </div>
-    </div>
-
-    <div n:multiplier="books">
-        <div class="row mb-2">
-            <div class="col-1"><label n:name="line">Řádka</label></div>
-            <div class="col-3"><input n:name="line" n:class="form-control" required></div>
-            <div class="col-1 offset-1"><label n:name="book">Knížka</label></div>
-            <div class="col-3"><input n:name="book" n:class="form-control"></div>
-            <div class="col-2">{btnRemove 'class' => 'btn btn-danger'}</div>
-        </div>
-    </div>
-
-    {btnCreate books class => 'btn btn-success'}
-
-    <div class="row mt-5">
-        <div class="col-2">
-            {input submit}
-        </div>
-    </div>
-
-    <hr class="mt-5">
-    <h4>Výsledky</h4>
-
-    <code>
-        {snippet results}
-            {ifset $results}
-                {foreach $results as $element => $value}
-                    {if $value instanceof \Nette\Utils\ArrayHash}
-                        {foreach $value as $el => $val}
-                            <b>Element:</b> {$element}[{$el}], <b>value:</b> {var_dump($val)}
-                            <br>
-                        {/foreach}
-                    {else}
-                        <b>Element:</b> {$element}, <b>value:</b> {$value}<br>
-                    {/if}
-                {/foreach}
-            {/ifset}
-        {/snippet}
-    </code>
-{/form}
\ No newline at end of file
diff --git a/app/AdminModule/component/Example/ExampleDynamic.php b/app/AdminModule/component/Example/ExampleDynamic.php
deleted file mode 100644
index e9f8e07..0000000
--- a/app/AdminModule/component/Example/ExampleDynamic.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-
-
-namespace App\AdminModule\Components;
-
-
-use App\Utils\Form;
-use Nette\Application\UI\Control;
-use Nette\Forms\Container;
-
-/**
- * Ukázkový dynamický formulář - SMAZAT PŘI PŘEDÁNÍ!
- *
- * @package App\AdminModule\Components
- */
-class ExampleDynamic extends Control
-{
-    public function render()
-    {
-        $this->template->setFile(__DIR__ . '/ExampleDynamic.latte');
-        $this->template->render();
-    }
-
-    public function createComponentForm()
-    {
-        $form = new Form;
-
-        $min = 1; // Minimální počet kopií které se zobrazí ve formuláři (tj. 1 = minimálně jednou tam budou ty prvky)
-
-        $form->addText('element', 'Další prvky');
-
-        // Definice dynamických prvků
-        $multiplier = $form->addMultiplier('books', function (Container $container)
-        {
-            $container->addText('line', 'Řádka');
-            $container->addText('book', 'Knížka');
-        }, $min);
-
-        // Definice tlačítek pro přidání / odebrání řádku
-        $multiplier->addCreateButton('Add')->addClass('btn btn-primary');
-        $multiplier->addRemoveButton('Remove')->addClass('btn btn-danger');
-
-        $form->setDefaults($this->getContainerDefaults());
-
-        $form->addSubmit('submit', 'Odeslat');
-        $form->onSuccess[] = [$this, 'formSuccess'];
-
-        return $form;
-    }
-
-    public function formSuccess(Form $form)
-    {
-        \Tracy\Debugger::barDump($form->getValues());
-        $this->template->results = $form->getValues();
-        $this->redrawControl('results');
-    }
-
-    /**
-     * Vrací testovací pole s defaultníma hodnotama pro ukázku jak se plní formulář při editaci
-     */
-    public function getContainerDefaults()
-    {
-        return [
-            'element' => 'Nějaký další prvky',
-            'books' =>  // název kontaineru v addMultiplier
-                [
-                    ['line' => '1.', 'book' => 'kniha 1.'],
-                    ['line' => '2.', 'book' => 'kniha 2.'],
-                    ['line' => '3.', 'book' => 'kniha 3.']
-                ]
-        ];
-    }
-
-}
-
-interface IExampleDynamicFactory
-{
-    /**
-     * @return ExampleDynamic
-     */
-    public function create();
-}
\ No newline at end of file
diff --git a/app/AdminModule/component/Transliteration/TransliterationEditForm.latte b/app/AdminModule/component/Transliteration/TransliterationEditForm.latte
index 108584c..d4c1261 100644
--- a/app/AdminModule/component/Transliteration/TransliterationEditForm.latte
+++ b/app/AdminModule/component/Transliteration/TransliterationEditForm.latte
@@ -87,6 +87,7 @@
     <div class="row">
         <div class="col-12">
             <h5>References</h5>
+            <p>(series, number, page)</p>
             <div n:multiplier="references">
                 <div class="row mb-2">
 
@@ -109,7 +110,7 @@
         </div>
     </div>
 
-    <div class="row mt-2">
+    <div class="row mt-5">
         <div class="col-4">
             {input submit}
         </div>
diff --git a/app/AdminModule/component/Transliteration/TransliterationEditForm.php b/app/AdminModule/component/Transliteration/TransliterationEditForm.php
index fab9038..b2b7f39 100644
--- a/app/AdminModule/component/Transliteration/TransliterationEditForm.php
+++ b/app/AdminModule/component/Transliteration/TransliterationEditForm.php
@@ -12,6 +12,7 @@ use App\Model\Repository\OriginRepository;
 use App\Model\Repository\TransliterationRepository;
 use App\Utils\Form;
 use Nette\Application\UI\Control;
+use Nette\Database\Table\ActiveRow;
 use Nette\Forms\Container;
 
 /**
@@ -60,10 +61,19 @@ class TransliterationEditForm extends Control
     /**
      * TransliterationEditForm constructor.
      * @param TransliterationRepository $transliterationRepository
+     * @param BookRepository $bookRepository
+     * @param MuseumRepository $museumRepository
+     * @param OriginRepository $originRepository
+     * @param BookTypeRepository $bookTypeRepository
+     * @param LitReferenceRepository $litReferenceRepository
      */
-    public function __construct(TransliterationRepository $transliterationRepository, BookRepository $bookRepository,
-                                MuseumRepository $museumRepository, OriginRepository $originRepository,
-                                BookTypeRepository $bookTypeRepository, LitReferenceRepository $litReferenceRepository)
+    public function __construct(TransliterationRepository $transliterationRepository,
+                                BookRepository $bookRepository,
+                                MuseumRepository $museumRepository,
+                                OriginRepository $originRepository,
+                                BookTypeRepository $bookTypeRepository,
+                                LitReferenceRepository $litReferenceRepository
+    )
     {
         parent::__construct();
 
@@ -154,7 +164,7 @@ class TransliterationEditForm extends Control
     /**
      * Zkontroluje jestli není nějaká refence prázná
      *
-     * @param $references pole referencí
+     * @param $references array referencí
      * @return bool
      */
     public function isAnyReferenceEmpty($references)
@@ -173,7 +183,7 @@ class TransliterationEditForm extends Control
     /**
      * Odstraní odebrané reference transliterace
      *
-     * @param $newReferences pole nových transliterací
+     * @param $newReferences array nových transliterací
      */
     public function deleteRemovedReferences($newReferences)
     {
@@ -192,8 +202,8 @@ class TransliterationEditForm extends Control
     /**
      * Zkontroluje jestli je refence v poli referencí
      *
-     * @param $reference reference ke kontrole
-     * @param $newReferences pole referencí
+     * @param $reference ActiveRow reference ke kontrole
+     * @param $newReferences array pole referencí
      * @return bool
      */
     public function isRemovedReference($reference, $newReferences)
diff --git a/app/AdminModule/presenters/ExamplePresenter.php b/app/AdminModule/presenters/ExamplePresenter.php
deleted file mode 100644
index d1f16cb..0000000
--- a/app/AdminModule/presenters/ExamplePresenter.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-
-namespace App\AdminModule\Presenters;
-
-
-use App\AdminModule\Components\IExampleDynamicFactory;
-
-class ExamplePresenter extends BaseAdminPresenter
-{
-    /**
-     * @var IExampleDynamicFactory
-     */
-    private $dynamicFactory;
-
-    public function __construct(IExampleDynamicFactory $dynamicFactory)
-    {
-
-        $this->dynamicFactory = $dynamicFactory;
-    }
-
-    public function createComponentForm()
-    {
-        return $this->dynamicFactory->create();
-    }
-}
\ No newline at end of file
diff --git a/app/AdminModule/templates/Example/default.latte b/app/AdminModule/templates/Example/default.latte
deleted file mode 100644
index 2b1542c..0000000
--- a/app/AdminModule/templates/Example/default.latte
+++ /dev/null
@@ -1,2 +0,0 @@
-{block content}
-{control form}
\ No newline at end of file
diff --git a/app/config/components.neon b/app/config/components.neon
index 06e0e50..62e9cb2 100644
--- a/app/config/components.neon
+++ b/app/config/components.neon
@@ -23,7 +23,4 @@ services:
     - App\AdminModule\Components\ITransliterationEditFormFactory
 
     - App\FrontModule\Components\IKeyboard
-    - App\FrontModule\Components\ITransliterationSearchResultListFactory
-
-    # Example - smazat při předání!
-    - App\AdminModule\Components\IExampleDynamicFactory
\ No newline at end of file
+    - App\FrontModule\Components\ITransliterationSearchResultListFactory
\ No newline at end of file
diff --git a/app/model/repository/BookRepository.php b/app/model/repository/BookRepository.php
index 3122a7c..d6171e4 100644
--- a/app/model/repository/BookRepository.php
+++ b/app/model/repository/BookRepository.php
@@ -43,8 +43,9 @@ class BookRepository extends Repository
      *
      * @return array
      */
-    public function getBookAbbrevForSelect(){
-        return $this->findAll()->fetchPairs(BookRepository::COLUMN_ID,BookRepository::COLUMN_BOOK_ABREV);
+    public function getBookAbbrevForSelect()
+    {
+        return $this->findAll()->fetchPairs(BookRepository::COLUMN_ID, BookRepository::COLUMN_BOOK_ABREV);
     }
 
 }
\ No newline at end of file
