# HG changeset patch # User Madhusudan.C.S # Date 1295525739 -19800 # Node ID 42516ec56822e9bcd128c034b6aa3ed37a1d4278 # Parent 2dfecac4b545ff0f793943ce483b0afec09a191b Fix styling issues. diff -r 2dfecac4b545 -r 42516ec56822 pytask/static/css/base.css --- 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 { diff -r 2dfecac4b545 -r 42516ec56822 pytask/taskapp/views.py --- 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}) diff -r 2dfecac4b545 -r 42516ec56822 pytask/templates/task/view_textbook.html --- 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:
- - {% for chap in chapters %} - - - - - {% endfor %} -
{{chap.title}} {{chap.status}}
+ + {% for chap in chapters %} + + + + + {% endfor %} +
{{chap.title}} {{chap.status}}
{% else %} There are no chapters in this textbook as of now.
{% endif %}