"""
Definition of forms.
"""

from django import forms
from django.contrib.auth.forms import AuthenticationForm
from django.utils.translation import ugettext_lazy as _
from .models import *
from bootstrap_datepicker_plus import DatePickerInput

class InvoiceForm(forms.ModelForm):
    class Meta:
        model = Invoice
        fields = ['text', 'date', 'invoice_capture']
        widgets = {
            'date': DatePickerInput(options={
                     "format": "DD/MM/YYYY",
                     "locale": "es",}), 
        }

class BootstrapAuthenticationForm(AuthenticationForm):
    """Authentication form which uses boostrap CSS."""
    username = forms.CharField(max_length=254,
                               widget=forms.TextInput({
                                   'class': 'form-control',
                                   'placeholder': 'User name'}))
    password = forms.CharField(label=_("Password"),
                               widget=forms.PasswordInput({
                                   'class': 'form-control',
                                   'placeholder':'Password'}))
