Card refinements

This commit is contained in:
2026-08-11 15:58:15 -04:00
parent 793dfab5c8
commit 721828b5cb
9 changed files with 134 additions and 38 deletions

View File

@@ -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)