mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-27 03:58:40 +02:00
Compare commits
13 Commits
wei
...
d6645900d3
Author | SHA1 | Date | |
---|---|---|---|
d6645900d3 | |||
e35847ebd8 | |||
57268bc9c2 | |||
ab6c943126 | |||
5dc5f56ae4 | |||
81017fc393 | |||
90e3871934 | |||
95e07f3148 | |||
770c748bd9 | |||
06fa096405 | |||
182f680507 | |||
5ceda66ded | |||
6443d64b69 |
@ -1,6 +1,8 @@
|
||||
# Copyright (C) 2018-2021 by BDE ENS Paris-Saclay
|
||||
# Copyright (C) 2018-2024 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import datetime
|
||||
|
||||
from django.utils import timezone
|
||||
from django.utils.html import escape
|
||||
from django.utils.safestring import mark_safe
|
||||
@ -75,6 +77,9 @@ def get_row_class(record):
|
||||
c += " table-info"
|
||||
elif record.note.balance < 0:
|
||||
c += " table-danger"
|
||||
# MODE VIEUXCON=ON
|
||||
if (datetime.datetime.utcnow().timestamp() - record.note.created_at.timestamp()) > 3600 * 24 * 365 * 2.5:
|
||||
c += " font-weight-bold underline"
|
||||
return c
|
||||
|
||||
|
||||
|
@ -223,12 +223,13 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
|
||||
# Keep only users that have a note
|
||||
note_qs = note_qs.filter(note__noteuser__isnull=False)
|
||||
|
||||
# Keep only members
|
||||
note_qs = note_qs.filter(
|
||||
note__noteuser__user__memberships__club=activity.attendees_club,
|
||||
note__noteuser__user__memberships__date_start__lte=timezone.now(),
|
||||
note__noteuser__user__memberships__date_end__gte=timezone.now(),
|
||||
)
|
||||
# if activity.activity_type.name != "Pot Vieux":
|
||||
# # Keep only members
|
||||
# note_qs = note_qs.filter(
|
||||
# note__noteuser__user__memberships__club=activity.attendees_club,
|
||||
# note__noteuser__user__memberships__date_start__lte=timezone.now(),
|
||||
# note__noteuser__user__memberships__date_end__gte=timezone.now(),
|
||||
# )
|
||||
|
||||
# Filter with permission backend
|
||||
note_qs = note_qs.filter(PermissionBackend.filter_queryset(self.request, Alias, "view"))
|
||||
|
@ -3111,6 +3111,22 @@
|
||||
"description": "Voir ceux nous ayant pour ami, pour toujours"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "permission.permission",
|
||||
"pk": 199,
|
||||
"fields": {
|
||||
"model": [
|
||||
"member",
|
||||
"membership"
|
||||
],
|
||||
"query": "{\"club\": 2}",
|
||||
"type": "view",
|
||||
"mask": 1,
|
||||
"field": "",
|
||||
"permanent": false,
|
||||
"description": "Voir les adhérents Kfet"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "permission.role",
|
||||
"pk": 1,
|
||||
@ -3593,7 +3609,9 @@
|
||||
168,
|
||||
176,
|
||||
177,
|
||||
197
|
||||
178,
|
||||
197,
|
||||
199
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -3,6 +3,10 @@
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Opaque tooltip with white background */
|
||||
.tooltip.show {
|
||||
opacity: 1;
|
||||
@ -65,10 +69,14 @@ mark {
|
||||
|
||||
/* Last BDE colors */
|
||||
.bg-primary {
|
||||
/* background-color: rgb(18, 67, 4) !important; */
|
||||
/* background-color: rgb(0, 0, 0) !important; */
|
||||
/* MODE VIEUXCON=ON */
|
||||
/*Listo/*
|
||||
/* background-color: rgb(166, 0, 2) !important; */
|
||||
background-color: rgb(0, 0, 0) !important;
|
||||
/*Finalist*/
|
||||
/* background-color: rgb(0, 119, 139) !important;*/
|
||||
/*Saperlist*/
|
||||
background-color: rgb(18, 67, 4) !important;
|
||||
}
|
||||
|
||||
html {
|
||||
@ -83,51 +91,113 @@ body {
|
||||
.btn-outline-primary:hover,
|
||||
.btn-outline-primary:not(:disabled):not(.disabled).active,
|
||||
.btn-outline-primary:not(:disabled):not(.disabled):active {
|
||||
color: rgb(241, 229, 52);
|
||||
/*Last BDE*/
|
||||
/* color: rgb(241, 229, 52);
|
||||
background-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);*/
|
||||
/*Pot Vieux*/
|
||||
/*Finalist*/
|
||||
/*color: #fff;
|
||||
background-color: rgb(0, 119, 139);
|
||||
border-color: rgb(0, 119, 139);*/
|
||||
/*Saperlist*/
|
||||
color: #fff;
|
||||
background-color: rgb(18, 67, 46);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
.btn-outline-primary {
|
||||
color: #fff;
|
||||
/*Last BDE*/
|
||||
/* color: #fff;
|
||||
background-color: #000;
|
||||
border-color: #464647;
|
||||
border-color: #464647;*/
|
||||
/*Pot Vieux*/
|
||||
/*Finalist*/
|
||||
/*color: rgb(0, 119, 139);
|
||||
background-color: rgba(248, 249, 250, 0.9);
|
||||
border-color: rgb(0, 119, 139);*/
|
||||
/*Saperlist*/
|
||||
color: rgb(18, 67, 46);
|
||||
background-color: rgba(248, 249, 250, 0.9);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
.turbolinks-progress-bar {
|
||||
/*Last BDE*/
|
||||
/*background-color: #12432E;*/
|
||||
/*Pot Vieux*/
|
||||
/*Finalist*/
|
||||
/*background-color: #01D3FB;*/
|
||||
/*Saperlist*/
|
||||
background-color: #12432E;
|
||||
}
|
||||
|
||||
.btn-primary:hover,
|
||||
.btn-primary:not(:disabled):not(.disabled).active,
|
||||
.btn-primary:not(:disabled):not(.disabled):active {
|
||||
color: rgb(241, 229, 52);
|
||||
/*Last BDE*/
|
||||
/* color: rgb(241, 229, 52);
|
||||
background-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);/*
|
||||
/*Pot Vieux*/
|
||||
/*Finalist*/
|
||||
/*color: #fff;
|
||||
background-color: rgb(0, 119, 139);
|
||||
border-color: rgb(0, 119, 139);*/
|
||||
/*Saperlist*/
|
||||
color: #fff;
|
||||
background-color: rgb(18, 67, 46);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
/*Last BDE*/
|
||||
/* color: #fff;
|
||||
background-color: #000;
|
||||
border-color: #adb5bd;
|
||||
border-color: #adb5bd;*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
color: rgba(248, 249, 250, 0.9);
|
||||
background-color: rgb(28, 114, 10);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
.border-primary {
|
||||
border-color: rgb(228, 35, 132) !important;
|
||||
/*Last BDE*/
|
||||
/* border-color: rgb(228, 35, 132) !important;*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
border-color: rgb(28, 114, 10) !important;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
color: #fff;
|
||||
/*Last BDE*/
|
||||
/* color: #fff;
|
||||
background-color: #000;
|
||||
border-color: #adb5bd;
|
||||
border-color: #adb5bd;*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
color: rgba(248, 249, 250, 0.9);
|
||||
background-color: rgb(28, 114, 10);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
.btn-secondary:hover,
|
||||
.btn-secondary:not(:disabled):not(.disabled).active,
|
||||
.btn-secondary:not(:disabled):not(.disabled):active {
|
||||
color: rgb(241, 229, 52);
|
||||
/*Last BDE*/
|
||||
/* color: rgb(241, 229, 52);
|
||||
background-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);/*
|
||||
/*Pot Vieux*/
|
||||
/*Finalist*/
|
||||
/*color: #fff;
|
||||
background-color: rgb(0, 119, 139);
|
||||
border-color: rgb(0, 119, 139);*/
|
||||
/*Saperlist*/
|
||||
color: #fff;
|
||||
background-color: rgb(18, 67, 46);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
|
||||
@ -139,25 +209,52 @@ body {
|
||||
.btn-outline-dark:hover,
|
||||
.btn-outline-dark:not(:disabled):not(.disabled).active,
|
||||
.btn-outline-dark:not(:disabled):not(.disabled):active {
|
||||
color: rgb(241, 229, 52);
|
||||
/*Last BDE*/
|
||||
/* color: rgb(241, 229, 52);
|
||||
background-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);
|
||||
border-color: rgb(228, 35, 132);*/
|
||||
/*Pot Vieux*/
|
||||
/*Finalist*/
|
||||
/*color: #fff;
|
||||
background-color: rgb(0, 119, 139);
|
||||
border-color: rgb(0, 119, 139);*/
|
||||
/*Saperlist*/
|
||||
color: #fff;
|
||||
background-color: rgb(18, 67, 46);
|
||||
border-color: rgb(18, 67, 46);
|
||||
}
|
||||
|
||||
|
||||
a {
|
||||
color: rgb(228, 35, 132);
|
||||
/*Last BDE*/
|
||||
/* color: rgb(228, 35, 132);*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
color: rgb(28, 114, 10);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: rgb(228, 35, 132);
|
||||
/*Last BDE*/
|
||||
/* color: rgb(228, 35, 132);*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
color: rgb(122, 163, 75);
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
box-shadow: 0 0 0 0.25rem rgb(228 35 132 / 50%);
|
||||
border-color: rgb(228, 35, 132);
|
||||
/*Last BDE*/
|
||||
/* box-shadow: 0 0 0 0.25rem rgb(228 35 132 / 50%);
|
||||
border-color: rgb(228, 35, 132);*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
box-shadow: 0 0 0 0.25rem rgba(122, 163, 75, 0.25);
|
||||
border-color: rgb(122, 163, 75);
|
||||
}
|
||||
|
||||
.btn-outline-primary.focus {
|
||||
box-shadow: 0 0 0 0.25rem rgb(228 35 132 / 10%);
|
||||
/*Last BDE*/
|
||||
/* box-shadow: 0 0 0 0.25rem rgb(228 35 132 / 10%);*/
|
||||
/*Pot Vieux*/
|
||||
/*Saperlist*/
|
||||
box-shadow: 0 0 0 0.25rem rgba(122, 163, 75, 0.5);
|
||||
}
|
||||
|
@ -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 < -2000) { 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) > 2.5) { css += ' font-weight-bold underline' }
|
||||
return css
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user