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:
parent
44db4b4aa2
commit
e04853ce5f
1 changed files with 11 additions and 1 deletions
|
@ -304,6 +304,8 @@ if ($account['Level'] != 'guest') {
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<?php echo($notifs['div']); ?>
|
||||||
|
|
||||||
<div id="fullscreen">
|
<div id="fullscreen">
|
||||||
<div id="middlerow">
|
<div id="middlerow">
|
||||||
<div id="notifs-list">
|
<div id="notifs-list">
|
||||||
|
@ -314,8 +316,16 @@ if ($account['Level'] != 'guest') {
|
||||||
2 => "sev-warning",
|
2 => "sev-warning",
|
||||||
3 => "sev-error"
|
3 => "sev-error"
|
||||||
);
|
);
|
||||||
|
$seen_class = array(
|
||||||
|
0 => "unseen",
|
||||||
|
1 => "seen"
|
||||||
|
);
|
||||||
foreach ($notifs['notifs'] as $n) {
|
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)'>✕</button>" .
|
||||||
|
"</div>\n");
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue