Manipulate all the templates to use {% url %} templatetag instead of hard coded URLs.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Sat, 15 Jan 2011 21:21:49 +0530
changeset 417 b37e541bf950
parent 416 265dbd81c451
child 418 df241055a1a7
Manipulate all the templates to use {% url %} templatetag instead of hard coded URLs.
pytask/templates/base.html
pytask/templates/index.html
pytask/templates/profile/browse_notifications.html
pytask/templates/profile/view.html
pytask/templates/profile/view_notification.html
pytask/templates/profile/view_user.html
pytask/templates/registration/login.html
pytask/templates/show_msg.html
pytask/templates/task/approved_task.html
pytask/templates/task/approved_textbook.html
pytask/templates/task/browse.html
pytask/templates/task/browse_textbooks.html
pytask/templates/task/claim.html
pytask/templates/task/confirm_approval.html
pytask/templates/task/confirm_textbook_approval.html
pytask/templates/task/select_user.html
pytask/templates/task/view.html
pytask/templates/task/view_textbook.html
pytask/templates/task/view_work.html
--- a/pytask/templates/base.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/base.html	Sat Jan 15 21:21:49 2011 +0530
@@ -8,26 +8,26 @@
 <body>
 <div id="wrapper">
     <div id="header">
-        <h2><a href="/">PyTasks</a></h2>
+        <h2><a href="{% url home_page %}">PyTasks</a></h2>
     </div>
     <div id="container">
         <div id="left">
         <ul id="nav">
-            <li><a href="/" title="home">home</a></li>
+            <li><a href="{% url home_page %}" title="home">Home</a></li>
 	    <br />
-                <li><a href="/task/browse/" title="tasks">tasks</a></li>
-                <li><a href="/task/textbook/browse/" title="textbook">textbooks</a></li>
+                <li><a href="{% url browse_tasks %}" title="tasks">Tasks</a></li>
+                <li><a href="{% url browse_textbooks %}" title="textbook">Textbooks</a></li>
                 <br />
             {% if user.is_authenticated %}
-                <li><a href="/profile/notf/browse/" title="notifications">
-			{{ user|notf_dsp }}
+                <li><a href="{% url browse_notifications %}" title="notifications">
+                  {{ user|notf_dsp }}
                 </a></li>
                 <br>
-                <li><a href="/profile/view">profile</a></li>
-                <li><a href="/accounts/logout/">logout</a></li>
+                <li><a href="{% url view_profile %}">Profile</a></li>
+                <li><a href="{% url auth_logout %}">Logout</a></li>
             {% else %}
-                <li><a href="/accounts/register/" title="register">register</a></li>
-                <li><a href="/accounts/login/" title="login">login</a></li>
+                <li><a href="{% url registration_register %}" title="register">Register</a></li>
+                <li><a href="{% url auth_login %}" title="login">Login</a></li>
             {% endif %}
         </ul>
         </div>
@@ -35,9 +35,6 @@
             {% block content %}This is the default content{% endblock %}
         </div>
         <div id="right">
-            <!--{% if user.is_authenticated %}
-            <a href="/accounts/logout">logout</a> 
-            {% endif %}-->
         </div>
         <div class="clearer">
         </div>
--- a/pytask/templates/index.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/index.html	Sat Jan 15 21:21:49 2011 +0530
@@ -9,15 +9,15 @@
     {% endif %}
 
     {% if can_create_task %}
-    	<a href="/task/textbook/create/">Add a new textbook</a><br />
-        <a href="/task/create/">Create a task</a><br />
+    	<a href="{% url create_textbook %}">Add a new textbook</a><br />
+        <a href="{% url create_task %}">Create a task</a><br />
     <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>
+            <li><a href="{% url view_task a_task.id %}">{{a_task.title}}</a></li>
         {% endfor %}
         </ul>
     <br />
@@ -26,7 +26,7 @@
     {% if reviewing_tasks %}
     Tasks you are reviewering:<ul>
         {% for a_task in reviewing_tasks %}
-            <li><a href="/task/view/tid={{a_task.uniq_key}}">{{a_task.title}}</a></li>
+            <li><a href="{% url view_task a_task.id %}">{{a_task.title}}</a></li>
         {% endfor %}
         </ul>
     <br />
