commit 4ca0744da89615968c99b2ee307977633e7c7bba
Author: Filip Jani <jsem@filek.cz>
Date:   Fri Jun 7 16:27:08 2019 +0200

    Re #7577 upravení drobností zjištěných retrospektivou

diff --git a/app/AdminModule/component/Book/BookEditForm.latte b/app/AdminModule/component/Book/BookEditForm.latte
index b6a732f..922ba75 100644
--- a/app/AdminModule/component/Book/BookEditForm.latte
+++ b/app/AdminModule/component/Book/BookEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Book</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
\ No newline at end of file
diff --git a/app/AdminModule/component/BookType/BookTypeEditForm.latte b/app/AdminModule/component/BookType/BookTypeEditForm.latte
index b6a732f..f32d45b 100644
--- a/app/AdminModule/component/BookType/BookTypeEditForm.latte
+++ b/app/AdminModule/component/BookType/BookTypeEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Book type</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
\ No newline at end of file
diff --git a/app/AdminModule/component/Museum/MuseumEditForm.latte b/app/AdminModule/component/Museum/MuseumEditForm.latte
index b6a732f..cddbc29 100644
--- a/app/AdminModule/component/Museum/MuseumEditForm.latte
+++ b/app/AdminModule/component/Museum/MuseumEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Museum</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
\ No newline at end of file
diff --git a/app/AdminModule/component/Object/ObjectTypeEditForm.latte b/app/AdminModule/component/Object/ObjectTypeEditForm.latte
index 83bec91..e47a9d5 100644
--- a/app/AdminModule/component/Object/ObjectTypeEditForm.latte
+++ b/app/AdminModule/component/Object/ObjectTypeEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Object type</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
diff --git a/app/AdminModule/component/Object/ObjectTypeGrid.php b/app/AdminModule/component/Object/ObjectTypeGrid.php
index 25bed85..1a5da6d 100644
--- a/app/AdminModule/component/Object/ObjectTypeGrid.php
+++ b/app/AdminModule/component/Object/ObjectTypeGrid.php
@@ -44,7 +44,7 @@ class ObjectTypeGrid extends \App\Utils\DataGrid\DataGrid
         $this->addAction('edit', 'edit', 'Object:editType', ['id' => ObjectTypeRepository::COLUMN_ID])
             ->setTitle('Edit');
 
-        $this->addAction('delete', 'delete', 'Object:deleteType', ['id' => ObjectTypeRepository::COLUMN_ID])
+        $this->addAction('delete', 'delete', 'deleteType!', ['id' => ObjectTypeRepository::COLUMN_ID])
             ->setConfirm('Do you really want to delete the object type "%s".', ObjectTypeRepository::COLUMN_OBJECT_TYPE)
             ->setTitle('Delete')
             ->setClass('btn btn-xs btn-danger ajax');
diff --git a/app/AdminModule/component/Origin/OriginEditForm.latte b/app/AdminModule/component/Origin/OriginEditForm.latte
index b6a732f..b3d7feb 100644
--- a/app/AdminModule/component/Origin/OriginEditForm.latte
+++ b/app/AdminModule/component/Origin/OriginEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Origin</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
\ No newline at end of file
diff --git a/app/AdminModule/component/Surface/SurfaceGrid.php b/app/AdminModule/component/Surface/SurfaceGrid.php
index 8fc1877..9c3c0b1 100644
--- a/app/AdminModule/component/Surface/SurfaceGrid.php
+++ b/app/AdminModule/component/Surface/SurfaceGrid.php
@@ -47,7 +47,7 @@ class SurfaceTypeGrid extends DataGrid
         $this->addAction('edit', 'edit', 'Surface:editType', ['id' => SurfaceTypeRepository::COLUMN_ID])
             ->setTitle('Edit');
 
