Minor modification in interface

This commit is contained in:
Gregory Trullemans 2023-06-22 13:14:56 +02:00
parent 98e38e8031
commit 333ba356bd
5 changed files with 57 additions and 51 deletions

View File

@ -26,7 +26,7 @@
<div class="card-header">
<h4 class=""><i class="text-primary fal fa-laugh-wink"></i> Hi {{ user.username }} !</h4>
</div>
<div class="card-body text-justify">
<div class="card-body text-justify pt-0">
<p>Welcome to Jarvi v0.84 <span class="text-muted">(last update : 19-06-2023)</span></p>
<p>This application is here to help coaches to manage the gymnasts (evolution, evaluation, routines, scores, …). This tool is not perfect so feel free to make improvement proposals, bug reports, … by sending me an <a href="mailto:gregory@flyingacrobaticstrampoline.be">email</a>.</p>
<p>You can find the user manual <a href="{% static "files/Manuel_Utilisateur.pdf" %}" download>here (in french)</a>.</p>
@ -38,7 +38,8 @@
<div class="card-header">
<h4><i class="fal fa-chart-area text-warning"></i> Statistics</h4>
</div>
<div class="card-body">
<div class="card-body pt-0">
Week {{ week_number }}
<div class="w-lg m-x-auto">
<div class="progress-container progress-primary">
<div class="progress">
@ -80,7 +81,7 @@
<div class="card-header">
<h4><i class="fal fa-calendar-alt text-warning"></i> Next Events</h4>
</div>
<div class="card-body">
<div class="card-body pt-0">
{% if event_list %}
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="event_table">
{% for event in event_list %}
@ -98,7 +99,7 @@
{% endfor %}
</table>
{% else %}
No future event defined
No future event defined.
{% endif %}
</div>
</div>
@ -109,7 +110,7 @@
<div class="card-header">
<h4><i class="fal fa-exclamation-triangle text-danger"></i> Updated needed</h4>
</div>
<div class="card-body">
<div class="card-body pt-0">
{% if waiting_update_gymnast %}
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="gymnast_table">
{% for gymnast in waiting_update_gymnast %}
@ -131,7 +132,7 @@
<div class="card-header">
<h4><i class="fal fa-highlighter text-success"></i> Last updated gymnasts</h4>
</div>
<div class="card-body">
<div class="card-body pt-0">
{% if last_updated_gymnast %}
<table class="table tablesorter table-striped table-condensed" data-sort="table" id="gymnast_table">
{% for gymnast in last_updated_gymnast %}
@ -142,7 +143,7 @@
{% endfor %}
</table>
{% else %}
No update since your last visit
No update since your last visit.
{% endif %}
</div>
</div>

View File

