mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
ui: Dismiss notifications without page reload
- Delete only the <li> of the notification using HTMX. - Notifications list stays open. User can dismiss another notification. - Decrement notification counter using JavaScript after removing notification from the list. - Added HTMX to every kind of notification. - Tested dismissing notifications from the top, middle and bottom of the list. Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> [sunil: Update comment format in .js file] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
4e668c8a98
commit
13a575017c
6 files changed
+43
-1
No files matched your search
@@ -42,6 +42,9 @@
|
||||
{% trans "Go to Distribution Update" %}
|
||||
</a>
|
||||
<a href="{% url 'notification_dismiss' id=id %}?next={{ request.path|iriencode }}"
|
||||
hx-get="{% url 'notification_dismiss' id=id %}"
|
||||
hx-target="#notification-{{ id }}"
|
||||
hx-swap="delete swap:300ms"
|
||||
role="button" class="btn btn-default">
|
||||
{% trans "Dismiss" %}
|
||||
</a>
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
|
||||
<p>
|
||||
<a href="{% url 'notification_dismiss' id=id %}?next={{ request.path|iriencode }}"
|
||||
hx-get="{% url 'notification_dismiss' id=id %}"
|
||||
hx-target="#notification-{{ id }}"
|
||||
hx-swap="delete swap:300ms"
|
||||
role="button" class="btn btn-default">
|
||||
{% trans "Dismiss" %}
|
||||
</a>
|
||||
|
||||
Reference in new issue
Block a user