Remove duplicated mentions request from layout.html

This commit is contained in:
0x29a 2023-01-29 16:30:09 +01:00
parent 6ea2513790
commit 6e1418c5d4

View file

@ -25,7 +25,7 @@
{% block body %}
<nav class="navbar" aria-label="main navigation">
<div class="container">
{% with request.user.unread_notification_count as notification_count %}
{% with notification_count=request.user.unread_notification_count has_unread_mentions=request.user.has_unread_mentions %}
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="{% blocktrans with site_name=site.name %}{{ site_name }} home page{% endblocktrans %}">
@ -69,7 +69,7 @@
<i class="icon-dots-three-vertical" aria-hidden="true"></i>
<strong
class="{% if not notification_count %}is-hidden {% elif request.user.has_unread_mentions %}is-danger {% else %}is-primary {% endif %} tag is-small px-1"
class="{% if not notification_count %}is-hidden {% elif has_unread_mentions %}is-danger {% else %}is-primary {% endif %} tag is-small px-1"
data-poll-wrapper
>
<span class="is-sr-only">{% trans "Notifications" %}</span>
@ -108,7 +108,7 @@
</span>
</span>
<span
class="{% if not notification_count %}is-hidden {% elif request.user.has_unread_mentions %}is-danger {% endif %}tag is-medium transition-x"
class="{% if not notification_count %}is-hidden {% elif has_unread_mentions %}is-danger {% endif %}tag is-medium transition-x"
data-poll-wrapper
>
<span data-poll="notifications">{{ notification_count }}</span>