mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-08-04 06:30:27 +02:00
Compare commits
20 Commits
af97bc0a10
...
Automation
Author | SHA1 | Date | |
---|---|---|---|
|
a209e0d366 | ||
|
ef485e0628 | ||
|
1481aa0635 | ||
|
867bf9fd25 | ||
|
47fda0ea36 | ||
|
623290827a | ||
|
a87ce625f3 | ||
|
3559787fa7 | ||
|
bd6ed27ae5 | ||
|
43dc676747 | ||
|
caaeab6b0b | ||
|
54ba786884 | ||
|
80e109114f | ||
|
787005e60d | ||
|
414e103686 | ||
|
942d887c2e | ||
|
a63c34fe37 | ||
|
2be6133458 | ||
|
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)
|
||||||
|
|
||||||
|
# Keep only valid members
|
||||||
if activity.activity_type.name != "Pot Vieux":
|
|
||||||
# Keep only 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')
|
||||||
)
|
|
||||||
|
|
||||||
# Keep only valid 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
|
# 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"))
|
||||||
|
@@ -44,7 +44,8 @@ class ProfileForm(forms.ModelForm):
|
|||||||
"""
|
"""
|
||||||
A form for the extras field provided by the :model:`member.Profile` model.
|
A form for the extras field provided by the :model:`member.Profile` model.
|
||||||
"""
|
"""
|
||||||
report_frequency = forms.IntegerField(required=False, initial=0, label=_("Report frequency"))
|
# Remove widget=forms.HiddenInput() if you want to use report frequency.
|
||||||
|
report_frequency = forms.IntegerField(required=False, initial=0, label=_("Report frequency"), widget=forms.HiddenInput())
|
||||||
|
|
||||||
last_report = forms.DateTimeField(required=False, disabled=True, label=_("Last report date"))
|
last_report = forms.DateTimeField(required=False, disabled=True, label=_("Last report date"))
|
||||||
|
|
||||||
@@ -76,7 +77,8 @@ class ProfileForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Profile
|
model = Profile
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
exclude = ('user', 'email_confirmed', 'registration_valid', )
|
# Remove ml_[asso]_registration from exclude if the concerned association uses nk20 to manage its mailing list.
|
||||||
|
exclude = ('user', 'email_confirmed', 'registration_valid', 'ml_sport_registration', )
|
||||||
|
|
||||||
|
|
||||||
class ImageForm(forms.Form):
|
class ImageForm(forms.Form):
|
||||||
|
@@ -31,3 +31,4 @@ class RoleAdmin(admin.ModelAdmin):
|
|||||||
Admin customisation for Role
|
Admin customisation for Role
|
||||||
"""
|
"""
|
||||||
list_display = ('name', )
|
list_display = ('name', )
|
||||||
|
filter_horizontal = ('permissions',)
|
||||||
|
@@ -3832,22 +3832,6 @@
|
|||||||
"description": "Voir les profils des membres du club"
|
"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 +4370,8 @@
|
|||||||
168,
|
168,
|
||||||
176,
|
176,
|
||||||
177,
|
177,
|
||||||
178,
|
|
||||||
197,
|
197,
|
||||||
211,
|
211
|
||||||
244
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -26,3 +26,5 @@ MAILTO=notekfet2020@lists.crans.org
|
|||||||
00 9 * * * root cd /var/www/note_kfet && env/bin/python manage.py refresh_highlighted_buttons -v 0
|
00 9 * * * root cd /var/www/note_kfet && env/bin/python manage.py refresh_highlighted_buttons -v 0
|
||||||
# Vider les tokens Oauth2
|
# Vider les tokens Oauth2
|
||||||
00 6 * * * root cd /var/www/note_kfet && env/bin/python manage.py cleartokens -v 0
|
00 6 * * * root cd /var/www/note_kfet && env/bin/python manage.py cleartokens -v 0
|
||||||
|
# Envoyer la liste des abonnés à la NL BDA
|
||||||
|
00 8 * * 0 root cd /var/www/note_kfet && env/bin/python manage.py extract_ml_registrations -t art -v 0
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -159,11 +159,6 @@ 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">
|
||||||
|
Reference in New Issue
Block a user