feat: allow marking read with very ugly double delete class
This commit is contained in:
@@ -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', () => {
|
||||
|
@@ -1,12 +1,14 @@
|
||||
{% load i18n %}
|
||||
{% load custom_tags %}
|
||||
<div class="notification">
|
||||
<form class="delete" method="POST">
|
||||
<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="" type="submit" id="submit"></button>
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user