mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
notifications: Add datetime to each notification
- Notifications are displayed in a user-friendly "time ago" format. - Use last_update_time instead of created_time Sunil: - Some notifications don't have app name and app icon. Styling for those notification was different due to the last update time. Revert back to positioning for it. Use CSS float for it. - Use localized, locale specific date/time format for the tooltip. Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
efbf2a80f5
commit
bbeced68f7
@ -12,6 +12,14 @@
|
||||
<ul>
|
||||
{% for note in notifications %}
|
||||
<li class="notification notification-{{ note.severity }}">
|
||||
<div class="notification-header">
|
||||
<span class="notification-time"
|
||||
title="{{ note.last_update_time|date:'DATETIME_FORMAT' }}">
|
||||
{% blocktrans trimmed with time_since=note.last_update_time|timesince %}
|
||||
{{ time_since }} ago
|
||||
{% endblocktrans %}
|
||||
</span>
|
||||
|
||||
{% if note.data.app_name %}
|
||||
<div class="app-name">
|
||||
{% if note.data.app_icon %}
|
||||
@ -27,10 +35,10 @@
|
||||
class="notification-icon" />
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{{ note.data.app_name }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if note.body %}
|
||||
{{ note.body.content.decode|safe }}
|
||||
|
||||
@ -1020,6 +1020,12 @@ section.app-description {
|
||||
border-top: 1px solid var(--bs-border-color-translucent);
|
||||
}
|
||||
|
||||
.notification-time {
|
||||
float: right;
|
||||
font-size: 0.8rem;
|
||||
color: var(--bs-secondary-color);
|
||||
}
|
||||
|
||||
.notification-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user