from django import forms

from BasicData.models import Etudiant,Reclamations,User,DemandeActes,Document


class EtudiantLoginForm(forms.Form):
    nce = forms.CharField(max_length=255, label="Nce", 
        help_text="Veillez entrer voter adresse numero de carte etudiant", 
        widget=forms.TextInput(attrs={'class': 'form-control' }), 
        required=True)

    password = forms.CharField(label='Mot de passe', 
        help_text="Veillez entrer un mot de passe securis&eacute", 
        widget=forms.PasswordInput(attrs={'class': 'form-control', 'autocomplete': 'current-password' }), 
        required=True)

    class Meta:
        model = Etudiant 
        fields = ['nce', 'password']


class ChoosePeriodeForm(forms.Form):
    periode = forms.CharField()

class ReclamationForm(forms.ModelForm):
    class Meta:
        model = Reclamations
        fields = ('type_discipline','code_discipline','motif','detail','annee')


class EtudiantSeanceForm(forms.Form):
    seance = forms.CharField()

class EtudiantSeanceForm2(forms.Form):
    seance = forms.CharField()
    debut = forms.TimeField()
    fin = forms.TimeField()


class PhotoAddForm(forms.ModelForm):
    class Meta:
        model = User
        fields = ('avatar',)
        widgets = {
            'avatar': forms.FileInput(attrs={'class': 'form-control', 'required':'required'}),
        }


class AddDemandesForm(forms.ModelForm):
    class Meta:
        model = DemandeActes
        fields =('annee','type_demande')


class EtDocAddForm(forms.ModelForm):
    class Meta:
        model = Document
        fields = ('typedoc','document')


class EtudEditForm(forms.ModelForm):
    class Meta:
        model = Etudiant
        fields = (
            'nom','prenoms', 'sexe','civilite','nationalite', 'datenaiss', 'lieunaiss','phone', 'email','profession','autre_profession','groupe_sanguin','handicap','sit_matri','nb_enfant','quartier',
            'numero_bac', 'serie_bac', 'etablissement_bac', 'type_etablissement', 'annee_bac', 'mention_bac',
            'centre_compo_bac','boursier','matricule',
            'nom_pere', 'nom_mere', 'contact_pere', 'contact_mere', 'contact_urgence', 'habitation_contact_urgence'
        )