@@ -35,7 +35,7 @@
     {% if selected_tasks %}
     Tasks that have been assigned to you:<ul>
         {% for a_task in selected_tasks %}
-            <li><a href="/task/view/tid={{a_task.uniq_key}}">{{a_task.title}}</a></li>
+            <li><a href="{% url view_task a_task.id %}">{{a_task.title}}</a></li>
         {% endfor %}
         </ul>
     <br />
@@ -44,7 +44,7 @@
     {% if claimed_tasks %}
     Tasks claimed but still not assigned to you:<ul>
         {% for a_task in claimed_tasks %}
-            <li><a href="/task/view/tid={{a_task.uniq_key}}">{{a_task.title}}</a></li>
+            <li><a href="{% url view_task a_task.id %}">{{a_task.title}}</a></li>
         {% endfor %}
         </ul>
     <br />
--- a/pytask/templates/profile/browse_notifications.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/profile/browse_notifications.html	Sat Jan 15 21:21:49 2011 +0530
@@ -5,7 +5,7 @@
 {% else %}
 Notifications: <br />
 {% for notification in notifications %}
-<a href="/profile/notf/view/nid={{notification.uniq_key}}">
+<a href="{% url view_notification notification.id %}">
 {% if not notification.is_read %} <b> {% endif %}
 {{notification.subject}}
 {% if not notification.is_read %} </b> {% endif %}</a><br />
--- a/pytask/templates/profile/view.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/profile/view.html	Sat Jan 15 21:21:49 2011 +0530
@@ -10,5 +10,5 @@
 Address: {{profile.address|linebreaksbr}} <br />
 <hr />
 Phone Number: {{profile.phonenum}} <br />
-<a href="/profile/edit">Edit profile</a>
+<a href="{% url edit_profile %}">Edit profile</a>
 {% endblock %}
--- a/pytask/templates/profile/view_notification.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/profile/view_notification.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,25 +1,25 @@
 {% extends 'base.html' %}
 {% block content %}
 {% if newest %}
-<a href="/profile/notf/view/nid={{newest.uniq_key}}">&lt;&lt;newest</a>
+<a href="{% url view_notification newest.id %}">&lt;&lt;newest</a>
 {% endif %}
 {% if newer %}
-<a href="/profile/notf/view/nid={{newer.uniq_key}}">&lt;newer</a>
+<a href="{% url view_notification newer.id %}">&lt;newer</a>
 {% endif %}
 {% if older %}
-<a href="/profile/notf/view/nid={{older.uniq_key}}">older&gt;</a>
+<a href="{% url view_notification older.id %}">older&gt;</a>
 {% endif %}
 {% if oldest %}
-<a href="/profile/notf/view/nid={{oldest.uniq_key}}">oldest&gt;&gt;</a>
+<a href="{% url view_notification oldest.id %}">oldest&gt;&gt;</a>
 {% endif %}
 <br />
 
 <br />
-sent on {{notification.sent_date|date:"D d M Y"}} at {{notification.sent_date|time:"H:i"}}<br />
+Sent on {{notification.sent_date|date:"D d M Y"}} at {{notification.sent_date|time:"H:i"}}<br />
 Sub: {{notification.subject}}<br />
 <br />
 {{notification.message|safe}}
 <br />
-<a href="/profile/notf/del/nid={{notification.uniq_key}}">Delete</a>
-<a href="/profile/notf/unr/nid={{notification.uniq_key}}">Keep Unread</a>
+<a href="{% url delete_notification notification.id %}">Delete</a>
+<a href="{% url unread_notification notification.id %}">Keep Unread</a>
 {% endblock %}
--- a/pytask/templates/profile/view_user.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/profile/view_user.html	Sat Jan 15 21:21:49 2011 +0530
@@ -17,7 +17,7 @@
 Tasks completed by {{viewing_profile.full_name}}:
 <ul>
 	{% for task in comp_tasks %}
-	<li><a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a></li>
+	<li><a href="{% url view_task task.id %}">{{task.title}}</a></li>
 	{% endfor %}
 </ul>
 {% endif %}