@ -91,14 +91,18 @@ def home(request):
"""
Génère la page d'accueil du site basée sur la saison (si celle-ci est connue)
"""
# print("In home function")
today = pendulum.now().date()
_, week_number = from_date_to_week_number(today)
week_number = 42
event_list = Event.objects.filter(date_begin__gte=timezone.now()).order_by(
"date_begin"
)[:10]
quote = Citation.objects.order_by("?").first()
# print(quote)
# mettre tout ca en cache.
# A METTRE EN CACHE.
# last_updated_gymnast = None
last_updated_gymnast = Gymnast.objects.filter(
Q(mindstate__created_at__gt=request.user.last_login)
| Q(points__created_at__gt=request.user.last_login)
@ -127,27 +131,26 @@ def home(request):
# (get_number_of_weeks_between(datetime(2021, 9, 1), datetime.now()) / 52) * 100
# )
date_begin = pendulum.now().date()
season, week_number = from_date_to_week_number(date_begin)
percentage_week = (week_number / 52) * 100
birthday_list = next_birthdays(request, 10)
# check if gymnast have point
# ---------------------------
# 1. récupérer tous les évènements passés
# 2. pour chaque event, vérifier que tous les gymnastes renseignés
# dans les participants ont des points associés.
# S'il n'y a pas de point, faire une alerte à l'utilisateur qui se connecte.
# # check if gymnast have point
# # ---------------------------
# # 1. récupérer tous les évènements passés
# # 2. pour chaque event, vérifier que tous les gymnastes renseignés
# # dans les participants ont des points associés.
# # S'il n'y a pas de point, faire une alerte à l'utilisateur qui se connecte.
# Check if gymnast have update
# -----------------------------
# lister tous les gymnastes qui n'ont pas eu d'update depuis... 2 semaines ?
# peut-être le paramètre (en jour) devrait être stocké en DB.
# S'il n'y a pas d'update, faire une alerte à l'utilisateur qui se connecte.
# # Check if gymnast have update
# # -----------------------------
# # lister tous les gymnastes qui n'ont pas eu d'update depuis... 2 semaines ?
# # peut-être le paramètre (en jour) devrait être stocké en DB.
# # S'il n'y a pas d'update, faire une alerte à l'utilisateur qui se connecte.
context = {
"quote": quote,
"week_number": week_number,
"event_list": event_list,
"last_updated_gymnast": last_updated_gymnast,
"waiting_update_gymnast": waiting_update_gymnast,
@ -160,7 +163,9 @@ def home(request):
"percentage_week": percentage_week,
"birthday_list": birthday_list,
}
# print("out home function")
return render(request, "dashboard/dashboard.html", context)
# return render(request, "dashboard/dashboard.html", {})
@login_required

View File

@ -493,26 +493,26 @@ def note_create_or_update(request, note_id=None, gymnast_id=None):
if form.is_valid():
new_note = form.save()
# if (
# (new_note.gymnast.user.email or new_note.gymnast.email_trainer)
# and ((not note_id) or (note_id and note.status == 0))
# and new_note.status == 1
# ):
# send_mail(
# "Nouvelle note",
# "Une nouvelle note vous a été envoyée",
# settings.EMAIL_HOST_USER,
# [new_note.gymnast.user.email, new_note.gymnast.email_trainer],
# fail_silently=False,
# html_message="""<p>Bonjour,</p>
# <p>Une nouvelle note vous a été envoyée. Vous pouvez la consulter en liquant <a href='"
# + request.build_absolute_uri(
# reverse(
# "gymnast_details_tab", args=(new_note.gymnast.id, "event")
# )
# )
# + "'>ici</a>.</p><br /><p>Excellente journée</p><p>Jarvis</p>""",
# )
if (
(new_note.gymnast.user.email or new_note.gymnast.email_trainer)
and ((not note_id) or (note_id and note.status == 0))
and new_note.status == 1
):
send_mail(
"Nouvelle note",
"Une nouvelle note vous a été envoyée",
settings.EMAIL_HOST_USER,
[new_note.gymnast.user.email, new_note.gymnast.email_trainer],
fail_silently=False,
html_message="""<p>Bonjour,</p>
<p>Une nouvelle note vous a été envoyée. Vous pouvez la consulter en cliquant <a href='"
+ request.build_absolute_uri(
reverse(
"gymnast_details_tab", args=(new_note.gymnast.id, "event")
)
)
+ "'>ici</a>.</p><br /><p>Excellente journée</p><p>Jarvis</p>""",
)
return HttpResponseRedirect(
reverse("gymnast_details_tab", args=(new_note.gymnast.id, "event"))
)

View File

@ -11,7 +11,7 @@
<p><a href="{% url 'report_choice' gymnast.id %}">Report</a></p>
<br />
<h5>Career</h5>
<p>(Under construction)</p>
<p class="text-muted">(Under construction)</p>
<br />
<h5>Evaluation</h5>
<p><a href="{% url 'gymnast_report_evaluation' gymnast.id %}">Report</a></p>

View File

@ -132,7 +132,7 @@
datasets: [
{% if score_routine1_list %}
{
label: 'R1',
label: 'Q1R1',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_1,
borderColor: 'rgb(255, 99, 132)',
@ -144,7 +144,7 @@
{% if score_routine2_list %}
{
label: 'R2',
label: 'Q1R2',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_2,
borderColor: 'rgb(255, 159, 64)',
@ -156,7 +156,7 @@
{% if score_routine3_list %}
{
label: 'R3',
label: 'Q2R1',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_3,
borderColor: 'rgb(54, 162, 235)',
@ -288,7 +288,7 @@
{% endif %}
{% if chrono_r1 %}
{
label: 'R1',
label: 'Q1R1',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_2,
borderColor: 'rgb(255, 99, 132)',
@ -299,7 +299,7 @@
{% endif %}
{% if chrono_r2 %}
{
label: 'R2',
label: 'Q1R2',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_3,
borderColor: 'rgb(255, 159, 64)',
@ -310,7 +310,7 @@
{% endif %}
{% if chrono_rf %}
{
label: 'R3',
label: 'Q2R1',
cubicInterpolationMode: 'monotone',
backgroundColor: gradient_stroke_4,
borderColor: 'rgb(255, 205, 86)',