FreedomBox/plinth/templates/notifications-dropdown.html
Sunil Mohan Adapa fb6cd03b5a
ui: Use collapse instead of dropdown for notification in Bootstrap 5
- In Bootstrap 5, dropdown button and dropdown menu not being siblings does not
work like it did in Bootstrap 4.

- Use collapse component instead of dropdown. Collapse component does not have
the same limitations. Apply some of the styling from dropdown-menu to restore
previous appearance.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 13:00:48 +02:00

29 lines
902 B
HTML

{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{# Template to display a drop down button for notifications in the navbar #}
{% load i18n %}
{% if notifications %}
<li class="nav-item notifications-dropdown">
<a href="#" title="{% trans "Notifications" %}"
class="nav-link dropdown-toggle" data-bs-toggle="collapse"
role="button" aria-expanded="false" aria-haspopup="true"
data-bs-target=".notifications">
<span class="fa fa-bell nav-icon"></span>
<span class="badge rounded-pill
{% if notifications_max_severity == 'exception' or notifications_max_severity == 'error' %}
text-bg-danger
{% elif notifications_max_severity == 'warning' %}
text-bg-warning
{% else %}
text-bg-info
{% endif %}">
{{ notifications|length }}
</span>
</a>
</li>
{% endif %}