# Path: ndc/models.py
# class Profile(models.Model):
#     user = models.ForeignKey(User, unique=True)
#     nick = models.CharField(max_length=255, null=True, blank=True)
#     use_gravatar = models.BooleanField(default=True)
# 
#     def html_profile_image(self):
#         if self.use_gravatar:
#             import hashlib
#             hashed = hashlib.md5(self.user.email.lower()).hexdigest()
#             return mark_safe('<div class="gravatar"><img src="http://www.gravatar.com/avatar/%s/?s=48"/></div>' % hashed)
#         else:
#             return mark_safe('<span class="fui-man-24"></span>')


from django import forms
from ndc.models import Profile


class EmailLoginForm(forms.Form):
    email = forms.EmailField(max_length=255, label='', widget=forms.TextInput(attrs={
        'placeholder': 'Email address',
        'class': 'span4',
    }))

    def clean(self):
        cleaned_data = super(EmailLoginForm, self).clean()
        return cleaned_data


class ProfileForm(forms.ModelForm):
    class Meta:

# Path: ndc/models.py
# class Profile(models.Model):
#     user = models.ForeignKey(User, unique=True)
#     nick = models.CharField(max_length=255, null=True, blank=True)
#     use_gravatar = models.BooleanField(default=True)
# 
#     def html_profile_image(self):
#         if self.use_gravatar:
#             import hashlib
#             hashed = hashlib.md5(self.user.email.lower()).hexdigest()
#             return mark_safe('<div class="gravatar"><img src="http://www.gravatar.com/avatar/%s/?s=48"/></div>' % hashed)
#         else:
#             return mark_safe('<span class="fui-man-24"></span>')


# Path: ndc/forms.py
from django import forms
from ndc.models import Profile



class EmailLoginForm(forms.Form):
    email = forms.EmailField(max_length=255, label='', widget=forms.TextInput(attrs={
        'placeholder': 'Email address',
        'class': 'span4',
    }))

    def clean(self):
        cleaned_data = super(EmailLoginForm, self).clean()
        return cleaned_data


class ProfileForm(forms.ModelForm):
    class Meta:

        model = Profile