Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Loufek committed Jun 8, 2020
1 parent 4724454 commit 1b78fe8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/AdminLTE/Login/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ protected function createComponentForm(): Form
/**
* @param Form $form
* @param ArrayHash<string, mixed> $values
* @throws \Nette\Application\AbortException
*/
public function process(Form $form, ArrayHash $values): void
{
Expand All @@ -82,6 +83,7 @@ public function process(Form $form, ArrayHash $values): void
$this->user->setExpiration('10 minutes');
}
$this->user->login($values->username, $values->password);
$this->redirect('this');

} catch (AuthenticationException $e) {
$form->addError($e->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion src/AdminLTE/Login/template.latte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="card-body login-card-body">
<p class="login-box-msg">{_"Sign in to start your session"}</p>
{form form}
<div n:foreach="$form->errors as $error" class="alert alert-error fade in">
<div n:foreach="$form->errors as $error" class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{$error|translate}
</div>
Expand Down
7 changes: 2 additions & 5 deletions src/AdminLTE/assets/custom/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
function initModals() {
$("[modal]").not(".modal-init").click(function(e) {
e.preventDefault();
$.ajax({
$.nette.ajax({
type: 'GET',
url: $(this).attr("href"),
data: {lte_no_layout: 1},
success: function (r) {
$("#modal .modal-content").html('<div class="mdl">'+r+'</div>');
$("#modal").modal("show");
initModals();
}
});
});
$("[modal]").not(".modal-init").addClass("modal-init");
}

initModals();
$(document).ajaxComplete(function() {
console.log(111);
initModals();
});
7 changes: 2 additions & 5 deletions src/AdminLTE/assets/full-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3941,24 +3941,21 @@ $( document ).ready(function() {
function initModals() {
$("[modal]").not(".modal-init").click(function(e) {
e.preventDefault();
$.ajax({
$.nette.ajax({
type: 'GET',
url: $(this).attr("href"),
data: {lte_no_layout: 1},
success: function (r) {
$("#modal .modal-content").html('<div class="mdl">'+r+'</div>');
$("#modal").modal("show");
initModals();
}
});
});
$("[modal]").not(".modal-init").addClass("modal-init");
}

initModals();
$(document).ajaxComplete(function() {
console.log(111);
initModals();
});

$('.sidebar-toggle').click(function(event) {
event.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/AdminLTE/assets/full-admin.min.js

Large diffs are not rendered by default.

0 comments on commit 1b78fe8

Please sign in to comment.