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
|
// Looks for all notifications with a delete and allows closing them when pressing delete
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
|
(document.querySelectorAll('.notification .delete:not(.js-delete-excluded)') || []).forEach(($delete) => {
|
||||||
const $notification = $delete.parentNode;
|
const $notification = $delete.parentNode;
|
||||||
|
|
||||||
$delete.addEventListener('click', () => {
|
$delete.addEventListener('click', () => {
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load custom_tags %}
|
{% load custom_tags %}
|
||||||
<div class="notification">
|
<div class="notification {% if not notification.read %}is-info is-light{% endif %}">
|
||||||
<form class="delete" method="POST">
|
{% if not notification.read %}
|
||||||
{% csrf_token %}
|
<form class="delete js-delete-excluded" method="POST">
|
||||||
<input type="hidden" name="action" value="notification_mark_read">
|
{% csrf_token %}
|
||||||
<input type="hidden" name="notification_id" value="{{ notification.pk }}">
|
<input type="hidden" name="action" value="notification_mark_read">
|
||||||
<button class="" type="submit" id="submit"></button>
|
<input type="hidden" name="notification_id" value="{{ notification.pk }}">
|
||||||
</form>
|
<button class="delete js-delete-excluded" type="submit" id="submit"></button>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
<div class="notification-header">
|
<div class="notification-header">
|
||||||
<a href="{{ notification.url }}"><b>{{ notification.title }}</b></a>
|
<a href="{{ notification.url }}"><b>{{ notification.title }}</b></a>
|
||||||
<i class="card-timestamp">{{ notification.created_at|time_since_hr }}</i>
|
<i class="card-timestamp">{{ notification.created_at|time_since_hr }}</i>
|
||||||
|
Reference in New Issue
Block a user