Update dashboard

This commit is contained in:
Gregory Trullemans 2024-05-02 10:23:12 +02:00
parent 04722582ec
commit fc5a443b32
3 changed files with 16 additions and 10 deletions

View File

@ -9,16 +9,16 @@
<div class="col-md-3">
<div class="card">
<div class="card-header">
<h4><i class="fal fa-quote-left text-danger"></i> Quote</h4>
<h4><i class="fal fa-quote-left text-danger"></i> Quote of the day</h4>
</div>
<div class="card-body text-justify pb-0">
<div class="card-body text-justify pt-0 pb-0">
{{ quote.to_markdown | safe }}
</div>
{% if quote.author %}
<div class="card-footer text-right text-muted">
<div class="card-footer pt-0 text-right text-muted">
{% if quote.author %}
<i>{{ quote.author }}</i>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
<div class="col-md-6">
@ -27,7 +27,7 @@
<h4 class=""><i class="text-primary fal fa-laugh-wink"></i> Hi {{ user.first_name }} !</h4>
</div>
<div class="card-body text-justify pt-0">
<p>Welcome to Jarvi v0.97 <span class="text-muted">(last update : 18-4-2024)</span></p>
<p>Welcome to Jarvi v1.00 <span class="text-muted">(last update : 1-5-2024)</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>
</div>
@ -51,7 +51,8 @@
<div class="row">
<div class="col-md-7">
<ul class="list-unstyled mb-0">
{% if nb_active_gymnast %}<li>{{ nb_active_gymnast }} active gymnasts</li>{% endif %}
<li>{{ nb_active_gymnast }} active gymnasts</li>
<li>{{ nb_trainer }} active trainers</li>
{% if nb_event %}<li>{{ nb_event }} events</li>{% endif %}
{% if nb_score %}<li>{{ nb_score }} scores</li>{% endif %}
</ul>
@ -166,11 +167,12 @@
{% endfor %}
</table>
{% else %}
No next birtday (it's a bug).
<p class="text-muted">No next birtday (it's a bug).</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -13,6 +13,7 @@ from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django.template.loader import render_to_string
from django.urls import reverse
from django.contrib.auth import get_user_model
from jarvis.objective.models import Routine
from jarvis.profiles.models import Profile
@ -27,6 +28,8 @@ from jarvis.tools.models import Season
from .models import Citation
User = get_user_model()
def login(request):
"""Fonction d'authentifictation."""
@ -141,6 +144,7 @@ def home(request):
)
nb_active_gymnast = Gymnast.objects.filter(is_active=True).count()
nb_trainer = User.objects.filter(is_active=True, groups__name="trainer").count()
nb_event = Event.objects.all().count()
nb_skill = Skill.objects.all().count()
nb_routine = Routine.objects.all().count()
@ -174,6 +178,7 @@ def home(request):
"last_updated_gymnasts": last_updated_gymnasts,
"waiting_update_gymnast": waiting_update_gymnast,
"nb_active_gymnast": nb_active_gymnast,
"nb_trainer": nb_trainer,
"nb_event": nb_event,
"nb_skill": nb_skill,
"nb_routine": nb_routine,

View File

@ -42,7 +42,6 @@ from .forms import GymnastForm, UserForm
User = get_user_model()
@login_required
@require_http_methods(["POST"])
def gymnast_lookup(request):