-        $this->addAction('delete', 'delete', 'Surface:deleteType', ['id' => SurfaceTypeRepository::COLUMN_ID])
+        $this->addAction('delete', 'delete', 'deleteType!', ['id' => SurfaceTypeRepository::COLUMN_ID])
             ->setConfirm('Do you really want to delete surface type "%s"?', SurfaceTypeRepository::COLUMN_SURFACE_TYPE)
             ->setTitle('Delete')
             ->setClass('btn btn-xs btn-danger ajax');
diff --git a/app/AdminModule/component/Surface/SurfaceTypeEditForm.latte b/app/AdminModule/component/Surface/SurfaceTypeEditForm.latte
index 83bec91..233a782 100644
--- a/app/AdminModule/component/Surface/SurfaceTypeEditForm.latte
+++ b/app/AdminModule/component/Surface/SurfaceTypeEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Surface type</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
diff --git a/app/AdminModule/component/User/UserEditForm.latte b/app/AdminModule/component/User/UserEditForm.latte
index b6a732f..b08f380 100644
--- a/app/AdminModule/component/User/UserEditForm.latte
+++ b/app/AdminModule/component/User/UserEditForm.latte
@@ -1,5 +1,9 @@
 <div class="row">
     <div class="col-4">
-        {control form}
+        <fieldset>
+            <legend>Editace uživatele</legend>
+
+            {control form}
+        </fieldset>
     </div>
 </div>
\ No newline at end of file
diff --git a/app/AdminModule/presenters/MuseumPresenter.php b/app/AdminModule/presenters/MuseumPresenter.php
index 9804235..a9f55e7 100644
--- a/app/AdminModule/presenters/MuseumPresenter.php
+++ b/app/AdminModule/presenters/MuseumPresenter.php
@@ -5,6 +5,7 @@ namespace App\AdminModule\Presenters;
 
 use App\AdminModule\Components\IMuseumEditFormFactory;
 use App\AdminModule\Components\IMuseumGridFactory;
+use App\Enum\EFlashMessage;
 use App\Model\Repository\MuseumRepository;
 
 class MuseumPresenter extends BaseUserPresenter
@@ -37,6 +38,7 @@ class MuseumPresenter extends BaseUserPresenter
     public function actionEdit(int $id)
     {
         $this['museumEditForm']->setMuseum($id);
+        $this->template->id = $id;
     }
 
     /**
@@ -53,6 +55,25 @@ class MuseumPresenter extends BaseUserPresenter
         }
     }
 
+    /**
+     * Akce pro odstranění muzea
+     *
+     * @param int $id
+     * @throws \Nette\Application\AbortException
+     */
+    public function actionDeleteMuseum(int $id)
+    {
+        if($this->museumRepository->delete($id))
+        {
+            $this->flashMessage('Museum was deleted.', EFlashMessage::SUCCESS);
+        }
+        else
+        {
+            $this->flashMessage('Museum was not found.', EFlashMessage::ERROR);
+        }
+        $this->redirect('Museum:');
+    }
+
     public function createComponentMuseumGrid()
     {
         return $this->museumGridFactory->create();
diff --git a/app/AdminModule/presenters/ObjectPresenter.php b/app/AdminModule/presenters/ObjectPresenter.php
index 0ed8702..38d9c19 100644
--- a/app/AdminModule/presenters/ObjectPresenter.php
+++ b/app/AdminModule/presenters/ObjectPresenter.php
@@ -70,6 +70,15 @@ class ObjectPresenter extends BaseUserPresenter
         $this->redirect('Object:');
     }
 
+    public function handleDeleteType(int $id)
+    {
+        if($this->isAjax())
+        {
+            $this->objectTypeRepository->delete($id);
+            $this['objectTypeGrid']->reload();
+        }
+    }
+
     public function createComponentObjectTypeGrid()
     {
         return $this->objectTypeGridFactory->create();
diff --git a/app/AdminModule/presenters/SurfacePresenter.php b/app/AdminModule/presenters/SurfacePresenter.php
index ff02dce..696ee79 100644
--- a/app/AdminModule/presenters/SurfacePresenter.php
+++ b/app/AdminModule/presenters/SurfacePresenter.php
@@ -57,6 +57,15 @@ class SurfacePresenter extends BaseUserPresenter
         $this->template->id = $id;
     }
 