@@ -26,7 +26,7 @@
 Tasks {{viewing_profile.full_name}} is currently working on:
 <ul>
 	{% for task in working_tasks %}
-	<li><a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a></li>
+	<li><a href="{% url view_task task.id %}">{{task.title}}</a></li>
 	{% endfor %}
 </ul>
 {% endif %}
@@ -35,7 +35,7 @@
 Tasks reviewed by {{viewing_profile.full_name}}:
 <ul>
 	{% for task in reviewing_tasks %}
-	<li><a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a></li>
+	<li><a href="{% url view_task task.id %}">{{task.title}}</a></li>
 	{% endfor %}
 </ul>
 {% endif %}
@@ -43,7 +43,7 @@
 {% if claimed_tasks and can_view_info %}
 <ul>
 	{% for task in claimed_tasks %}
-	<li><a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a></li>
+	<li><a href="{% url view_task task.id %}">{{task.title}}</a></li>
 	{% endfor %}
 </ul>
 {% endif %}
--- a/pytask/templates/registration/login.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/registration/login.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,9 +1,9 @@
 {% extends 'base.html' %}
 {% block content %}
-<form action="/accounts/login/" method="post">
+<form action="{% url auth_login %}" method="post">
 {% csrf_token %}
 {{ form.as_p }}
 <input type="submit" value="Login" />
 </form>
-<a href="/accounts/password/reset">Forgot password?</a>
+<a href="{% url auth_password_reset %}">Forgot password?</a>
 {% endblock %}
--- a/pytask/templates/show_msg.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/show_msg.html	Sat Jan 15 21:21:49 2011 +0530
@@ -17,11 +17,4 @@
         {{message}}<br />
     {% endif %}
     You will be redirected to {{url_desc}} page in 5 seconds
-    <!--
-    {% if redirect_url %}
-        <a href="{{redirect_url}}">click here</a> to return to {{url_desc}}
-    {% else %}
-        <a href="/">click here</a> to return to Homepage
-    {% endif %}
-    -->
 {% endblock %}
--- a/pytask/templates/task/approved_task.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/approved_task.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,5 +1,5 @@
 {% extends 'base.html' %}
 {% block content %}
-The task <a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a> has been approved.<br />
+The task <a href="{% url view_task task.id %}">{{task.title}}</a> has been approved.<br />
 The task will be public. Now users can claim the task and work on it.
 {% endblock %}
--- a/pytask/templates/task/approved_textbook.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/approved_textbook.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,5 +1,5 @@
 {% extends 'base.html' %}
 {% block content %}
-The textbook <a href="/task/textbook/view/tid={{textbook.uniq_key}}">{{textbook.name}}</a> has been approved.<br />
+The textbook <a href="{% url view_textbook textbook.id %}">{{textbook.name}}</a> has been approved.<br />
 The textbook will now be public.
 {% endblock %}
--- a/pytask/templates/task/browse.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/browse.html	Sat Jan 15 21:21:49 2011 +0530
@@ -4,7 +4,7 @@
     {% if open_tasks %}
     Tasks that are open for contribution<ul>
     {% for task in open_tasks %}
-        <li><a href="/task/view/tid={{ task.uniq_key }}">{{ task.title }}</a></li>
+        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
     {% endfor %}
     </ul>
     <br />
@@ -13,7 +13,7 @@
     {% if working_tasks %}
     Tasks that are being worked on<ul>
     {% for task in working_tasks %}
-        <li><a href="/task/view/tid={{ task.uniq_key }}">{{ task.title }}</a></li>
+        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
     {% endfor %}
     </ul>
     <br />
@@ -22,7 +22,7 @@
     {% if comp_tasks %}
     Tasks that were completed recently<ul>
     {% for task in comp_tasks %}
-        <li><a href="/task/view/tid={{ task.uniq_key }}">{{ task.title }}</a></li>
+        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
     {% endfor %}
     </ul>
     <br />
@@ -31,7 +31,7 @@
     {% if unpub_tasks %}
     Tasks that need approval<ul>
     {% for task in unpub_tasks %}
-        <li><a href="/task/view/tid={{ task.uniq_key }}">{{ task.title }}</a></li>
+        <li><a href="{% url view_task task.id %}">{{ task.title }}</a></li>
     {% endfor %}
     </ul>
     <br />
