Remove bootstrap-datepicker-plus dependency, use native HTML selectors
This commit is contained in:
parent
e17273391d
commit
2faade0156
|
@ -6,12 +6,10 @@ from io import StringIO
|
|||
import re
|
||||
from typing import Iterable
|
||||
|
||||
from bootstrap_datepicker_plus.widgets import DatePickerInput, DateTimePickerInput
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.validators import FileExtensionValidator
|
||||
from django.utils import formats
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from pypdf import PdfFileReader
|
||||
|
||||
|
@ -126,22 +124,20 @@ class TournamentForm(forms.ModelForm):
|
|||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.fields["date_start"].widget = DatePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATE_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["date_end"].widget = DatePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATE_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["inscription_limit"].widget = DateTimePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["solution_limit"].widget = DateTimePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["solutions_draw"].widget = DateTimePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["syntheses_first_phase_limit"].widget = DateTimePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["solutions_available_second_phase"].widget = DateTimePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["syntheses_second_phase_limit"].widget = DateTimePickerInput(
|
||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||
self.fields["date_start"].widget = forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d')
|
||||
self.fields["date_end"].widget = forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d')
|
||||
self.fields["inscription_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
|
||||
format='%Y-%m-%d %H:%M')
|
||||
self.fields["solution_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
|
||||
format='%Y-%m-%d %H:%M')
|
||||
self.fields["solutions_draw"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
|
||||
format='%Y-%m-%d %H:%M')
|
||||
self.fields["syntheses_first_phase_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
|
||||
format='%Y-%m-%d %H:%M')
|
||||
self.fields["solutions_available_second_phase"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
|
||||
format='%Y-%m-%d %H:%M')
|
||||
self.fields["syntheses_second_phase_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
|
||||
format='%Y-%m-%d %H:%M')
|
||||
self.fields["organizers"].widget = forms.CheckboxSelectMultiple()
|
||||
self.fields["organizers"].queryset = VolunteerRegistration.objects.all()
|
||||
|
||||
|
|
|
@ -99,6 +99,10 @@ class StudentRegistrationForm(forms.ModelForm):
|
|||
"""
|
||||
A student can update its class, its school and if it allows Animath to contact him/her later.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["birth_date"].widget = forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d')
|
||||
|
||||
class Meta:
|
||||
model = StudentRegistration
|
||||
fields = ('team', 'student_class', 'birth_date', 'gender', 'address', 'zip_code', 'city', 'phone_number',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
Django>=3.2,<4.0
|
||||
django-bootstrap-datepicker-plus~=4.0
|
||||
django-cas-server~=2.0
|
||||
django-crispy-forms~=1.14
|
||||
django-extensions~=3.2
|
||||
|
|
|
@ -53,7 +53,6 @@ INSTALLED_APPS = [
|
|||
'django.contrib.staticfiles',
|
||||
'django.forms',
|
||||
|
||||
'bootstrap_datepicker_plus',
|
||||
'crispy_forms',
|
||||
'django_filters',
|
||||
'django_tables2',
|
||||
|
|
Loading…
Reference in New Issue