summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNishanth Amuluru2011-01-11 11:56:34 +0530
committerNishanth Amuluru2011-01-11 11:56:34 +0530
commitb73688b92f810962d306d85c11b57d47e5cf1688 (patch)
treee9e0dde37e206e5f0e90fe43980a3383d5ca6a08
parentaf7d5a6654025006629c60598ff8041252a3bc9d (diff)
downloadpytask-b73688b92f810962d306d85c11b57d47e5cf1688.tar.gz
pytask-b73688b92f810962d306d85c11b57d47e5cf1688.tar.bz2
pytask-b73688b92f810962d306d85c11b57d47e5cf1688.zip
approve text book is meaningful now
-rwxr-xr-xpytask/taskapp/views.py2
-rw-r--r--pytask/templates/task/view_textbook.html14
2 files changed, 12 insertions, 4 deletions
diff --git a/pytask/taskapp/views.py b/pytask/taskapp/views.py
index cabd8d3..993703b 100755
--- a/pytask/taskapp/views.py
+++ b/pytask/taskapp/views.py
@@ -335,7 +335,7 @@ def browse_textbooks(request):
"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})
diff --git a/pytask/templates/task/view_textbook.html b/pytask/templates/task/view_textbook.html
index eda89a1..4641210 100644
--- a/pytask/templates/task/view_textbook.html
+++ b/pytask/templates/task/view_textbook.html
@@ -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 %}
+