--- a/pytask/templates/task/browse_textbooks.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/browse_textbooks.html	Sat Jan 15 21:21:49 2011 +0530
@@ -3,7 +3,7 @@
     {% if comp_textbooks %}
     Textbooks that were completed recently<ul>
     {% for textbook in comp_textbooks %}
-        <li><a href="/task/textbook/view/tid={{ textbook.uniq_key }}">{{ textbook.name }}</a></li>
+        <li><a href="{% url view_textbook textbook.id %}">{{ textbook.name }}</a></li>
     {% endfor %}
     </ul>
     <br />
@@ -12,7 +12,7 @@
     {% if open_textbooks %}
     Textbooks that are open for contribution<ul>
     {% for textbook in open_textbooks %}
-        <li><a href="/task/textbook/view/tid={{ textbook.uniq_key }}">{{ textbook.name }}</a></li>
+        <li><a href="{% url view_textbook textbook.id %}">{{ textbook.name }}</a></li>
     {% endfor %}
     </ul>
     <br />
@@ -21,7 +21,7 @@
     {% if unpub_textbooks %}
     Textbooks that need approval<ul>
     {% for textbook in unpub_textbooks %}
-        <li><a href="/task/textbook/view/tid={{ textbook.uniq_key }}">{{ textbook.name }}</a></li>
+        <li><a href="{% url view_textbook textbook.id %}">{{ textbook.name }}</a></li>
     {% endfor %}
     </ul>
     <br />
--- a/pytask/templates/task/claim.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/claim.html	Sat Jan 15 21:21:49 2011 +0530
@@ -4,10 +4,10 @@
     Propose a claim to work on this task.<br />
     {% endif %}
     {% if old_claims %}
-        List of all the claims for the task <a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a><br />
+        List of all the claims for the task <a href="{% url view_task task.id %}">{{task.title}}</a><br />
         {% for claim in old_claims %}
             <hr />
-            <a href="/profile/user/view/uid={{claim.claimed_by.id}}">{{claim.claimed_by.username}}</a>
+            <a href="{% url view_profile claim.claimed_by.id %}">{{claim.claimed_by.username}}</a>
             on {{claim.claim_datetime|date:"D d M Y"}} at {{claim.claim_datetime|time:"H:i"}} wrote:<br />
             {{claim.proposal|linebreaksbr}}<br />
         {% endfor %}
@@ -23,7 +23,7 @@
     {% endif %}
     {% if old_claims and is_creator %}
     <hr />
-        <a href="/task/select/tid={{task.uniq_key}}">Select a user to assign the work</a>
+        <a href="{% url select_task task.id %}">Select a user to assign the work</a>
     {% endif %}
 
     {% if can_claim %}
--- a/pytask/templates/task/confirm_approval.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/confirm_approval.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,8 +1,8 @@
 {% extends 'base.html' %}
 {% block content %}
-You are about to approve the task <a href="/task/view/tid={{task.uniq_key}}">{{task.title}}</a><br />
+You are about to approve the task <a href="{% url view_task task.id %}">{{task.title}}</a><br />
 This action cannot be undone. Please confirm <br /> <br />
 
-<a href="/task/approved/tid={{task.uniq_key}}">Yes, I approve the task</a><br />
-<a href="/task/view/tid={{task.uniq_key}}">No, take me back to the task</a> <br />
+<a href="{% url approve_task task.id %}">Yes, I approve the task</a><br />
+<a href="{% url view_task task.id %}">No, take me back to the task</a> <br />
 {% endblock %}
--- a/pytask/templates/task/confirm_textbook_approval.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/confirm_textbook_approval.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,8 +1,8 @@
 {% extends 'base.html' %}
 {% block content %}
-You are about to approve the textbook <a href="/textbook/textbook/view/tid={{textbook.uniq_key}}">{{textbook.name}}</a><br />
+You are about to approve the textbook <a href="{% url view_textbook textbook.id %}">{{textbook.name}}</a><br />
 This action cannot be undone. Please confirm <br /> <br />
 
