# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""

#rom attr import attr, attrs
from django import forms
# from matplotlib.widgets import Widget
from phonenumber_field.formfields import PhoneNumberField
from phonenumber_field.widgets import PhoneNumberPrefixWidget
class LoginForm(forms.Form):
    
    # phone = forms.IntegerField(
    #     widget=forms.TextInput(
    #         attrs={
    #             "placeholder" : "091++++++++",                
    #             "class": "form-control"
    #         }
    #     ))
    phone = PhoneNumberField(initial='+98', widget=PhoneNumberPrefixWidget(attrs={"style":"border-style: solid","placeholder":'0911#######'}), required=True)
    class Meta:
        fields = ('phone',)

class SignUpForm(forms.Form):
    username = forms.CharField(
        widget=forms.TextInput(
            attrs={
                "placeholder" : "نام و نام خانوادگی",                
                "class": "form-control",
                "style":"border-style: solid",
            }
        ))
    # phone = forms.IntegerField(
    #     widget=forms.TextInput(
    #         attrs={
    #             "placeholder" : "091++++++++",                
    #             "class": "form-control"
    #         }
    #     ))
    phone = PhoneNumberField(initial='+98', widget=PhoneNumberPrefixWidget(attrs={"style":"border-style: solid","placeholder":'0911#######'}), required=True)
    class Meta:
        fields = ('username', 'phone',)


class verifycode(forms.Form):
    
    code = forms.IntegerField(
        widget=forms.TextInput(
            attrs={
                "placeholder" : " کد یکبار مصرف",                
                "class": "form-control",
                "style":"border-style: solid"
            }
        ))

    class Meta:
        fields = ('code',)
        

class usernameform(forms.Form):
    
    username = forms.CharField(
        widget=forms.TextInput(
            attrs={
                "placeholder" : "username",                
                "class": "form-control"
            }
        ))


    class Meta:
        fields = ('username',)
