Revize c93cf853
Přidáno uživatelem Petr Lukašík před téměř 6 roky(ů)
app/AdminModule/component/Transliteration/TransliterationGrid.php | ||
---|---|---|
181 | 181 |
->setClass('btn btn-xs btn-danger ajax'); |
182 | 182 |
|
183 | 183 |
$this->addExportCallback( |
184 |
'Export dat', |
|
184 |
'Export data',
|
|
185 | 185 |
function ($dataSource, $grid) |
186 | 186 |
{ |
187 | 187 |
$this->exportData($dataSource, $grid); |
app/AdminModule/component/User/UserEditForm.latte | ||
---|---|---|
1 | 1 |
<div class="row"> |
2 | 2 |
<div class="col-4"> |
3 | 3 |
<fieldset> |
4 |
<legend>Editace uživatele</legend>
|
|
4 |
<legend>User edit</legend>
|
|
5 | 5 |
|
6 | 6 |
{control form} |
7 | 7 |
</fieldset> |
app/AdminModule/component/User/UserEditForm.php | ||
---|---|---|
64 | 64 |
|
65 | 65 |
public function createComponentForm() |
66 | 66 |
{ |
67 |
$this->form->addText(UserRepository::COLUMN_USERNAME, 'Uživatelské jméno');
|
|
67 |
$this->form->addText(UserRepository::COLUMN_USERNAME, 'Username');
|
|
68 | 68 |
$this->form->addText(UserRepository::COLUMN_LOGIN, 'Login') |
69 | 69 |
->setRequired(TRUE); |
70 | 70 |
|
71 |
$password = $this->form->addPassword(UserRepository::COLUMN_PASSWORD, 'Heslo');
|
|
72 |
$passwordConfirm = $this->form->addPassword(self::PASSWORD_CONFIRM, 'Potvrzení hesla')
|
|
71 |
$password = $this->form->addPassword(UserRepository::COLUMN_PASSWORD, 'Password');
|
|
72 |
$passwordConfirm = $this->form->addPassword(self::PASSWORD_CONFIRM, 'Confirm password')
|
|
73 | 73 |
->addConditionOn($password, Form::FILLED, TRUE) |
74 |
->addRule(Form::EQUAL, 'Hesla se musejí shodovat.', $password)
|
|
75 |
->addRule(Form::REQUIRED, 'Pole %label je povinné')
|
|
74 |
->addRule(Form::EQUAL, 'Passwords must match!', $password)
|
|
75 |
->addRule(Form::REQUIRED, 'Field %label is required')
|
|
76 | 76 |
->endCondition(); |
77 | 77 |
|
78 | 78 |
if (empty($this->userId)) |
79 | 79 |
{ |
80 |
$password->addRule(Form::REQUIRED, 'Pole %label je povinné', TRUE);
|
|
81 |
$passwordConfirm->addRule(Form::REQUIRED, 'Pole %label je povinné');
|
|
80 |
$password->addRule(Form::REQUIRED, 'Field %label is required', TRUE);
|
|
81 |
$passwordConfirm->addRule(Form::REQUIRED, 'Field %label is required');
|
|
82 | 82 |
} |
83 | 83 |
|
84 |
$this->form->addSelect(UserRoleRepository::COLUMN_ROLE_ID, 'Role uživatele', $this->getRoles())
|
|
85 |
->setPrompt('- Vyberte roli -')
|
|
86 |
->addRule(Form::REQUIRED, '%label musí být vybrána.', TRUE);
|
|
84 |
$this->form->addSelect(UserRoleRepository::COLUMN_ROLE_ID, 'User Role', $this->getRoles())
|
|
85 |
->setPrompt('- Choose role -')
|
|
86 |
->addRule(Form::REQUIRED, '%label must be picked.', TRUE);
|
|
87 | 87 |
$this->form->addText(UserRepository::COLUMN_EMAIL, 'E-mail') |
88 |
->addRule(Form::EMAIL, 'Prvek %label musí obsahovat validní e-mail.')
|
|
88 |
->addRule(Form::EMAIL, 'Field %label must contain valid e-mail.')
|
|
89 | 89 |
->setRequired(FALSE); |
90 | 90 |
|
91 | 91 |
$this->form->setDefaults($this->getDefaults()); |
92 | 92 |
|
93 |
$submitText = empty($this->userId) ? 'Přidat uživatele' : 'Upravit uživatele';
|
|
93 |
$submitText = empty($this->userId) ? 'Add user' : 'Edit user';
|
|
94 | 94 |
$this->form->addSubmit('submit', $submitText); |
95 | 95 |
|
96 | 96 |
$this->form->onValidate[] = [$this, 'formValidate']; |
... | ... | |
113 | 113 |
{ |
114 | 114 |
if ($this->userRepository->findByLogin($values->{UserRepository::COLUMN_LOGIN})) |
115 | 115 |
{ |
116 |
$form->addError('Uživatel se zadaným loginem již existuje.');
|
|
116 |
$form->addError('User with this login already exists.');
|
|
117 | 117 |
} |
118 | 118 |
} |
119 | 119 |
} |
... | ... | |
124 | 124 |
|
125 | 125 |
if ($result) |
126 | 126 |
{ |
127 |
$this->presenter->flashMessage('Uživatel byl úspěšně upraven.', EFlashMessage::SUCCESS);
|
|
127 |
$this->presenter->flashMessage('User was successfully edited.', EFlashMessage::SUCCESS);
|
|
128 | 128 |
$this->presenter->redirect('User:edit', ['id' => $result->{UserRepository::COLUMN_ID}]); |
129 | 129 |
} else |
130 | 130 |
{ |
131 |
$form->addError('Uživatele se nepodařilo upravit.');
|
|
131 |
$form->addError('Failed to edit user.');
|
|
132 | 132 |
} |
133 | 133 |
} |
134 | 134 |
|
app/AdminModule/component/User/UserGrid.php | ||
---|---|---|
19 | 19 |
{ |
20 | 20 |
$this->userRepository = $userRepository; |
21 | 21 |
|
22 |
parent::__construct(); |
|
22 |
parent::__construct(false);
|
|
23 | 23 |
} |
24 | 24 |
|
25 | 25 |
/** |
... | ... | |
44 | 44 |
{ |
45 | 45 |
// Definice sloupečků |
46 | 46 |
$this->addColumnNumber(UserRepository::COLUMN_ID, 'ID')->setDefaultHide(TRUE); |
47 |
$this->addColumnText(UserRepository::COLUMN_USERNAME, 'Uživatel');
|
|
47 |
$this->addColumnText(UserRepository::COLUMN_USERNAME, 'User');
|
|
48 | 48 |
$this->addColumnText(UserRepository::COLUMN_LOGIN, 'Login'); |
49 | 49 |
$this->addColumnText(UserRepository::COLUMN_EMAIL, 'Email'); |
50 | 50 |
|
51 | 51 |
// Definice filtrů |
52 |
$this->addFilterText(UserRepository::COLUMN_USERNAME, 'Uživatel');
|
|
52 |
$this->addFilterText(UserRepository::COLUMN_USERNAME, 'User');
|
|
53 | 53 |
$this->addFilterText(UserRepository::COLUMN_LOGIN, 'Login'); |
54 | 54 |
$this->addFilterText(UserRepository::COLUMN_EMAIL, 'Email'); |
55 | 55 |
|
56 | 56 |
// Akce |
57 |
$this->addAction('edit', 'upravit', 'User:edit', ['id' => UserRepository::COLUMN_ID])
|
|
58 |
->setTitle('Editovat');
|
|
57 |
$this->addAction('edit', 'edit', 'User:edit', ['id' => UserRepository::COLUMN_ID])
|
|
58 |
->setTitle('Edit'); |
|
59 | 59 |
|
60 |
$this->addAction('delete', 'smazat', 'deleteUser!', ['id' => UserRepository::COLUMN_ID])
|
|
61 |
->setConfirm('Opravdu chcete uživatele "%s" odstranit?', UserRepository::COLUMN_LOGIN)
|
|
62 |
->setTitle('Odstranit')
|
|
60 |
$this->addAction('delete', 'delete', 'deleteUser!', ['id' => UserRepository::COLUMN_ID])
|
|
61 |
->setConfirm('Do you really want to delete user "%s"?', UserRepository::COLUMN_LOGIN)
|
|
62 |
->setTitle('Delete')
|
|
63 | 63 |
->setClass('btn btn-xs btn-danger ajax'); |
64 | 64 |
} |
65 | 65 |
} |
app/AdminModule/templates/User/add.latte | ||
---|---|---|
1 | 1 |
{block content} |
2 | 2 |
<div class="row"> |
3 | 3 |
<div class="col-10"> |
4 |
<div class="display-5">Administrace - Nový uživatel</div>
|
|
4 |
<div class="display-5">Administration - New user</div>
|
|
5 | 5 |
</div> |
6 | 6 |
<div class="col-2 text-right"> |
7 |
<a n:href="User:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Seznam uživatelů</a>
|
|
7 |
<a n:href="User:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Users list</a>
|
|
8 | 8 |
</div> |
9 | 9 |
</div> |
10 | 10 |
{control userEditForm} |
app/AdminModule/templates/User/default.latte | ||
---|---|---|
1 | 1 |
{block content} |
2 | 2 |
<div class="row"> |
3 | 3 |
<div class="col-10"> |
4 |
<div class="display-5">Administrace - Seznam uživatelů</div>
|
|
4 |
<div class="display-5">Administration - Users list</div>
|
|
5 | 5 |
</div> |
6 | 6 |
<div class="col-2 text-right"> |
7 |
<a n:href="User:add" class="btn btn-sm btn-success"><span class="fa fa-fw fa-plus"></span> Přidat uživatele</a>
|
|
7 |
<a n:href="User:add" class="btn btn-sm btn-success"><span class="fa fa-fw fa-plus"></span> Add user</a>
|
|
8 | 8 |
</div> |
9 | 9 |
</div> |
10 | 10 |
<div class="row"> |
app/AdminModule/templates/User/edit.latte | ||
---|---|---|
1 | 1 |
{block content} |
2 | 2 |
<div class="row"> |
3 | 3 |
<div class="col-9"> |
4 |
<div class="display-5">Administrace - Editace uživatele</div>
|
|
4 |
<div class="display-5">Administration - User edit</div>
|
|
5 | 5 |
</div> |
6 | 6 |
<div class="col-3 text-right"> |
7 |
<a n:href="User:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Seznam uživatelů</a>
|
|
8 |
<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>
|
|
7 |
<a n:href="User:default" class="btn btn-sm btn-success"><span class="fa fa-fw fa-list"></span> Users list</a>
|
|
8 |
<a n:href="User:deleteUser $id" class="btn btn-sm btn-danger" onclick="return confirm('Do you really want to delete this user?')"><span class="fa fa-fw fa-trash"></span> Delete user</a>
|
|
9 | 9 |
|
10 | 10 |
</div> |
11 | 11 |
</div> |
Také k dispozici: Unified diff
Re #7610 lokalizace do češtiny