feat: allow marking read with very ugly double delete class

This commit is contained in:
2025-08-03 10:40:42 +02:00
parent bce98cb439
commit d5bc348453
2 changed files with 10 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Looks for all notifications with a delete and allows closing them when pressing delete
document.addEventListener('DOMContentLoaded', () => {
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
(document.querySelectorAll('.notification .delete:not(.js-delete-excluded)') || []).forEach(($delete) => {
const $notification = $delete.parentNode;
$delete.addEventListener('click', () => {

View File

@@ -1,12 +1,14 @@
{% load i18n %}
{% load custom_tags %}
<div class="notification">
<form class="delete" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="notification_mark_read">
<input type="hidden" name="notification_id" value="{{ notification.pk }}">
<button class="" type="submit" id="submit"></button>
</form>
<div class="notification {% if not notification.read %}is-info is-light{% endif %}">
{% if not notification.read %}
<form class="delete js-delete-excluded" method="POST">
{% csrf_token %}
<input type="hidden" name="action" value="notification_mark_read">
<input type="hidden" name="notification_id" value="{{ notification.pk }}">
<button class="delete js-delete-excluded" type="submit" id="submit"></button>
</form>
{% endif %}
<div class="notification-header">
<a href="{{ notification.url }}"><b>{{ notification.title }}</b></a>
<i class="card-timestamp">{{ notification.created_at|time_since_hr }}</i>