mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-04 00:55:18 +00:00
Fix notification (details in description)
- Fix the dot being displayed when the user has 0 notifications. - Added a message when there is no unread notification to be displayed.
This commit is contained in:
parent
0751785d3d
commit
6f6d65b663
@ -304,6 +304,11 @@
|
|||||||
font-size: .8em;
|
font-size: .8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.empty-notification {
|
||||||
|
text-align: center;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
<div class="notification">
|
<div class="notification">
|
||||||
<a href="#" onclick="display_notif()">
|
<a href="#" onclick="display_notif()">
|
||||||
<i class="fa fa-bell-o"></i>
|
<i class="fa fa-bell-o"></i>
|
||||||
|
{% if user.notifications.filter(viewed=False).count() > 0 %}
|
||||||
<span>
|
<span>
|
||||||
{% if user.notifications.filter(viewed=False).count() < 100 %}
|
{% if user.notifications.filter(viewed=False).count() < 100 %}
|
||||||
{{ user.notifications.filter(viewed=False).count() }}
|
{{ user.notifications.filter(viewed=False).count() }}
|
||||||
@ -103,26 +104,31 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
<div id="header_notif">
|
<div id="header_notif">
|
||||||
<ul>
|
<ul>
|
||||||
{% for n in user.notifications.filter(viewed=False).order_by('-date') %}
|
{% if user.notifications.filter(viewed=False).count() > 0 %}
|
||||||
<li>
|
{% for n in user.notifications.filter(viewed=False).order_by('-date') %}
|
||||||
<a href="{{ url("core:notification", notif_id=n.id) }}">
|
<li>
|
||||||
<div class="datetime">
|
<a href="{{ url("core:notification", notif_id=n.id) }}">
|
||||||
<span class="header_notif_date">
|
<div class="datetime">
|
||||||
{{ n.date|localtime|date(DATE_FORMAT) }}
|
<span class="header_notif_date">
|
||||||
</span>
|
{{ n.date|localtime|date(DATE_FORMAT) }}
|
||||||
<span class="header_notif_time">
|
</span>
|
||||||
{{ n.date|localtime|time(DATETIME_FORMAT) }}
|
<span class="header_notif_time">
|
||||||
</span>
|
{{ n.date|localtime|time(DATETIME_FORMAT) }}
|
||||||
</div>
|
</span>
|
||||||
<div class="reason">
|
</div>
|
||||||
{{ n }}
|
<div class="reason">
|
||||||
</div>
|
{{ n }}
|
||||||
</a>
|
</div>
|
||||||
</li>
|
</a>
|
||||||
{% endfor %}
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<li class="empty-notification">{% trans %}You do not have any unread notification{% endtrans %}</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
<a href="{{ url('core:notification_list') }}">
|
<a href="{{ url('core:notification_list') }}">
|
||||||
|
@ -5723,6 +5723,10 @@ msgstr "Vous avez acheté %s"
|
|||||||
msgid "You have a notification"
|
msgid "You have a notification"
|
||||||
msgstr "Vous avez une notification"
|
msgstr "Vous avez une notification"
|
||||||
|
|
||||||
|
#: core/templates/core/base.jinja
|
||||||
|
msgid "You do not have any unread notification"
|
||||||
|
msgstr "Vous n'avez aucune notification non lue"
|
||||||
|
|
||||||
#: sith/settings.py:624
|
#: sith/settings.py:624
|
||||||
msgid "Success!"
|
msgid "Success!"
|
||||||
msgstr "Succès !"
|
msgstr "Succès !"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user