from django import forms
from .models import Contacto
from ..usuarios.models import Usuario

CHOICES = (
    ('default', '-------'),
    ('Hombre', 'Hombre'),
    ('Mujer', 'Mujer')
)

class ContactoForm(forms.ModelForm):
    nombre = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control bg-body-tertiary',
                                                           'placeholder': 'Nombre Completo',
                                                           'id': 'nombre'}))
    mail = forms.EmailField(widget=forms.EmailInput(attrs={'class': 'form-control bg-body-tertiary',
                                                           'placeholder': 'name@ejemplo.com', 'id': 'mail'}))
    mensaje = forms.CharField(widget=forms.Textarea(attrs={'class': 'form-control bg-body-tertiary',
                                                           'id': 'mensaje', 'rows': '3'}))
    class Meta:
        model = Contacto
        fields = ('nombre', 'mail', 'mensaje')

class RegistroForm(forms.ModelForm):
    email = forms.EmailField(widget=forms.EmailInput(attrs={'class':'rounded d-block','id':'email'}))
    first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'rounded d-block','id':'nombre'}))
    last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'rounded d-block','id':'apellido'}))
    num_document = forms.CharField(widget=forms.NumberInput(attrs={'class':'rounded d-block','id':'cedula'}))
    date_of_birth = forms.CharField(widget=forms.TextInput(attrs={'class':'rounded d-block input_register','type':'date',
                                                           'id':'edad','style':'width: 11.813em;'}))
    gender = forms.ChoiceField(choices=CHOICES,
                                  widget=forms.Select(attrs={'class':'rounded d-block input_register','id':'genero','style':'width: 11.813em;'}))

    class Meta:
        model = Usuario
        fields = ('email','first_name','last_name','num_document','date_of_birth','gender')
        exclude = ['username','phone_number','address','img_profile','password']