mirror of
https://github.com/ae-utbm/sith3.git
synced 2024-06-01 04:19:43 +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;
|
||||
}
|
||||
}
|
||||
|
||||
&.empty-notification {
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
<div class="notification">
|
||||
<a href="#" onclick="display_notif()">
|
||||
<i class="fa fa-bell-o"></i>
|
||||
{% if user.notifications.filter(viewed=False).count() > 0 %}
|
||||
<span>
|
||||
{% if user.notifications.filter(viewed=False).count() < 100 %}
|
||||
{{ user.notifications.filter(viewed=False).count() }}
|
||||
|
@ -103,26 +104,31 @@
|
|||
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
<div id="header_notif">
|
||||
<ul>
|
||||
{% for n in user.notifications.filter(viewed=False).order_by('-date') %}
|
||||
<li>
|
||||
<a href="{{ url("core:notification", notif_id=n.id) }}">
|
||||
<div class="datetime">
|
||||
<span class="header_notif_date">
|
||||
{{ n.date|localtime|date(DATE_FORMAT) }}
|
||||
</span>
|
||||
<span class="header_notif_time">
|
||||
{{ n.date|localtime|time(DATETIME_FORMAT) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="reason">
|
||||
{{ n }}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% if user.notifications.filter(viewed=False).count() > 0 %}
|
||||
{% for n in user.notifications.filter(viewed=False).order_by('-date') %}
|
||||
<li>
|
||||
<a href="{{ url("core:notification", notif_id=n.id) }}">
|
||||
<div class="datetime">
|
||||
<span class="header_notif_date">
|
||||
{{ n.date|localtime|date(DATE_FORMAT) }}
|
||||
</span>
|
||||
<span class="header_notif_time">
|
||||
{{ n.date|localtime|time(DATETIME_FORMAT) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="reason">
|
||||
{{ n }}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li class="empty-notification">{% trans %}You do not have any unread notification{% endtrans %}</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="options">
|
||||
<a href="{{ url('core:notification_list') }}">
|
||||
|
|
|
@ -5723,6 +5723,10 @@ msgstr "Vous avez acheté %s"
|
|||
msgid "You have a 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
|
||||
msgid "Success!"
|
||||
msgstr "Succès !"
|
||||
|
|
Loading…
Reference in New Issue
Block a user