From b60f6506926c177211314be42e8cc25c844b0b94 Mon Sep 17 00:00:00 2001 From: Zambom Date: Wed, 18 Jan 2017 15:32:16 -0200 Subject: [PATCH] Removing register and forget password form labels --- users/forms.py | 12 +++++++++--- users/templates/users/forgot_password.html | 8 +------- users/templates/users/register.html | 14 ++++++-------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/users/forms.py b/users/forms.py index c044ca3..08f1914 100644 --- a/users/forms.py +++ b/users/forms.py @@ -46,8 +46,8 @@ class Validation(forms.ModelForm): return password2 class RegisterUserForm(Validation): - new_password = forms.CharField(label=_('Password'), widget = forms.PasswordInput(render_value=True)) - password2 = forms.CharField(label = _('Confirm Password'), widget = forms.PasswordInput(render_value=True)) + new_password = forms.CharField(label=_('Password'), widget = forms.PasswordInput(render_value = True, attrs = {'placeholder': _('Password') + ' *'})) + password2 = forms.CharField(label = _('Confirm Password'), widget = forms.PasswordInput(render_value = True, attrs = {'placeholder': _('Confirm Password') + ' *'})) is_edit = False @@ -63,6 +63,12 @@ class RegisterUserForm(Validation): class Meta: model = User fields = ['email', 'username', 'last_name', 'social_name', 'image', 'show_email', ] + widgets = { + 'email': forms.TextInput(attrs = {'placeholder': _('Email') + ' *'}), + 'username': forms.TextInput(attrs = {'placeholder': _('Name') + ' *'}), + 'last_name': forms.TextInput(attrs = {'placeholder': _('Last Name') + ' *'}), + 'social_name': forms.TextInput(attrs = {'placeholder': _('Social Name')}), + } class ProfileForm(Validation): is_edit = True @@ -157,7 +163,7 @@ class ChangePassForm(Validation): } class PassResetRequest(forms.Form): - email = forms.CharField(label = _('Email'), max_length = 254) + email = forms.EmailField(label = _('Email'), max_length = 254, widget = forms.TextInput(attrs = {'placeholder': _('Email') + ' *'})) def clean_email(self): email = self.cleaned_data.get('email', '') diff --git a/users/templates/users/forgot_password.html b/users/templates/users/forgot_password.html index 2a69f27..a032d95 100644 --- a/users/templates/users/forgot_password.html +++ b/users/templates/users/forgot_password.html @@ -46,13 +46,7 @@ {% for field in form %}
- {% if field.field.required %} - - {% else %} - - {% endif %} - - {% render_field field class='form-control' %} + {% render_field field class='form-control' %} {{ field.help_text }} diff --git a/users/templates/users/register.html b/users/templates/users/register.html index f0f10f2..2562a27 100644 --- a/users/templates/users/register.html +++ b/users/templates/users/register.html @@ -45,17 +45,11 @@ {% for field in form %}
- {% if field.field.required %} - - {% else %} - - {% endif %} - -
+
{% if field.auto_id == 'id_image' %} {% render_field field class='form-control' %}
- +
{% else %} + {% if field.auto_id == 'id_show_email' %} + + {% endif %} + {% render_field field class='form-control' %} {% endif %} {{ field.help_text }} -- libgit2 0.21.2