Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

css updated

  • Loading branch information...
commit 1f2fe3587a81c72abdc85f238fe466309ae693bc 1 parent cf7517f
Amit Kumat Pathak authored January 08, 2012
8  forms.py
@@ -6,19 +6,19 @@ class FeedbackForm(forms.ModelForm):
6 6
     def __init__( self, *args, **kwargs ):
7 7
         super( forms.ModelForm, self ).__init__( *args, **kwargs )
8 8
 
9  
-        self.fields['feedback_contact_number'].widget.attrs['class'] = 'contactno'
  9
+        self.fields['feedback_contact_number'].widget.attrs['class'] = 'textbox'
10 10
         self.fields['feedback_contact_number'].label = 'Contact No'
11 11
 
12  
-        self.fields['feedback_name'].widget.attrs['class'] = 'name'
  12
+        self.fields['feedback_name'].widget.attrs['class'] = 'textbox'
13 13
         self.fields['feedback_name'].label = 'Name'
14 14
 
15  
-        self.fields['feedback_email'].widget.attrs['class'] = 'email'
  15
+        self.fields['feedback_email'].widget.attrs['class'] = 'textbox'
16 16
         self.fields['feedback_email'].label = 'Email'
17 17
 
18 18
         self.fields['feedback_type'].widget.attrs['class'] = 'dropdown'
19 19
         self.fields['feedback_type'].label = 'Type'
20 20
 
21  
-        self.fields['feedback'].widget.attrs['class'] = 'textarea'
  21
+        self.fields['feedback'].widget.attrs['class'] = 'textbox'
22 22
 
23 23
     class Meta:
24 24
         model = FeedBack
48  static/css/feedback.css
@@ -6,53 +6,29 @@
6 6
     height: 87px;
7 7
     width: 26px;
8 8
 }
9  
-
10  
-.name{
11  
-    margin-left: 48px;
12  
-    border: solid 1px;
13  
-}
14  
-.name_error{
15  
-    margin-left: 48px;
16  
-    border: solid 1px #ff0000;
17  
-}
18  
-.email{
19  
-    margin-left: 49px;
20  
-    border: solid 1px;
21  
-}
22  
-.email_error{
23  
-    margin-left: 49px;
24  
-    border: solid 1px #ff0000;
25  
-}
26  
-.dropdown{
27  
-    margin-left: 55px;
28  
-    font:bold 12px Arial, Helvetica, sans-serif;
29  
-    border: solid 1px;
30  
-}
31  
-.textarea{
  9
+.textbox{
32 10
     float: right;
33  
-    margin-right: 96px;
  11
+    margin-right: 90px;
  12
+    width: 310px;
34 13
     border: solid 1px;
35 14
 }
36  
-.textarea_error{
  15
+.textbox_error{
37 16
     float: right;
38  
-    margin-right: 96px;
  17
+    margin-right: 90px;
  18
+    width: 310px;
39 19
     border: solid 1px #ff0000;
40 20
 }
  21
+.dropdown{
  22
+    margin-left: 44px;
  23
+    font:normal 13px Arial;
  24
+}
41 25
 .button{
42 26
     margin-left: 168px;
43 27
     margin-top: 20px;
44 28
     width: 105px;
45  
-    border: solid 1px;
46  
-}
47  
-.contactno{
48  
-    margin-left: 20px;
49  
-    border: solid 1px;
50  
-}
51  
-.contactno_error{
52  
-    margin-left: 20px;
53  
-    border: solid 1px #ff0000;
  29
+    font: normal 15px oblique;
54 30
 }
55 31
 .errorlist{
56 32
     color: #ff0000;
57  
-    margin-left: 100px;
  33
+    margin-left: 78px;
58 34
 }
2  static/js/feedback.js
... ...
@@ -1,6 +1,6 @@
1 1
 $(document).ready(function(){
2 2
     var text = '<a name="anc_feedback" id ="id_anc_feedback" class="cls_feedback thickbox" title="Submit Your Feedback" ' +
3  
-        'href="/feedback/feedback_form/?height=400&width=480"></a>'
  3
+        'href="/feedback/feedback_form/?height=405&width=480"></a>'
4 4
     $('body').prepend(text);
5 5
 });
6 6
 
10  views.py
@@ -23,14 +23,8 @@ def submit(request):
23 23
             return HttpResponse('Thanks for submitting your suggestion.')
24 24
         else:
25 25
             error_fields = f_form.errors.keys()
26  
-            if 'feedback_contact_number' in error_fields:
27  
-                f_form.fields['feedback_contact_number'].widget.attrs['class'] = 'contactno_error'
28  
-            if 'feedback_name' in error_fields:
29  
-                f_form.fields['feedback_name'].widget.attrs['class'] = 'name_error'
30  
-            if 'feedback_email' in error_fields:
31  
-                f_form.fields['feedback_email'].widget.attrs['class'] = 'email_error'
32  
-            if 'feedback' in error_fields:
33  
-                f_form.fields['feedback'].widget.attrs['class'] = 'textarea_error'
  26
+            for each_field in error_fields:
  27
+                f_form.fields[each_field].widget.attrs['class'] = 'textbox_error'
34 28
     else:
35 29
         f_form = FeedbackForm()
36 30
     return render_to_response('feedback_form.html', locals(), context_instance = RequestContext( request ))

0 notes on commit 1f2fe35

Please sign in to comment.
Something went wrong with that request. Please try again.