1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-08-02 05:34:52 +02:00

Compare commits

...

16 Commits

Author SHA1 Message Date
quark
af97bc0a10 Les couleurs des surviva[list]s 2025-01-20 18:36:43 +01:00
quark
3faf611816 Merge main into potvieux 2025-01-20 17:43:25 +01:00
quark
2807b6ef44 Note en mode vieux pour la Kokarde de remise des diplomes 2024-05-30 22:06:51 +02:00
Nicolas Margulies
d6645900d3 PC Kfet can see kfet memberships to accurately display non-Kfet members in blue 2024-01-11 21:01:55 +01:00
Nicolas Margulies
e35847ebd8 Show old people with PC Kfet 2024-01-11 20:37:35 +01:00
Nicolas Margulies
57268bc9c2 Styling and catching late registrations as old 2024-01-11 19:48:41 +01:00
bleizi
ab6c943126 linters 2024-01-11 14:58:41 +01:00
bleizi
5dc5f56ae4 guests cannot be old 2024-01-11 14:38:43 +01:00
misterkrafts
81017fc393 Couleurs Splpp 2024-01-11 11:22:58 +01:00
misterkrafts
90e3871934 Merge branch 'main' into potvieux 2024-01-11 02:19:51 +01:00
misterkrafts
95e07f3148 New scripts 2024-01-10 18:09:53 +01:00
root
770c748bd9 couleurs finalist pour le pot vieux 2023-01-29 21:18:13 +01:00
Nicolas Margulies
06fa096405 Fina[list] colors 2023-01-27 20:42:00 +01:00
Pierre-antoine Comby
182f680507 Merge branch 'main' into potvieux 2023-01-27 19:00:02 +01:00
Pierre-antoine Comby
5ceda66ded use the right colors. 2022-04-01 08:54:57 +02:00
Pierre-antoine Comby
6443d64b69 View and Highlight Vieux people. 2022-04-01 08:54:05 +02:00
6 changed files with 101 additions and 59 deletions

View File

@@ -1,6 +1,8 @@
# Copyright (C) 2018-2024 by BDE ENS Paris-Saclay # Copyright (C) 2018-2024 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
@@ -77,6 +79,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 * 2.5:
c += " font-weight-bold underline"
return c return c

View File

@@ -263,13 +263,23 @@ class ActivityEntryView(LoginRequiredMixin, SingleTableMixin, TemplateView):
balance=F("note__balance")) balance=F("note__balance"))
# 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).exclude(note__inactivity_reason='forced')
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(),
)
# Keep only valid members # Keep only valid members
note_qs = note_qs.filter( # note_qs = note_qs.filter(
note__noteuser__user__memberships__club=activity.attendees_club, # note__noteuser__user__memberships__club=activity.attendees_club,
note__noteuser__user__memberships__date_start__lte=timezone.now(), # note__noteuser__user__memberships__date_start__lte=timezone.now(),
note__noteuser__user__memberships__date_end__gte=timezone.now()).exclude(note__inactivity_reason='forced') # 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

