The following is a controller in web2py:


#####Sign-in/Sign-up page#####def signup():    form = SQLFORM(db.auth_user)    
return dict(form=form)def signin():    if auth.is_logged_in():      
redirect(URL(r=request, c='default', f="index"))    login_form = auth.login()   
 login_form["_class"] = "form-horizontal"    
login_form.custom.widget.username["_class"]="input-medium"    
login_form.custom.widget.password["_class"]="input-medium"    
login_form.custom.widget.username["_placeholder"]="E-mail/Username"    
login_form.custom.widget.password["_placeholder"]="Password"    
login_form.custom.submit["_style"] = "color:white; background-color:#193161;"   
 login_form.custom.submit["_class"] = "btn btn-primary text-center"        
signup_form = auth.register()    
signup_form.custom.widget.first_name["_class"]="input-medium"    
signup_form.custom.widget.last_name["_class"]="input-medium"    
signup_form.custom.widget.username["_class"]="input-medium"    
signup_form.custom.widget.email["_class"]="input-medium"    
signup_form.custom.widget.password["_class"]="input-medium"    
signup_form.custom.widget.password_two["_class"]="input-medium"        
signup_form.custom.widget.first_name["_placeholder"]="First Name"    
signup_form.custom.widget.last_name["_placeholder"]="Last Name"    
signup_form.custom.widget.username["_placeholder"]="User Name"    
signup_form.custom.widget.email["_placeholder"]="E-Mail"    
signup_form.custom.widget.password["_placeholder"]="Password"    
signup_form.custom.widget.password_two["_placeholder"]="Verify Password"        
signup_form.custom.submit["_style"] = "color:white; background-color:#193161;"  
  signup_form.custom.submit["_class"] = "btn btn-primary text-center"    return 
dict(login_form=login_form,signup_form=signup_form)


The corresponding webpage is here: 
http://tuneterrain.com/tuneterrain/default/signin/login

The backend developer wants to reduce the number of statements that he has to 
write to retain the form formatting I have done with CSS.
The formatting for most of the forms on the website is same; could there be a 
way to add uniform formatting without having to write so many statements?

I am looking for a way, any way by which these statements could be minimised.

Yeah, statements for 
placeholders:signup_form.custom.widget.last_name["_placeholder"]="Last Name


Bootstrap classes:

signup_form.custom.widget.email["_class"]="input-medium"

Can perhaps not be eliminated. But say this: 

signup_form.custom.submit["_style"] = "color:white; background-color:#193161;"

Could such statements be reduced? What would I have to do with CSS or 
web2py that such statements are minimally written again and again for forms.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to