-<a href="/task/textbook/approved/tid={{textbook.uniq_key}}">Yes, I approve the textbook</a><br />
-<a href="/task/textbook/view/tid={{textbook.uniq_key}}">No, take me back to the textbook</a> <br />
+<a href="{% url approve_textbook textbook.id %}">Yes, I approve the textbook</a><br />
+<a href="{% url view_textbook textbook.id %}">No, take me back to the textbook</a> <br />
 {% endblock %}
--- a/pytask/templates/task/select_user.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/select_user.html	Sat Jan 15 21:21:49 2011 +0530
@@ -1,6 +1,6 @@
 {% extends 'base.html' %}
 {% block content %}
-    <a href="/task/claim/tid={{task.uniq_key}}">click here</a> to return to the claims page.<br /><br />
+    <a href="{% url claim_task task.id %}">click here</a> to return to the claims page.<br /><br />
     Select a user to assign this task.<br />
     <form action="" method="POST">
 	    {% csrf_token %}
--- a/pytask/templates/task/view.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/view.html	Sat Jan 15 21:21:49 2011 +0530
@@ -6,36 +6,29 @@
     <h3>{{ task.title }}</h3>
 
     {% if can_edit %}
-        <a href="/task/edit/tid={{task.uniq_key}}">Edit task</a>
+        <a href="{% url edit_task task.id %}">Edit task</a>
     {% endif %}
-    
+
     {% if can_approve %}
-        <a href="/task/approve/tid={{task.uniq_key}}">Approve task</a>
+        <a href="{% url approve_task task.id %}">Approve task</a>
     {% endif %}
-    
+
     {% if can_close %}
-        <a href="/task/close/tid={{task.uniq_key}}">Close task</a>
+        <a href="{% url close_task task.id %}">Close task</a>
     {% endif %}
-    
-<!--
-    {% if can_delete %}
-        <a href="/task/delete/tid={{task.uniq_key}}">Delete task</a>
-    {% endif %}
-    -->
 
-    <hr />created by <a href="/profile/user/view/uid={{ task.created_by.id }}">{{ task.created_by.username }}</a>
+    <hr />created by <a href="{% url view_user_profile 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 />
     
     {% if reviewers %}
-		Reviewers:
+    Reviewers:
 	    {% for reviewer in reviewers %}
-		<a href="/profile/user/view/uid={{reviewer.id}}">{{reviewer.username}}</a>
+		<a href="{% url view_user_profile reviewer.id %}">{{reviewer.username}}</a>
 	    {% endfor %}
     {% endif %}
 
-    
     {% if can_mod_reviewers %}
-        <a href="/task/addreviewer/tid={{task.uniq_key}}">
+        <a href="{% url addreviewer_task task.id %}">
 		Add a Reviewer to this task</a>
     {% endif %}
     <br />
@@ -52,48 +45,25 @@
         <hr />
     {% endif %}
 
-    
-    <!--
-    {% ifequal task.status "CD" %}
-        Task has been closed by <a href="/profile/user/view={{closing_notification.sent_from.id}}">{{closing_notification.sent_from.username}}</a>
-        on {{closing_notification.sent_date|date:"D d M Y"}} at {{closing_notification.sent_date|time:"H:i"}}<br />
-        <b>Reason: </b>{{closing_notification.remarks}}<br />
-    {% endifequal %}
-    
-    {% ifequal task.status "CM" %}
-        Task has been marked complete by <a href="/profile/user/view={{completed_notification.sent_from.id}}">
-        {{completed_notification.sent_from.username}}</a>
-        on {{completed_notification.sent_date|date:"D d M Y"}} at {{completed_notification.sent_date|time:"H:i"}}<br />
-    {% endifequal %}
-        
-    {% ifequal task.status "OP" %}
-        <br />There are no users working on this task.<br />
-    {% endifequal %}
-    
-    {% if subs %}
-        <br />This task cannot be claimed.. It exists only to show all of its sub tasks in one place.<br />
-    {% endif %}
-    -->
-        
     {% if selected_users %}
         Users working on this task:
         {% for user in selected_users %}
-            <a href="/profile/user/view/uid={{user.id}}">{{user.username}}</a>
+            <a href="{% url view_profile user.id %}">{{user.username}}</a>
         {% endfor %}
         <br />
     {% endif %}
     
     {% if task_claimable %}