+    public function handleDeleteType(int $id)
+    {
+        if($this->isAjax())
+        {
+            $this->surfaceTypeRepository->delete($id);
+            $this['surfaceTypeGrid']->reload();
+        }
+    }
+
     public function actionDeleteType(int $id)
     {
         if($this->surfaceTypeRepository->delete($id))
diff --git a/app/AdminModule/presenters/UserPresenter.php b/app/AdminModule/presenters/UserPresenter.php
index f59ad24..bd0f57b 100644
--- a/app/AdminModule/presenters/UserPresenter.php
+++ b/app/AdminModule/presenters/UserPresenter.php
@@ -6,6 +6,7 @@ namespace App\AdminModule\Presenters;
 
 use App\AdminModule\Components\IUserEditFormFactory;
 use App\AdminModule\Components\IUserGridFactory;
+use App\Enum\EFlashMessage;
 use App\Model\Facade\UserFacade;
 
 class UserPresenter extends BaseAdminPresenter
@@ -38,6 +39,7 @@ class UserPresenter extends BaseAdminPresenter
     public function actionEdit(int $id)
     {
         $this['userEditForm']->setUser($id);
+        $this->template->id = $id;
     }
 
     public function handleDeleteUser(int $id)
@@ -49,6 +51,25 @@ class UserPresenter extends BaseAdminPresenter
         }
     }
 
