1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-27 11:58:54 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
95e07f3148 New scripts 2024-01-10 18:09:53 +01:00
770c748bd9 couleurs finalist pour le pot vieux 2023-01-29 21:18:13 +01:00
06fa096405 Fina[list] colors 2023-01-27 20:42:00 +01:00
182f680507 Merge branch 'main' into potvieux 2023-01-27 19:00:02 +01:00
5ceda66ded use the right colors. 2022-04-01 08:54:57 +02:00
6443d64b69 View and Highlight Vieux people. 2022-04-01 08:54:05 +02:00
5 changed files with 32 additions and 22 deletions

View File

@ -1,6 +1,8 @@
# Copyright (C) 2018-2021 by BDE ENS Paris-Saclay # Copyright (C) 2018-2021 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import datetime
from django.utils import timezone from django.utils import timezone
from django.utils.html import escape from django.utils.html import escape
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
@ -75,6 +77,9 @@ def get_row_class(record):
c += " table-info" c += " table-info"
elif record.note.balance < 0: elif record.note.balance < 0:
c += " table-danger" c += " table-danger"
#MODE VIEUXCON=ON
if (datetime.datetime.utcnow().timestamp() - record.note.created_at.timestamp()) > 3600*24*365*3:
c += " font-weight-bold"
return c return c

View File

@ -223,12 +223,13 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
# Keep only users that have a note # Keep only users that have a note
note_qs = note_qs.filter(note__noteuser__isnull=False) note_qs = note_qs.filter(note__noteuser__isnull=False)
# Keep only members # if activity.activity_type.name != "Pot Vieux":
note_qs = note_qs.filter( # # Keep only members
note__noteuser__user__memberships__club=activity.attendees_club, # note_qs = note_qs.filter(
note__noteuser__user__memberships__date_start__lte=timezone.now(), # note__noteuser__user__memberships__club=activity.attendees_club,
note__noteuser__user__memberships__date_end__gte=timezone.now(), # note__noteuser__user__memberships__date_start__lte=timezone.now(),
) # note__noteuser__user__memberships__date_end__gte=timezone.now(),
# )
# Filter with permission backend # Filter with permission backend
note_qs = note_qs.filter(PermissionBackend.filter_queryset(self.request, Alias, "view")) note_qs = note_qs.filter(PermissionBackend.filter_queryset(self.request, Alias, "view"))

View File

@ -65,7 +65,9 @@ mark {
/* Last BDE colors */ /* Last BDE colors */
.bg-primary { .bg-primary {
background-color: rgb(102, 83, 105) !important; /* background-color: rgb(18, 67, 4) !important; */
/* MODE VIEUXCON=ON */
background-color: rgb(0, 119, 139) !important;
} }
html { html {
@ -81,14 +83,14 @@ body {
.btn-outline-primary:not(:disabled):not(.disabled).active, .btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active { .btn-outline-primary:not(:disabled):not(.disabled):active {
color: #fff; color: #fff;
background-color: rgb(102, 83, 105); background-color: rgb(0, 119, 139);
border-color: rgb(102, 83, 105); border-color: rgb(0, 119, 139);
} }
.btn-outline-primary { .btn-outline-primary {
color: rgb(102, 83, 105); color: rgb(0, 119, 139);
background-color: rgba(248, 249, 250, 0.9); background-color: rgba(248, 249, 250, 0.9);
border-color: rgb(102, 83, 105); border-color: rgb(0, 119, 139);
} }
.turbolinks-progress-bar { .turbolinks-progress-bar {
@ -99,35 +101,35 @@ body {
.btn-primary:not(:disabled):not(.disabled).active, .btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:not(:disabled):not(.disabled):active { .btn-primary:not(:disabled):not(.disabled):active {
color: #fff; color: #fff;
background-color: rgb(102, 83, 105); background-color: rgb(0, 119, 139);
border-color: rgb(102, 83, 105); border-color: rgb(0, 119, 139);
} }
.btn-primary { .btn-primary {
color: rgba(248, 249, 250, 0.9); color: rgba(248, 249, 250, 0.9);
background-color: rgb(102, 83, 105); background-color: rgb(0, 119, 139);
border-color: rgb(102, 83, 105); border-color: rgb(0, 119, 139);
} }
.border-primary { .border-primary {
border-color: rgb(115, 15, 115) !important; border-color: rgb(0,85, 102) !important;
} }
a { a {
color: rgb(102, 83, 105); color: rgb(0, 119, 139);
} }
a:hover { a:hover {
color: rgb(200, 30, 200); color: rgb(0, 171, 205);
} }
.form-control:focus { .form-control:focus {
box-shadow: 0 0 0 0.25rem rgba(200, 30, 200, 0.25); box-shadow: 0 0 0 0.25rem rgba(0, 171, 205, 0.25);
border-color: rgb(200, 30, 200); border-color: rgb(0, 171, 205);
} }
.btn-outline-primary.focus { .btn-outline-primary.focus {
box-shadow: 0 0 0 0.25rem rgba(200, 30, 200, 0.5); box-shadow: 0 0 0 0.25rem rgba(0, 171, 205, 0.5);
} }

View File

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