approve text book is meaningful now
authorNishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 11:56:34 +0530
changeset 139 4f0cfd486d9b
parent 138 5a94c774473c
child 140 8fcde6f8f750
approve text book is meaningful now
pytask/taskapp/views.py
pytask/templates/task/view_textbook.html
--- a/pytask/taskapp/views.py	Tue Jan 11 11:51:12 2011 +0530
+++ b/pytask/taskapp/views.py	Tue Jan 11 11:56:34 2011 +0530
@@ -335,7 +335,7 @@
                "comp_textbooks": comp_textbooks,
               }
 
-    if user.is_authenticated() and user.get_profile().rights != "CT":
+    if user.is_authenticated() and user.get_profile().rights in ["DC", "MG"]:
         unpub_textbooks = TextBook.objects.filter(status="UP")
 
         context.update({"unpub_textbooks": unpub_textbooks})
--- a/pytask/templates/task/view_textbook.html	Tue Jan 11 11:51:12 2011 +0530
+++ b/pytask/templates/task/view_textbook.html	Tue Jan 11 11:56:34 2011 +0530
@@ -25,12 +25,20 @@
         <hr />
     {% endif %}
 
+    {% if chapters %}
     Chapters: <br />
+    <table>
     {% for chap in chapters %}
-    <ul>
-	    <li><a href="/task/view/tid={{chap.uniq_key}}">{{chap.title}}</a> </li>
-    </ul>
+    <tr>
+	    <td><a href="/task/view/tid={{chap.uniq_key}}">{{chap.title}}</a> </td>
+	    <td> {{chap.status}} </td>
+    </tr>
     {% endfor %}
+    </table>
+    {% else %}
+    There are no chapters in this textbook as of now.<br />
+    {% endif %}
+