mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-08-04 14:31:12 +02:00
Compare commits
3 Commits
af97bc0a10
...
finito_sda
Author | SHA1 | Date | |
---|---|---|---|
|
414e103686 | ||
|
7975fe47a6 | ||
|
476fbceeea |
@@ -1,8 +1,6 @@
|
|||||||
# 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
|
||||||
@@ -79,9 +77,6 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
@@ -263,23 +263,13 @@ 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).exclude(note__inactivity_reason='forced')
|
note_qs = note_qs.filter(note__noteuser__isnull=False)
|
||||||
|
|
||||||
|
|
||||||
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(),
|
note__noteuser__user__memberships__date_end__gte=timezone.now()).exclude(note__inactivity_reason='forced')
|
||||||
# )
|
|
||||||
|
|
||||||
# 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"))
|
||||||
|
@@ -3800,54 +3800,6 @@
|
|||||||
"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,
|
||||||
@@ -4386,10 +4338,8 @@
|
|||||||
168,
|
168,
|
||||||
176,
|
176,
|
||||||
177,
|
177,
|
||||||
178,
|
|
||||||
197,
|
197,
|
||||||
211,
|
211
|
||||||
244
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -4427,7 +4377,7 @@
|
|||||||
238
|
238
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "wei.weirole",
|
"model": "wei.weirole",
|
||||||
"pk": 12,
|
"pk": 12,
|
||||||
|
74
note_kfet/static/css/custom.css
Normal file → Executable file
74
note_kfet/static/css/custom.css
Normal file → Executable file
@@ -65,7 +65,10 @@ 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(166, 0, 2) !important; */
|
||||||
|
background-color: rgb(100, 30, 100) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
@@ -80,54 +83,81 @@ 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: #fff;
|
color: rgb(240, 200, 240);
|
||||||
background-color: rgb(102, 83, 105);
|
background-color: rgb(30, 120, 150);
|
||||||
border-color: rgb(102, 83, 105);
|
border-color: rgb(190, 150, 190);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-primary {
|
.btn-outline-primary {
|
||||||
color: rgb(102, 83, 105);
|
color: #a2a;
|
||||||
background-color: rgba(248, 249, 250, 0.9);
|
background-color: #6bc;
|
||||||
border-color: rgb(102, 83, 105);
|
border-color: #719;
|
||||||
}
|
}
|
||||||
|
|
||||||
.turbolinks-progress-bar {
|
.turbolinks-progress-bar {
|
||||||
background-color: #12432E;
|
background-color: #12342E;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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: #fff;
|
color: rgb(150, 200, 240);
|
||||||
background-color: rgb(102, 83, 105);
|
background-color: rgb(50, 100, 140);
|
||||||
border-color: rgb(102, 83, 105);
|
border-color: rgb(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
color: rgba(248, 249, 250, 0.9);
|
color: #eae;
|
||||||
background-color: rgb(102, 83, 105);
|
background-color: #616;
|
||||||
border-color: rgb(102, 83, 105);
|
border-color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-primary {
|
.border-primary {
|
||||||
border-color: rgb(115, 15, 115) !important;
|
border-color: rgb(222, 180, 222) !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(102, 83, 105);
|
color: rgb(0, 150, 150);
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color: rgb(200, 30, 200);
|
color: rgb(200, 0, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
.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 rgb(0 150 150 / 50%);
|
||||||
border-color: rgb(200, 30, 200);
|
border-color: rgb(0, 200, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
.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 rgb(0 150 150 / 22%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -96,13 +96,11 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -158,12 +158,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
</div>
|
</div>
|
||||||
</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">
|
||||||
|
Reference in New Issue
Block a user