diff --git a/aleksis/core/templates/core/notifications.html b/aleksis/core/templates/core/notifications.html deleted file mode 100644 index d7201867376e8618d08d9511dd94675a1bce1553..0000000000000000000000000000000000000000 --- a/aleksis/core/templates/core/notifications.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends 'core/vue_base.html' %} -{% load i18n static dashboard %} - -{% block browser_title %}{% blocktrans %}Notifications{% endblocktrans %}{% endblock %} -{% block page_title %}{% blocktrans %}Notifications{% endblocktrans %}{% endblock %} - -{% block content %} - <notification-list/> -{% endblock %} diff --git a/aleksis/core/templates/core/vue_base.html b/aleksis/core/templates/core/vue_base.html index c8770d4f3107fbc9b2fecc87d7e01707459da179..8b7ff1418eef651ee8223b331383b70bd29fab0f 100644 --- a/aleksis/core/templates/core/vue_base.html +++ b/aleksis/core/templates/core/vue_base.html @@ -100,18 +100,18 @@ <v-spacer></v-spacer> <language-form action="{% url "set_language" %}" csrf_value={{ csrf_token }} next_url={{ request.get_full_path }}></language-form> {% if user.is_authenticated %} - <v-tooltip bottom> + <v-menu offset-y> <template v-slot:activator="{ on, attrs }"> - <v-btn icon href="{% url "notifications" %}" v-bind="attrs" v-on="on" color="white"> + <v-icon v-bind="attrs" v-on="on" color="white"> {% if request.user.person.unread_notifications_count > 0 %} - <v-icon>mdi-bell-badge-outline</v-icon> - {% else %} - <v-icon>mdi-bell-outline</v-icon> - {% endif %} + mdi-bell-badge-outline + {% else %} + mdi-bell-outline + {% endif %} </v-btn> </template> - <span>{% trans "Notifications" %}</span> - </v-tooltip> + <notification-list/> + </v-menu> <v-menu offset-y> <template v-slot:activator="{ on, attrs }"> <v-avatar v-bind="attrs" v-on="on"> @@ -119,7 +119,7 @@ </v-avatar> </template> {% get_menu "NAVBAR_ACCOUNT_MENU" as account_menu %} - <v-list id="account-dropdown" class="dropdown-content"> + <v-list> <v-subheader>REPORTS</v-subheader> {% for item in account_menu %} {% if item.divider %} diff --git a/aleksis/core/urls.py b/aleksis/core/urls.py index 90050a62aff81decafad432fb4f441c442a11d47..87f601c397be18f2e0df634a70e82f0c2fb4f810 100644 --- a/aleksis/core/urls.py +++ b/aleksis/core/urls.py @@ -95,7 +95,6 @@ urlpatterns = [ path("group/<int:id_>/edit", views.edit_group, name="edit_group_by_id"), path("group/<int:id_>/delete", views.delete_group, name="delete_group_by_id"), path("", views.index, name="index"), - path("notifications/", views.NotificationsListView.as_view(), name="notifications"), path("dashboard/edit/", views.EditDashboardView.as_view(), name="edit_dashboard"), path( "notifications/mark-read/<int:id_>", diff --git a/aleksis/core/views.py b/aleksis/core/views.py index ea910292f63c7e1fdba3f7144b4128641d2b1446..df90a6020afa77b13351bddf170143ac95ed3c2c 100644 --- a/aleksis/core/views.py +++ b/aleksis/core/views.py @@ -248,20 +248,6 @@ def index(request: HttpRequest) -> HttpResponse: return render(request, "core/index.html", context) -class NotificationsListView(PermissionRequiredMixin, ListView): - permission_required = "core.view_notifications_rule" - template_name = "core/notifications.html" - - def get_queryset(self) -> QuerySet: - return self.request.user.person.notifications.filter(send_at__lte=timezone.now()).order_by( - "-created" - ) - - def get_context_data(self, **kwargs: Any) -> dict[str, Any]: - self.get_queryset().filter(read=False).update(read=True) - return super().get_context_data(**kwargs) - - def about(request: HttpRequest) -> HttpResponse: """About page listing all apps.""" context = {}