Skip to content
Snippets Groups Projects
Verified Commit 5dffe587 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Drop old notification page

parent b538dd67
No related branches found
No related tags found
1 merge request!1125Resolve "[Vue] Notifications look ugly"
......@@ -78,14 +78,6 @@
{% if user.is_authenticated %}
<ul class="account-nav">
{% trans "Notifications" as notifications_text %}
<li>
<a href="{% url "notifications" %}" data-position="bottom"
class="tooltipped {% if request.user.person.unread_notifications_count > 0 %}new-notification{% endif %}"
data-tooltip="{{ notifications_text }}" aria-label="{{ notifications_text }}">
<i class="material-icons iconify" data-icon="mdi:bell-outline"></i>
</a>
</li>
<li>
<a href="#!" class="navbar-dropdown-trigger" data-target="account-dropdown">
{{ request.user.person.identicon }}
......
......@@ -38,9 +38,9 @@
</div>
{% endif %}
{% if activities or notifications %}
{% if activities %}
<div class="row">
<div class="col s12 m6">
<div class="col s12">
<h2>{% blocktrans %}Last activities{% endblocktrans %}</h2>
{% if activities %}
......@@ -62,34 +62,6 @@
<p>{% blocktrans %}No activities available yet.{% endblocktrans %}</p>
{% endif %}
</div>
<div class="col s12 m6">
<h2>{% blocktrans %}Recent notifications{% endblocktrans %}</h2>
{% if notifications %}
<ul class="collection">
{% for notification in notifications %}
<li class="collection-item">
<span class="badge new primary-color">{{ notification.sender }}</span>
<span class="title">{{ notification.title }}</span>
<p>
<i class="material-icons left iconify" data-icon="mdi:clock-outline"></i> {{ notification.created }}
</p>
<p>
{{ notification.description }}
</p>
{% if notification.link %}
<p>
<a href="{{ notification.link }}">{% blocktrans %}More information →{% endblocktrans %}</a>
</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<p>{% blocktrans %}No notifications available yet.{% endblocktrans %}</p>
{% endif %}
</div>
</div>
{% endif %}
......
......@@ -94,7 +94,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("groups/group_type/create", views.edit_group_type, name="create_group_type"),
path(
......
......@@ -218,16 +218,8 @@ def index(request: HttpRequest) -> HttpResponse:
widgets = []
activities = person.activities.all().order_by("-created")[:5]
notifications = person.notifications.filter(send_at__lte=timezone.now()).order_by("-created")[
:5
]
unread_notifications = person.notifications.filter(
send_at__lte=timezone.now(), read=False
).order_by("-created")
context["activities"] = activities
context["notifications"] = notifications
context["unread_notifications"] = unread_notifications
announcements = Announcement.objects.at_time().for_person(person)
context["announcements"] = announcements
......@@ -247,18 +239,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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment