Fix styling issues.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Thu, 20 Jan 2011 17:45:39 +0530
changeset 500 42516ec56822
parent 499 2dfecac4b545
child 501 b84d6a1d4603
Fix styling issues.
pytask/static/css/base.css
pytask/taskapp/views.py
pytask/templates/task/view_textbook.html
--- a/pytask/static/css/base.css	Thu Jan 20 17:44:02 2011 +0530
+++ b/pytask/static/css/base.css	Thu Jan 20 17:45:39 2011 +0530
@@ -185,7 +185,7 @@
 #footer a:hover {
   color: #ccc;
   text-decoration: none;
-} 
+}
 
 /* Form Related CSS definitions */
 div #form {
--- a/pytask/taskapp/views.py	Thu Jan 20 17:44:02 2011 +0530
+++ b/pytask/taskapp/views.py	Thu Jan 20 17:45:39 2011 +0530
@@ -476,11 +476,19 @@
 
     context.update(csrf(request))
 
-    can_edit = True if user == textbook.created_by and textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0]\
-                       else False
+    if (user == textbook.created_by and
+      textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0]):
+        can_edit = True
+    else:
+        can_edit = False
+
 
-    can_approve = True if profile.role in [profile_models.ROLES_CHOICES[0][0], profile_models.ROLES_CHOICES[1][0]] and \
-                          textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0] else False
+    if (profile.role in [profile_models.ROLES_CHOICES[0][0],
+      profile_models.ROLES_CHOICES[1][0]] and
+      textbook.status == taskapp_models.TB_STATUS_CHOICES[0][0]):
+        can_approve = True
+    else:
+        can_approve = False
 
     context.update({"can_edit": can_edit,
                     "can_approve": can_approve})
--- a/pytask/templates/task/view_textbook.html	Thu Jan 20 17:44:02 2011 +0530
+++ b/pytask/templates/task/view_textbook.html	Thu Jan 20 17:45:39 2011 +0530
@@ -1,5 +1,6 @@
 {% extends "base.html" %}
 
+
 {% load form_helpers %}
 {% load browse_helpers %}
 
@@ -31,15 +32,14 @@
     {% endif %}
 
     {% if chapters %}
-    Chapters: <br />
-    <table>
-    {% for chap in chapters %}
-    <tr>
-	    <td><a href="{% url view_task chap.id %}">{{chap.title}}</a> </td>
-	    <td> {{chap.status}} </td>
-    </tr>
-    {% endfor %}
-    </table>
+      <table>
+      {% for chap in chapters %}
+      <tr>
+  	    <td><a href="{% url view_task chap.id %}">{{chap.title}}</a> </td>
+  	    <td> {{chap.status}} </td>
+      </tr>
+      {% endfor %}
+      </table>
     {% else %}
     There are no chapters in this textbook as of now.<br />
     {% endif %}