+    /**
+     * Akce pro odstranění uživatele
+     *
+     * @param int $id
+     * @throws \Nette\Application\AbortException
+     */
+    public function actionDeleteUser(int $id)
+    {
+        if($this->userFacade->deleteUser($id))
+        {
+            $this->flashMessage('User was deleted.', EFlashMessage::SUCCESS);
+        }
+        else
+        {
+            $this->flashMessage('User was not found.', EFlashMessage::ERROR);
+        }
+        $this->redirect('User:');
+    }
+
     public function createComponentUserGrid()
     {
         return $this->userGridFactory->create();
diff --git a/app/AdminModule/templates/@adminMenu.latte b/app/AdminModule/templates/@adminMenu.latte
index 9e6efd8..9564766 100644
--- a/app/AdminModule/templates/@adminMenu.latte
+++ b/app/AdminModule/templates/@adminMenu.latte
@@ -19,6 +19,4 @@
             Origin </a></li>
     <li class="nav-item"><a n:href="Transport:default" n:class="nav-link, $presenter->isLinkCurrent('Transport:*') ? active" title="Transport">
             Import/export texts </a></li>
-    <li class="nav-item"><a href="#" class="nav-link" title="Replace">
-            Mass replace </a></li>
 </ul>
\ No newline at end of file
diff --git a/app/AdminModule/templates/Museum/edit.latte b/app/AdminModule/templates/Museum/edit.latte
index f45f33b..d9b2594 100644
--- a/app/AdminModule/templates/Museum/edit.latte
+++ b/app/AdminModule/templates/Museum/edit.latte
@@ -1,10 +1,11 @@
 {block content}
-<div class="row">
-    <div class="col-11">
-        <div class="display-5">Edit Museum</div>
+    <div class="row">
+        <div class="col-9">
+            <div class="display-5">Edit Museum</div>
+        </div>
+        <div class="col-3 text-right">
+            <a n:href="Museum:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Museum list</a>
+            <a n:href="Museum:deleteMuseum $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this museum?')"><span class="fa fa-fw fa-trash"></span> Delete Museum</a>
+        </div>
     </div>
-    <div class="col-1">
-        <a n:href="Museum:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Museum list</a>
-    </div>
-</div>
 {control museumEditForm}
\ No newline at end of file
diff --git a/app/AdminModule/templates/Object/editType.latte b/app/AdminModule/templates/Object/editType.latte
index 7082d13..ce04d24 100644
--- a/app/AdminModule/templates/Object/editType.latte
+++ b/app/AdminModule/templates/Object/editType.latte
@@ -4,8 +4,8 @@
             <div class="display-5">Edit Object Type</div>
         </div>
         <div class="col-2 text-right">
-            <a n:href="Object:deleteType $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this type?')"><span class="fa fa-fw fa-trash"></span> Delete Type</a>
             <a n:href="Object:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Object Types</a>
+            <a n:href="Object:deleteType $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this type?')"><span class="fa fa-fw fa-trash"></span> Delete Type</a>
         </div>
     </div>
     {control objectTypeEditForm}
diff --git a/app/AdminModule/templates/Surface/editType.latte b/app/AdminModule/templates/Surface/editType.latte
index 31cd6e3..fe4df48 100644
--- a/app/AdminModule/templates/Surface/editType.latte
+++ b/app/AdminModule/templates/Surface/editType.latte
@@ -4,8 +4,8 @@
             <div class="display-5">Edit Surface Type</div>
         </div>
         <div class="col-2 text-right">
-            <a n:href="Surface:deleteType $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this type?')"><span class="fa fa-fw fa-trash"></span> Delete Type</a>
             <a n:href="Surface:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Surface Types</a>
+            <a n:href="Surface:deleteType $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this type?')"><span class="fa fa-fw fa-trash"></span> Delete Type</a>
         </div>
     </div>
     {control surfaceTypeEditForm}
diff --git a/app/AdminModule/templates/Transliteration/edit.latte b/app/AdminModule/templates/Transliteration/edit.latte
index e9116ec..ab89f33 100644
--- a/app/AdminModule/templates/Transliteration/edit.latte
+++ b/app/AdminModule/templates/Transliteration/edit.latte
@@ -3,7 +3,7 @@
         <div class="col-5">
             <div class="display-5">Edit Transliteration</div>
 
-            <fieldset>
+            <fieldset id="transliteration-info">
                 <legend>Transliteration information</legend>
 
                 {control transliterationEditForm}
@@ -13,7 +13,7 @@
 
     <div class="row mt-5">
         <div class="col-5">
-            <fieldset>
+            <fieldset id="transliteration-data">
                 <legend>Transliteration data</legend>
 
                 {control transliterationDataEditForm}
diff --git a/app/AdminModule/templates/User/edit.latte b/app/AdminModule/templates/User/edit.latte
index cbe97e7..861e3bb 100644
--- a/app/AdminModule/templates/User/edit.latte
+++ b/app/AdminModule/templates/User/edit.latte
@@ -1,10 +1,12 @@
 {block content}
 <div class="row">
-    <div class="col-10">
+    <div class="col-9">
         <div class="display-5">Administrace - Editace uživatele</div>
     </div>
-    <div class="col-2 text-right">
+    <div class="col-3 text-right">
         <a n:href="User:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Seznam uživatelů</a>
+        <a n:href="User:deleteUser $id" class="btn btn-sm btn-danger" onclick="return confirm('Opravdu chcete uživatele odstranit?')"><span class="fa fa-fw fa-trash"></span> Odstranit uživatele</a>
+
     </div>
 </div>
 {control userEditForm}
\ No newline at end of file
diff --git a/app/FrontModule/templates/Transliteration/view.latte b/app/FrontModule/templates/Transliteration/view.latte
index ee30bfe..774c38f 100644
--- a/app/FrontModule/templates/Transliteration/view.latte
+++ b/app/FrontModule/templates/Transliteration/view.latte
@@ -9,7 +9,7 @@
 
         <div>
             <a n:href=":Admin:Book:edit $transliteration->id_book">edit book</a> |
-            <a href="#">edit transliteration info</a>
+            <a n:href=":Admin:Transliteration:edit#transliteration-info $transliteration->id">edit transliteration info</a>
         </div>
 
     </div>
@@ -86,7 +86,7 @@
     </div>
 
 
-    <a href="#">edit</a>
+    <a n:href=":Admin:Transliteration:edit#transliteration-data $transliteration->id">edit</a>
 
     <div class="container-fluid">
         {foreach $lineArray as $objectType => $surface}
