Commit b60f6506926c177211314be42e8cc25c844b0b94
1 parent
da0875ff
Exists in
master
and in
3 other branches
Removing register and forget password form labels
Showing
3 changed files
with
16 additions
and
18 deletions
Show diff stats
users/forms.py
@@ -46,8 +46,8 @@ class Validation(forms.ModelForm): | @@ -46,8 +46,8 @@ class Validation(forms.ModelForm): | ||
46 | return password2 | 46 | return password2 |
47 | 47 | ||
48 | class RegisterUserForm(Validation): | 48 | class RegisterUserForm(Validation): |
49 | - new_password = forms.CharField(label=_('Password'), widget = forms.PasswordInput(render_value=True)) | ||
50 | - password2 = forms.CharField(label = _('Confirm Password'), widget = forms.PasswordInput(render_value=True)) | 49 | + new_password = forms.CharField(label=_('Password'), widget = forms.PasswordInput(render_value = True, attrs = {'placeholder': _('Password') + ' *'})) |
50 | + password2 = forms.CharField(label = _('Confirm Password'), widget = forms.PasswordInput(render_value = True, attrs = {'placeholder': _('Confirm Password') + ' *'})) | ||
51 | 51 | ||
52 | is_edit = False | 52 | is_edit = False |
53 | 53 | ||
@@ -63,6 +63,12 @@ class RegisterUserForm(Validation): | @@ -63,6 +63,12 @@ class RegisterUserForm(Validation): | ||
63 | class Meta: | 63 | class Meta: |
64 | model = User | 64 | model = User |
65 | fields = ['email', 'username', 'last_name', 'social_name', 'image', 'show_email', ] | 65 | fields = ['email', 'username', 'last_name', 'social_name', 'image', 'show_email', ] |
66 | + widgets = { | ||
67 | + 'email': forms.TextInput(attrs = {'placeholder': _('Email') + ' *'}), | ||
68 | + 'username': forms.TextInput(attrs = {'placeholder': _('Name') + ' *'}), | ||
69 | + 'last_name': forms.TextInput(attrs = {'placeholder': _('Last Name') + ' *'}), | ||
70 | + 'social_name': forms.TextInput(attrs = {'placeholder': _('Social Name')}), | ||
71 | + } | ||
66 | 72 | ||
67 | class ProfileForm(Validation): | 73 | class ProfileForm(Validation): |
68 | is_edit = True | 74 | is_edit = True |
@@ -157,7 +163,7 @@ class ChangePassForm(Validation): | @@ -157,7 +163,7 @@ class ChangePassForm(Validation): | ||
157 | } | 163 | } |
158 | 164 | ||
159 | class PassResetRequest(forms.Form): | 165 | class PassResetRequest(forms.Form): |
160 | - email = forms.CharField(label = _('Email'), max_length = 254) | 166 | + email = forms.EmailField(label = _('Email'), max_length = 254, widget = forms.TextInput(attrs = {'placeholder': _('Email') + ' *'})) |
161 | 167 | ||
162 | def clean_email(self): | 168 | def clean_email(self): |
163 | email = self.cleaned_data.get('email', '') | 169 | email = self.cleaned_data.get('email', '') |
users/templates/users/forgot_password.html
@@ -46,13 +46,7 @@ | @@ -46,13 +46,7 @@ | ||
46 | {% for field in form %} | 46 | {% for field in form %} |
47 | <div class="col-lg-10 col-md-10 col-sm-10 col-lg-offset-1 col-md-offset-1 col-sm-offset-1"> | 47 | <div class="col-lg-10 col-md-10 col-sm-10 col-lg-offset-1 col-md-offset-1 col-sm-offset-1"> |
48 | <div class="form-group{% if form.has_error %} has-error {% endif %}"> | 48 | <div class="form-group{% if form.has_error %} has-error {% endif %}"> |
49 | - {% if field.field.required %} | ||
50 | - <label for="{{ field.auto_id }}" class="control-label">{{ field.label }} <span>*</span></label> | ||
51 | - {% else %} | ||
52 | - <label for="{{ field.auto_id }}" class="control-label">{{ field.label }}</label> | ||
53 | - {% endif %} | ||
54 | - | ||
55 | - {% render_field field class='form-control' %} | 49 | + {% render_field field class='form-control' %} |
56 | 50 | ||
57 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> | 51 | <span id="helpBlock" class="help-block">{{ field.help_text }}</span> |
58 | 52 |
users/templates/users/register.html
@@ -45,17 +45,11 @@ | @@ -45,17 +45,11 @@ | ||
45 | {% for field in form %} | 45 | {% for field in form %} |
46 | <div class="col-lg-12 col-md-12 col-sm-12"> | 46 | <div class="col-lg-12 col-md-12 col-sm-12"> |
47 | <div class="form-group form-group-sm"> | 47 | <div class="form-group form-group-sm"> |
48 | - {% if field.field.required %} | ||
49 | - <label for="{{ field.auto_id }}" class="col-md-2 col-sm-2 col-xs-3 col-lg-2 control-label">{{ field.label }}<span>*</span></label> | ||
50 | - {% else %} | ||
51 | - <label for="{{ field.auto_id }}" class="col-md-2 col-sm-2 col-xs-3 col-lg-2 control-label">{{ field.label }}</label> | ||
52 | - {% endif %} | ||
53 | - | ||
54 | - <div class="col-md-10 col-sm-10 col-xs-9 col-lg-10"> | 48 | + <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12"> |
55 | {% if field.auto_id == 'id_image' %} | 49 | {% if field.auto_id == 'id_image' %} |
56 | {% render_field field class='form-control' %} | 50 | {% render_field field class='form-control' %} |
57 | <div class="input-group"> | 51 | <div class="input-group"> |
58 | - <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your file...' %}"> | 52 | + <input type="text" readonly="" class="form-control" placeholder="{% trans 'Choose your photo...' %}"> |
59 | <span class="input-group-btn"> | 53 | <span class="input-group-btn"> |
60 | <button type="button" class="btn btn-fab btn-fab-mini"> | 54 | <button type="button" class="btn btn-fab btn-fab-mini"> |
61 | <i class="material-icons">attach_file</i> | 55 | <i class="material-icons">attach_file</i> |
@@ -63,6 +57,10 @@ | @@ -63,6 +57,10 @@ | ||
63 | </span> | 57 | </span> |
64 | </div> | 58 | </div> |
65 | {% else %} | 59 | {% else %} |
60 | + {% if field.auto_id == 'id_show_email' %} | ||
61 | + <label for="{{ field.auto_id }}" class="control-label">{{ field.label }}</label> | ||
62 | + {% endif %} | ||
63 | + | ||
66 | {% render_field field class='form-control' %} | 64 | {% render_field field class='form-control' %} |
67 | {% endif %} | 65 | {% endif %} |
68 | <span class="help-block">{{ field.help_text }}</span> | 66 | <span class="help-block">{{ field.help_text }}</span> |