Permalink
Browse files

css updated

  • Loading branch information...
1 parent cf7517f commit 1f2fe3587a81c72abdc85f238fe466309ae693bc @pathakamit88 committed Jan 8, 2012
Showing with 19 additions and 49 deletions.
  1. +4 −4 forms.py
  2. +12 −36 static/css/feedback.css
  3. +1 −1 static/js/feedback.js
  4. +2 −8 views.py
View
@@ -6,19 +6,19 @@ class FeedbackForm(forms.ModelForm):
def __init__( self, *args, **kwargs ):
super( forms.ModelForm, self ).__init__( *args, **kwargs )
- self.fields['feedback_contact_number'].widget.attrs['class'] = 'contactno'
+ self.fields['feedback_contact_number'].widget.attrs['class'] = 'textbox'
self.fields['feedback_contact_number'].label = 'Contact No'
- self.fields['feedback_name'].widget.attrs['class'] = 'name'
+ self.fields['feedback_name'].widget.attrs['class'] = 'textbox'
self.fields['feedback_name'].label = 'Name'
- self.fields['feedback_email'].widget.attrs['class'] = 'email'
+ self.fields['feedback_email'].widget.attrs['class'] = 'textbox'
self.fields['feedback_email'].label = 'Email'
self.fields['feedback_type'].widget.attrs['class'] = 'dropdown'
self.fields['feedback_type'].label = 'Type'
- self.fields['feedback'].widget.attrs['class'] = 'textarea'
+ self.fields['feedback'].widget.attrs['class'] = 'textbox'
class Meta:
model = FeedBack
@@ -6,53 +6,29 @@
height: 87px;
width: 26px;
}
-
-.name{
- margin-left: 48px;
- border: solid 1px;
-}
-.name_error{
- margin-left: 48px;
- border: solid 1px #ff0000;
-}
-.email{
- margin-left: 49px;
- border: solid 1px;
-}
-.email_error{
- margin-left: 49px;
- border: solid 1px #ff0000;
-}
-.dropdown{
- margin-left: 55px;
- font:bold 12px Arial, Helvetica, sans-serif;
- border: solid 1px;
-}
-.textarea{
+.textbox{
float: right;
- margin-right: 96px;
+ margin-right: 90px;
+ width: 310px;
border: solid 1px;
}
-.textarea_error{
+.textbox_error{
float: right;
- margin-right: 96px;
+ margin-right: 90px;
+ width: 310px;
border: solid 1px #ff0000;
}
+.dropdown{
+ margin-left: 44px;
+ font:normal 13px Arial;
+}
.button{
margin-left: 168px;
margin-top: 20px;
width: 105px;
- border: solid 1px;
-}
-.contactno{
- margin-left: 20px;
- border: solid 1px;
-}
-.contactno_error{
- margin-left: 20px;
- border: solid 1px #ff0000;
+ font: normal 15px oblique;
}
.errorlist{
color: #ff0000;
- margin-left: 100px;
+ margin-left: 78px;
}
@@ -1,6 +1,6 @@
$(document).ready(function(){
var text = '<a name="anc_feedback" id ="id_anc_feedback" class="cls_feedback thickbox" title="Submit Your Feedback" ' +
- 'href="/feedback/feedback_form/?height=400&width=480"></a>'
+ 'href="/feedback/feedback_form/?height=405&width=480"></a>'
$('body').prepend(text);
});
View
@@ -23,14 +23,8 @@ def submit(request):
return HttpResponse('Thanks for submitting your suggestion.')
else:
error_fields = f_form.errors.keys()
- if 'feedback_contact_number' in error_fields:
- f_form.fields['feedback_contact_number'].widget.attrs['class'] = 'contactno_error'
- if 'feedback_name' in error_fields:
- f_form.fields['feedback_name'].widget.attrs['class'] = 'name_error'
- if 'feedback_email' in error_fields:
- f_form.fields['feedback_email'].widget.attrs['class'] = 'email_error'
- if 'feedback' in error_fields:
- f_form.fields['feedback'].widget.attrs['class'] = 'textarea_error'
+ for each_field in error_fields:
+ f_form.fields[each_field].widget.attrs['class'] = 'textbox_error'
else:
f_form = FeedbackForm()
return render_to_response('feedback_form.html', locals(), context_instance = RequestContext( request ))

0 comments on commit 1f2fe35

Please sign in to comment.