Comma to dot

This commit is contained in:
Gregory Trullemans 2022-02-15 17:49:35 +01:00
parent 76666b243c
commit 65590b0468
2 changed files with 20 additions and 2 deletions

View File

@ -11,8 +11,16 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
from pathlib import Path
import environ
# import sentry_sdk
from pathlib import Path
# from sentry_sdk.integrations.django import DjangoIntegration
# Sentry
# sentry_sdk.init(
# dsn=os.environ['SENTRY_DSN'],
# integrations=[DjangoIntegration()]
# )
# Initialise environment variables
env = environ.Env()

View File

@ -8,7 +8,7 @@
<h4 class="">{% if gymnast_id %}Edit{% else %}Add{% endif %} Gymnast</h4>
</div>
<div class="card-body">
<form action="{% if gymnast_id %}{% url 'gymnast_update' gymnast_id %}{% else %}{% url 'gymnast_create' %}{% endif %}" method="post" class="form-horizontal" id="formulaire" name="formulaire">
<form action="{% if gymnast_id %}{% url 'gymnast_update' gymnast_id %}{% else %}{% url 'gymnast_create' %}{% endif %}" method="post" class="form-horizontal" id="form" name="form">
{% csrf_token %}
<div class="form-group row {% if form.last_name.errors %}has-error has-feedback{% endif %}">
<label for="id_last_name" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label">Names <span class="text-danger"><b>*</b></span></label>
@ -106,6 +106,16 @@
});
blackDashboard.initDateTimePicker();
$('#id_hours_by_week').focusout(function(){
value = $(this).val().replace(/,/g, '.');
$(this).val(parseFloat(value).toFixed(1));
});
$('#form').submit(function(){
$('#id_hours_by_week').val().replace(/,/g, '.');
$('#id_hours_by_week').val(parseFloat(value).toFixed(1));
})
$('#id_club_related').autocomplete({
source: function(request, response) {
$.ajax({