<?php
if(!$myUser->can('notification','read')) throw new Exception("Vous n'avez pas la permission pour executer cette fonctionnalité",403);
require_once('Notification.class.php');
?>
<br>
<div class="row notifications-list">
    <!-- search results -->
    <div class="col-xl-12">
        <div class="left-pane">
            <h3>Notifications :</h3>
            <!-- <ul class="notification-listing">
                <li>
                    <span class="read-state-block">
                        <i class="fas fa-bell"></i> Vous avez N notifications non lues
                    </span>
                </li>
                <?php foreach(Notification::types() as $type): ?>
                <li>
                    <span class="" style="color:<?php echo $type['color']; ?>" title="<?php echo $type['description']; ?>" ><i class="<?php echo $type['icon']; ?>"></i> <?php echo $type['label']; ?></span>
                </li>
                <?php endforeach; ?>
            </ul> -->
        </div>
        <!-- Voir pour mettre en place un lazy loading -->
        <ul id="notifications" class="mid-pane notifications">
            <li data-id="{{id}}" class="hidden notification-item {{class}}" >
               <h4>{{label}}</h4>
               {{{html}}}
                <div class="notification-options">
                    <div class="btn-group btn-group-sm" role="group">
                         <div class="btn btn-info" title="Marquer comme {{readState}}" onclick="notification_user_notification_toggle_read(this);"><i class="fas fa-eye"></i></div> 
                         <div class="btn btn-danger" title="Supprimer la notification" onclick="notification_user_notification_delete(this);"><i class="far fa-trash-alt"></i></div>
                    </div>
                    <small>{{{created-relative}}}</small>
                </div>
            </li>
        </ul>        
    </div>
</div>
<br>