-	<a href="/task/claim/tid={{task.uniq_key}}">View claims</a>
+  <a href="{% url claim_task task.id %}">View claims</a>
     {% endif %}
 
-    <a href="/task/view/work/tid={{task.uniq_key}}">View submitted work reports</a>
-    
+    <a href="{% url view_work task.id %}">View submitted work reports</a>
+
         <hr />
     {% if comments %}
         comments:<br /><br />
         {% for comment in comments %}
-            <a href="/profile/user/view/uid={{comment.commented_by.id}}">{{ comment.commented_by.username }}</a> 
+            <a href="{% url view_profile comment.commented_by.id %}">{{ comment.commented_by.username }}</a> 
             on {{ comment.comment_datetime|date:"D d M Y"}} at {{comment.comment_datetime|time:"H:i"}} wrote:<br />
         {{ comment.data|linebreaksbr }}<br />
         {% endfor %}
--- a/pytask/templates/task/view_textbook.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/view_textbook.html	Sat Jan 15 21:21:49 2011 +0530
@@ -6,17 +6,17 @@
     <h3>{{ textbook.name }}</h3>
 
     {% if can_edit %}
-        <a href="/task/textbook/edit/tid={{textbook.uniq_key}}">Edit Text book</a>
+        <a href="{% url edit_textbook textbook.id %}">Edit Text book</a>
     {% endif %}
     
     {% if can_approve %}
-        <a href="/task/textbook/approve/tid={{textbook.uniq_key}}">Approve Text book</a>
+        <a href="{% url approve_textbook textbook.id %}">Approve Text book</a>
     {% endif %}
 
-    <hr />created by <a href="/profile/user/view/uid={{ textbook.created_by.id }}">{{ textbook.created_by.username }}</a>
+    <hr />created by <a href="{% url view_textbook textbook.created_by.id %}">{{ textbook.created_by.username }}</a>
     on {{textbook.creation_datetime|date:"D d M Y"}} at {{textbook.creation_datetime|time:"H:i"}}<br />
     <hr />
-    
+
     {% if textbook.tags.count %}
         Tags: 
         {% for tag in textbook.tags %}
@@ -30,7 +30,7 @@
     <table>
     {% for chap in chapters %}
     <tr>
-	    <td><a href="/task/view/tid={{chap.uniq_key}}">{{chap.title}}</a> </td>
+	    <td><a href="{% url view_task chap.id %}">{{chap.title}}</a> </td>
 	    <td> {{chap.status}} </td>
     </tr>
     {% endfor %}
@@ -39,14 +39,11 @@
     There are no chapters in this textbook as of now.<br />
     {% endif %}
 
-
-    
-    
         <hr />
     {% if comments %}
         comments:<br /><br />
         {% for comment in comments %}
-            <a href="/profile/user/view/uid={{comment.commented_by.id}}">{{ comment.commented_by.username }}</a> 
+            <a href="{% url view_profile comment.commented_by.id %}">{{ comment.commented_by.username }}</a> 
             on {{ comment.comment_datetime|date:"D d M Y"}} at {{comment.comment_datetime|time:"H:i"}} wrote:<br />
         {{ comment.data|linebreaksbr }}<br />
         {% endfor %}
--- a/pytask/templates/task/view_work.html	Sat Jan 15 21:21:19 2011 +0530
+++ b/pytask/templates/task/view_work.html	Sat Jan 15 21:21:49 2011 +0530
@@ -10,14 +10,14 @@
 {% for rep in old_reports %}
 <tr>
 	<td>{{rep.submitted_by}}</td>
-	<td><a href="/task/view/report/rid={{rep.uniq_key}}">{{rep.data}}</a></td>
+	<td><a href="{% url view_report rep.id %}">{{rep.data}}</a></td>
 	<td><a href="{{rep.attachment.url}}">{{rep.attachment.name}}</a> </td>
 </tr>
 {% endfor %}
 </table>
 {% endif %}
 {% if is_working %}
-<a href="/task/submit/report/tid={{task.uniq_key}}">Submit report</a>
+<a href="{% url submit_report rep.id %}">Submit report</a>
 <hr />
 {% endif %}
 {% endblock %}