1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-23 10:56:35 +02:00

View and Highlight Vieux people.

This commit is contained in:
Pierre-antoine Comby
2022-04-01 08:53:18 +02:00
parent 3633f66a87
commit 6443d64b69
3 changed files with 14 additions and 6 deletions

View File

@ -96,11 +96,13 @@ function displayStyle (note) {
if (!note) { return '' }
const balance = note.balance
var css = ''
var ms_per_year = 31536000000 // 365 * 24 * 3600 * 1000
if (balance < -5000) { css += ' text-danger bg-dark' }
else if (balance < -1000) { css += ' text-danger' }
else if (balance < 0) { css += ' text-warning' }
if (!note.email_confirmed) { css += ' bg-primary' }
else if (!note.is_active || (note.membership && note.membership.date_end < new Date().toISOString())) { css += ' bg-info' }
if (((Date.now() - Date.parse(note.created_at))/ms_per_year) > 3) { css += 'font-weight-bold' }
return css
}