Creado mecanismo de generacion de alertas tipo Boostrap (defecto) y ToastR. Aplicado a los controladores existentes

This commit is contained in:
imnavajas
2023-07-26 22:36:57 +02:00
parent 47a6c3b62a
commit d25ff9666c
28 changed files with 2214 additions and 2195 deletions

View File

@ -10,32 +10,49 @@
<?= $this->section('additionalInlineJs') ?>
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
<?php if (session('sweet-success')) { ?>
toastr.success(`<?= session('sweet-success') ?>`);
<?php } ?>
<?php if (session('sweet-warning')) { ?>
toastr.success(`<?= session('sweet-warning') ?>`);
<?php } ?>
<?php if (session('sweet-error')) { ?>
toastr.success(`<?= session('sweet-error') ?>`);
<?php } ?>
<?php if (session('sweet-success')) {
if (isset($alertStyle) && ($alertStyle == 'toastr')) { ?>
toastr.success(`<?= session('sweet-success') ?>`);
<?php } else { ?>
popSuccessAlert(`<?= session('sweet-success') ?>`);
<?php }
}
?>
<?php if (session('sweet-warning')) {
if (isset($alertStyle) && ($alertStyle == 'toastr')) { ?>
toastr.warning(`<?= session('sweet-warning') ?>`);
<?php } else { ?>
popWarningAlert(`<?= session('sweet-warning') ?>`);
<?php }
}
?>
<?php if (session('sweet-error')) {
if (isset($alertStyle) && ($alertStyle == 'toastr')) { ?>
toastr.error(`<?= session('sweet-error') ?>`);
<?php } else { ?>
popErrorgAlert(`<?= session('sweet-error') ?>`);
<?php }
}
?>
<?= $this->endSection() ?>

View File

@ -134,7 +134,6 @@ if (!empty($token) && $tfa == false) {
aria-expanded="false"
>
<i class="ti ti-bell ti-md"></i>
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
</a>
</li>
<!--/ Notification -->