Commit 92cb475a authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Amélioration des formats Toast et Alert Bootstrap

parent 27cc9987
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -9,12 +9,22 @@ use UnicaenAlerte\Entity\Db\Alerte;

<?php foreach ($alertes as $alerte): ?>

    <div class="unicaen-alerte alert alert-<?php echo $alerte->getSeverity() ?> alert-dismissible fade show" role="alert">
        <strong><span class="icon icon-<?php echo $alerte->getSeverity() ?>"></span><?php echo $alerte->getTitle() ?></strong> <br>
        <div class=""></div><?php echo $alerte->getText() ?>
    <div class="unicaen-alerte unicaen-alerte-<?php echo $severity = $alerte->getSeverity() ?>
                alert alert-<?php echo $severity ?> alert-dismissible
                fade show"
         role="alert">

        <strong>
            <span class="icon icon-<?php echo $severity ?>"></span>
            <?php echo $alerte->getTitle() ?>
        </strong>
        <br>
        <?php echo $alerte->getText() ?>

        <?php if ($alerte->isDismissible()): ?>
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Fermer"></button>
        <?php endif ?>

    </div>

<?php endforeach; ?>
+13 −7
Original line number Diff line number Diff line
@@ -7,11 +7,13 @@ use UnicaenAlerte\Entity\Db\Alerte;

?>

<div class="unicaen-alerte toast-container position-fixed p-3">
<div class="unicaen-alerte toast-container position-fixed p-3" style="z-index: 1000">

    <?php foreach ($alertes as $alerte): ?>

        <div class="unicaen-alerte toast show"
        <div class="unicaen-alerte
                    unicaen-alerte-<?php echo $severity = $alerte->getSeverity() ?>
                    toast"
            <?php if ($delay = $alerte->getDuration()): ?>
                data-bs-delay="<?php echo $delay ?>"
            <?php else: ?>
@@ -21,15 +23,19 @@ use UnicaenAlerte\Entity\Db\Alerte;
             aria-live="assertive"
             aria-atomic="true">

            <div class="toast-header">
                <span class="icon icon-<?php echo $alerte->getSeverity() ?>"></span>
                <strong class="me-auto"><?php echo $alerte->getTitle() ?></strong>
            <div class="toast-header text-<?php echo $severity ?>">
                <span class="icon icon-<?php echo $severity ?>"></span>
                <strong class="me-auto">
                    <?php echo $alerte->getTitle() ?>
                </strong>
                <!--<small>11 mins ago</small>-->

                <?php if ($alerte->isDismissible()): ?>
                    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
                    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Fermer"></button>
                <?php endif ?>
            </div>
            <div class="toast-body text-<?php echo $alerte->getSeverity() ?>">

            <div class="toast-body text-<?php echo $severity ?>">
                <?php echo $alerte->getText() ?>
            </div>