mustard: notifs: Aggiunto bottone per leggere le notifiche.

* web/mustard/notifs.php: Aggiunto bottone che chiama la funzione JS
  markread per marcare come letta la notifica.
This commit is contained in:
paul 2020-05-15 20:09:31 +02:00 committed by Giacomo Leidi
parent 44db4b4aa2
commit e04853ce5f

View file

@ -304,6 +304,8 @@ if ($account['Level'] != 'guest') {
</div>
</nav>
<?php echo($notifs['div']); ?>
<div id="fullscreen">
<div id="middlerow">
<div id="notifs-list">
@ -314,8 +316,16 @@ if ($account['Level'] != 'guest') {
2 => "sev-warning",
3 => "sev-error"
);
$seen_class = array(
0 => "unseen",
1 => "seen"
);
foreach ($notifs['notifs'] as $n) {
echo("<div id=\"notif-" . $n["ID"] . "\" class=\"" . $sev_classes[$n["Severity"]] . "\">" . $n["Notification"] . "</div>\n");
echo("<div id=\"notif-" . $n["ID"] .
"\" class=\"" . $sev_classes[$n["Severity"]] . " " . $seen_class[$n["Seen"]] . "\">" .
$n["Notification"] .
"<button type='button' onclick='markread(this.parentElement)'>&#x2715</button>" .
"</div>\n");
}
} ?>
</div>