Card refinements
This commit is contained in:
@@ -897,10 +897,16 @@ def dashboard_active():
|
||||
out = []
|
||||
for row in rows:
|
||||
notificationtype = getattr(row, 'notificationtype', None)
|
||||
text = (row.notification or '').strip()
|
||||
out.append({
|
||||
'notificationid': row.notificationid,
|
||||
'message': (row.notification or '').strip()[:120],
|
||||
'typename': notificationtype.typename if notificationtype else None,
|
||||
# Trimmed for the card, whole text for the tooltip. A notification
|
||||
# is prose written for the floor, so the first hundred characters
|
||||
# are usually enough to recognise which one it is, and the rest is
|
||||
# there when it is not.
|
||||
'message': text[:100] + ('...' if len(text) > 100 else ''),
|
||||
'fullmessage': text,
|
||||
'typename': notificationtype.typename if notificationtype else 'Notification',
|
||||
'endtime': row.endtime.isoformat() + 'Z' if row.endtime else None,
|
||||
})
|
||||
return success_response(out)
|
||||
|
||||
Reference in New Issue
Block a user