@@ -3800,6 +3800,54 @@
"description": "Voir les utilisateurs adhérents au club parent" "description": "Voir les utilisateurs adhérents au club parent"
} }
}, },
{
"model": "permission.permission",
"pk": 242,
"fields": {
"model": [
"note",
"transaction"
],
"query": "[\"AND\", {\"destination\": [\"club\", \"note\"]}, [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}}, {\"valid\": false}]]",
"type": "add",
"mask": 2,
"field": "",
"permanent": false,
"description": "Créer une transaction vers la note d'un club"
}
},
{
"model": "permission.permission",
"pk": 243,
"fields": {
"model": [
"member",
"profile"
],
"query": "{\"user__memberships__club\": [\"club\"], \"user__memberships__date_start__lte\": [\"today\"],\"user__memberships__date_end__gte\": [\"today\"]}",
"type": "view",
"mask": 3,
"field": "",
"permanent": false,
"description": "Voir les profils des membres du club"
}
},
{
"model": "permission.permission",
"pk": 244,
"fields": {
"model": [
"member",
"membership"
],
"query": "{\"club\": 2}",
"type": "view",
"mask": 1,
"field": "",
"permanent": false,
"description": "Voir les adhérent·e·s Kfet"
}
},
{ {
"model": "permission.role", "model": "permission.role",
"pk": 1, "pk": 1,
@@ -4338,8 +4386,10 @@
168, 168,
176, 176,
177, 177,
178,
197, 197,
211 211,
244
] ]
} }
}, },
@@ -4377,7 +4427,7 @@
238 238
] ]
} }
}, },
{ {
"model": "wei.weirole", "model": "wei.weirole",
"pk": 12, "pk": 12,

74
note_kfet/static/css/custom.css Executable file → Normal file
View File

@@ -65,10 +65,7 @@ mark {
/* Last BDE colors */ /* Last BDE colors */
.bg-primary { .bg-primary {
/* background-color: rgb(18, 67, 4) !important; */ background-color: rgb(102, 83, 105) !important;
/* MODE VIEUXCON=ON */
/* background-color: rgb(166, 0, 2) !important; */
background-color: rgb(100, 30, 100) !important;
} }
html { html {
@@ -83,81 +80,54 @@ body {
.btn-outline-primary:hover, .btn-outline-primary:hover,
.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: rgb(240, 200, 240); color: #fff;
background-color: rgb(30, 120, 150); background-color: rgb(102, 83, 105);
border-color: rgb(190, 150, 190); border-color: rgb(102, 83, 105);
} }
.btn-outline-primary { .btn-outline-primary {
color: #a2a; color: rgb(102, 83, 105);
background-color: #6bc; background-color: rgba(248, 249, 250, 0.9);
border-color: #719; border-color: rgb(102, 83, 105);
} }
.turbolinks-progress-bar { .turbolinks-progress-bar {
background-color: #12342E; background-color: #12432E;
} }
.btn-primary:hover, .btn-primary:hover,
.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: rgb(150, 200, 240); color: #fff;
background-color: rgb(50, 100, 140); background-color: rgb(102, 83, 105);
border-color: rgb(0, 0, 0); border-color: rgb(102, 83, 105);
} }
.btn-primary { .btn-primary {
color: #eae; color: rgba(248, 249, 250, 0.9);
background-color: #616; background-color: rgb(102, 83, 105);
border-color: #000000; border-color: rgb(102, 83, 105);
} }
.border-primary { .border-primary {
border-color: rgb(222, 180, 222) !important; border-color: rgb(115, 15, 115) !important;
} }
.btn-secondary {
color: #eae;
background-color: #616;
border-color: #000000;
}
.btn-secondary:hover,
.btn-secondary:not(:disabled):not(.disabled).active,
.btn-secondary:not(:disabled):not(.disabled):active {
color: rgb(150, 200, 240);
background-color: rgb(50, 100, 140);
border-color: rgb(0, 0, 0);
}
.btn-outline-dark {
color: #000000;
border-color: #000000;
}
.btn-outline-dark:hover,
.btn-outline-dark:not(:disabled):not(.disabled).active,
.btn-outline-dark:not(:disabled):not(.disabled):active {
color: rgb(50, 100, 160);
background-color: rgb(240, 150, 240);
border-color: rgb(50, 100, 160);
}
a { a {
color: rgb(0, 150, 150); color: rgb(102, 83, 105);
} }
a:hover { a:hover {
color: rgb(200, 0, 200); color: rgb(200, 30, 200);
} }
.form-control:focus { .form-control:focus {
box-shadow: 0 0 0 0.25rem rgb(0 150 150 / 50%); box-shadow: 0 0 0 0.25rem rgba(200, 30, 200, 0.25);
border-color: rgb(0, 200, 200); border-color: rgb(200, 30, 200);
} }
.btn-outline-primary.focus { .btn-outline-primary.focus {
box-shadow: 0 0 0 0.25rem rgb(0 150 150 / 22%); box-shadow: 0 0 0 0.25rem rgba(200, 30, 200, 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 < -2000) { css += ' text-danger bg-dark' } if (balance < -2000) { 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) > 2.5) { css += ' font-weight-bold underline' }
return css return css
} }

View File

@@ -159,6 +159,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
</nav> </nav>
<div class="{% block containertype %}container{% endblock %} my-3"> <div class="{% block containertype %}container{% endblock %} my-3">
<div id="messages"> <div id="messages">
{% if user.is_authenticated %}
<div class="alert alert-info">
Les fossiles sont à l'honneur cette semaine, la Note change d'habit rien pour elleux !
</div>
{% endif %}
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% if not user|is_member:"BDE" %} {% if not user|is_member:"BDE" %}
<div class="alert alert-danger"> <div class="alert alert-danger">