added unpublished tasks to home_page
authorNishanth Amuluru <nishanth@fossee.in>
Sun, 09 Jan 2011 19:45:42 +0530
changeset 367 13e171f09941
parent 366 4c349f310dfc
child 368 a4fa11b2cb5c
added unpublished tasks to home_page
pytask/templates/index.html
pytask/templates/task/view.html
pytask/views.py
--- a/pytask/templates/index.html	Sun Jan 09 19:35:31 2011 +0530
+++ b/pytask/templates/index.html	Sun Jan 09 19:45:42 2011 +0530
@@ -14,6 +14,15 @@
     <br />
     {% endif %}
     
+    {% if unpublished_tasks %}
+    Tasks created by you that need approval:<ul>
+        {% for a_task in unpublished_tasks %}
+            <li><a href="/task/view/tid={{a_task.uniq_key}}">{{a_task.title}}</a></li>
+        {% endfor %}
+        </ul>
+    <br />
+    {% endif %}
+
     {% if reviewing_tasks %}
     Tasks you are reviewering:<ul>
         {% for a_task in reviewing_tasks %}
--- a/pytask/templates/task/view.html	Sun Jan 09 19:35:31 2011 +0530
+++ b/pytask/templates/task/view.html	Sun Jan 09 19:45:42 2011 +0530
@@ -17,9 +17,11 @@
         <a href="/task/close/tid={{task.uniq_key}}">Close task</a>
     {% endif %}
     
+<!--
     {% if can_delete %}
         <a href="/task/delete/tid={{task.uniq_key}}">Delete task</a>
     {% endif %}
+    -->
 
     <hr />created by <a href="/user/view/uid={{ task.created_by.id }}">{{ task.created_by.username }}</a>
     on {{task.creation_datetime|date:"D d M Y"}} at {{task.creation_datetime|time:"H:i"}}<br />
--- a/pytask/views.py	Sun Jan 09 19:35:31 2011 +0530
+++ b/pytask/views.py	Sun Jan 09 19:45:42 2011 +0530
@@ -22,6 +22,7 @@
     claimed_tasks = user.claimed_tasks.all()
     selected_tasks = user.selected_tasks.all()
     reviewing_tasks = user.reviewing_tasks.all()
+    unpublished_tasks = user.created_tasks.filter(status="UP").all()
     can_create_task = True if profile.rights != "CT" else False
 
     context = {"user": user,
@@ -29,6 +30,7 @@
                "claimed_tasks": claimed_tasks,
                "selected_tasks": selected_tasks,
                "reviewing_tasks": reviewing_tasks,
+               "unpublished_tasks": unpublished_tasks,
                "can_create_task": can_create_task
               }