Revize a8141f46
Přidáno uživatelem Filip Jani před téměř 6 roky(ů)
app/AdminModule/presenters/BookTypePresenter.php | ||
---|---|---|
5 | 5 |
|
6 | 6 |
use App\AdminModule\Components\IBookTypeEditFormFactory; |
7 | 7 |
use App\AdminModule\Components\IBookTypeGridFactory; |
8 |
use App\Enum\EFlashMessage; |
|
8 | 9 |
use App\Model\Repository\BookTypeRepository; |
10 |
use const Couchbase\ENCODER_FORMAT_IGBINARY; |
|
9 | 11 |
|
10 | 12 |
class BookTypePresenter extends BaseUserPresenter |
11 | 13 |
{ |
... | ... | |
39 | 41 |
public function actionEdit(int $id) |
40 | 42 |
{ |
41 | 43 |
$this['bookTypeEditForm']->setBookType($id); |
44 |
$this->template->id = $id; |
|
42 | 45 |
} |
43 | 46 |
|
44 | 47 |
/** |
... | ... | |
55 | 58 |
} |
56 | 59 |
} |
57 | 60 |
|
61 |
/** |
|
62 |
* Akce pro odstranění typu knihy |
|
63 |
* |
|
64 |
* @param int $id |
|
65 |
* @throws \Nette\Application\AbortException |
|
66 |
*/ |
|
67 |
public function actionDeleteBookType(int $id) |
|
68 |
{ |
|
69 |
if ($this->bookTypeRepository->findRow($id)->delete()) |
|
70 |
{ |
|
71 |
$this->flashMessage('Book type was removed.', EFlashMessage::SUCCESS); |
|
72 |
} else |
|
73 |
{ |
|
74 |
$this->flashMessage('Book type was not found.', EFlashMessage::ERROR); |
|
75 |
} |
|
76 |
|
|
77 |
$this->redirect('BookType:'); |
|
78 |
} |
|
79 |
|
|
58 | 80 |
public function createComponentBookTypeGrid() |
59 | 81 |
{ |
60 | 82 |
return $this->bookTypeGridFactory->create(); |
app/AdminModule/presenters/TransliterationPresenter.php | ||
---|---|---|
7 | 7 |
use App\AdminModule\Components\ITransliterationDataEditFormFactory; |
8 | 8 |
use App\AdminModule\Components\ITransliterationGridFactory; |
9 | 9 |
use App\AdminModule\Components\ITransliterationEditFormFactory; |
10 |
use App\Enum\EFlashMessage; |
|
10 | 11 |
use App\Model\Repository\TransliterationRepository; |
11 | 12 |
|
12 | 13 |
class TransliterationPresenter extends BaseUserPresenter |
... | ... | |
67 | 68 |
{ |
68 | 69 |
$this['transliterationEditForm']->setTransliteration($id); |
69 | 70 |
$this['transliterationDataEditForm']->setTransliteration($id); |
71 |
$this->template->id = $id; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Akce pro odstranění transliterace |
|
76 |
* |
|
77 |
* @param int $id |
|
78 |
* @throws \Nette\Application\AbortException |
|
79 |
*/ |
|
80 |
public function actionDeleteTransliteration(int $id) |
|
81 |
{ |
|
82 |
if ($this->transliterationRepository->findRow($id)->delete()) |
|
83 |
{ |
|
84 |
$this->flashMessage('Transliteration was removed.', EFlashMessage::SUCCESS); |
|
85 |
} else |
|
86 |
{ |
|
87 |
$this->flashMessage('Transliteration was not found', EFlashMessage::ERROR); |
|
88 |
} |
|
89 |
|
|
90 |
$this->redirect('Transliteration:'); |
|
70 | 91 |
} |
71 | 92 |
|
72 | 93 |
public function createComponentTransliterationGrid() |
app/AdminModule/templates/BookType/edit.latte | ||
---|---|---|
1 | 1 |
{block content} |
2 | 2 |
<div class="row"> |
3 |
<div class="col-11">
|
|
3 |
<div class="col-9">
|
|
4 | 4 |
<div class="display-5">Edit Book Type</div> |
5 | 5 |
</div> |
6 |
<div class="col-1">
|
|
6 |
<div class="col-3 text-right">
|
|
7 | 7 |
<a n:href="BookType:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Book type list</a> |
8 |
<a n:href="BookType:deleteBookType $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> |
|
8 | 9 |
</div> |
9 | 10 |
</div> |
10 | 11 |
{control bookTypeEditForm} |
app/AdminModule/templates/Transliteration/edit.latte | ||
---|---|---|
1 | 1 |
{block content} |
2 | 2 |
<div class="row"> |
3 |
<div class="col-5">
|
|
3 |
<div class="col-9">
|
|
4 | 4 |
<div class="display-5">Edit Transliteration</div> |
5 |
</div> |
|
5 | 6 |
|
7 |
<div class="col-3 text-right"> |
|
8 |
<a n:href="Transliteration:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Transliteration list</a> |
|
9 |
<a n:href="Transliteration:deleteTransliteration $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this transliteration?')"><span class="fa fa-fw fa-trash"></span> Delete transliteration</a> |
|
10 |
</div> |
|
11 |
</div> |
|
12 |
|
|
13 |
<div class="row"> |
|
14 |
<div class="col-5"> |
|
6 | 15 |
<fieldset id="transliteration-info"> |
7 | 16 |
<legend>Transliteration information</legend> |
8 | 17 |
|
... | ... | |
24 | 33 |
|
25 | 34 |
{block scripts} |
26 | 35 |
<script> |
27 |
$(function () { |
|
36 |
$(function () |
|
37 |
{ |
|
28 | 38 |
$.nette.init(); |
29 | 39 |
}); |
30 | 40 |
</script> |
Také k dispozici: Unified diff
Re #7593 odstraňování book type a transliterací