Ask Your Question
0

cannot apply a css on login/password fields

asked 2011-06-07 05:50:57 -0500

Samuel gravatar image Samuel flag of France
413 16 6 21

updated 2011-06-07 09:22:22 -0500

In order to be able to apply a css on the fields "login" and "password", the class names must not contain spaces.

Please, could you rename the class "required login" by "required_login" by applying the following patch :

diff --git a/askbot/deps/django_authopenid/forms.py b/askbot/deps/django_authopenid/forms.py
index 429fa55..1e5aa6d 100644
--- a/askbot/deps/django_authopenid/forms.py
+++ b/askbot/deps/django_authopenid/forms.py
@@ -131,7 +131,7 @@ class LoginForm(forms.Form):
     password = forms.CharField(
                     max_length=128,
                     widget=forms.widgets.PasswordInput(
-                                            attrs={'class':'required login'}
+                                            attrs={'class':'required_login'}
                                         ),
                     required=True
                 )
@@ -143,14 +143,14 @@ class LoginForm(forms.Form):
     new_password = forms.CharField(
                     max_length=128,
                     widget=forms.widgets.PasswordInput(
-                                            attrs={'class':'required login'}
+                                            attrs={'class':'required_login'}
                                         ),
                     required=False
                 )
     new_password_retyped = forms.CharField(
                     max_length=128,
                     widget=forms.widgets.PasswordInput(
-                                            attrs={'class':'required login'}
+                                            attrs={'class':'required_login'}
                                         ),
                     required=False
                 )
diff --git a/askbot/utils/forms.py b/askbot/utils/forms.py
index 575416b..f159ce8 100644
--- a/askbot/utils/forms.py
+++ b/askbot/utils/forms.py
@@ -38,7 +38,7 @@ class NextUrlField(forms.CharField):
     def clean(self,value):
         return clean_next(value)

-login_form_widget_attrs = { 'class': 'required login' }
+login_form_widget_attrs = { 'class': 'required_login' }

 class UserNameField(StrippedNonEmptyCharField):
     RESERVED_NAMES = (u'fuck', u'shit', u'ass', u'sex', u'add',
delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-06-08 01:04:29 -0500

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

updated 2011-06-08 01:12:01 -0500

Actually, it is possible:

.required.login {} /* selects elements with both classes, won't work in IE6 */

If no space is used between classes in the css file.

When space is used in HTML in the assignment like class="login required" it means that multiple classes are used on the element at the same time.

or

.login {} /* just login class */

or even

body.openid-signin .login.required {} /* both classes on openid-signin page */

Or I don't understand your intention?

link publish delete flag offensive edit

Comments

Your understanding is correct. I did not know the possibility to have multiple classes. I should have searched deeper before posting this question. I confirm that if I choose a class between "login" and "required" in the css it works fine. So forget my question and the patch. Thanks. Samuel ( 2011-06-08 02:58:34 -0500 )edit
No problems :) big deal. Evgeny ( 2011-06-08 03:03:37 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2011-06-07 05:50:57 -0500

Seen: 73 times

Last updated: Jun 08 '11