created a view for about pages and added about pages for mentor and addmentors.
authornishanth
Sat, 27 Feb 2010 01:27:35 +0530
changeset 127 71888e23f323
parent 126 e5377fdaf110
child 128 f34e3a3e1439
created a view for about pages and added about pages for mentor and addmentors.
taskapp/views/user.py
templates/about/addmentors.html
templates/about/mentor.html
templates/task/publish.html
urls.py
--- a/taskapp/views/user.py	Sat Feb 27 00:48:50 2010 +0530
+++ b/taskapp/views/user.py	Sat Feb 27 01:27:35 2010 +0530
@@ -15,6 +15,11 @@
 from pytask.taskapp.utilities.request import get_request
 from pytask.taskapp.utilities.notification import get_notification
 
+about = {
+    "addmentors":"about/addmentors.html",
+    "mentor":"about/mentor.html",
+}
+
 def show_msg(user, message, redirect_url=None, url_desc=None):
     """ simply redirect to homepage """
     
@@ -61,6 +66,17 @@
         return render_to_response('index.html', context)
 
 @login_required
+def learn_more(request, what):
+    """ depending on what was asked for, we render different pages.
+    """
+
+    disp_template = about.get(what, None)
+    if not disp_template:
+        raise Http404
+    else:
+        return render_to_response(disp_template)
+
+@login_required
 def view_my_profile(request,uid=None):
     """ allows the user to view the profiles of users """
     if uid == None:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/about/addmentors.html	Sat Feb 27 01:27:35 2010 +0530
@@ -0,0 +1,12 @@
+{% extends 'base.html' %}
+{% block title %}
+    {{task.title}}
+{% endblock %}
+{% block content %}
+     
+    A Mentor<sup><a href="/about/mentor/">learn more</a></sup>
+    of the task can request other users to mentor the task by clicking the link "Add more mentors" available on the task page.
+    A request will be sent to the user and he will also become the mentor of the task if he accepts it.<br />
+    
+    <br /><a href="javascript:history.go(-1)">Click here</a> to get back to the previous page.
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/about/mentor.html	Sat Feb 27 01:27:35 2010 +0530
@@ -0,0 +1,12 @@
+{% extends 'base.html' %}
+{% block title %}
+    {{task.title}}
+{% endblock %}
+{% block content %}
+    The user who created a task will become a mentor for the task. Mentor is a person who mentors the task.
+    Mentor has all the rights over the task. A Mentor can request other users also to mentor the task.
+    Mentor can add/remove subtasks if applicable. Mentor can request assign of credits for task.
+    Mentor can mark the task as Invalid/Complete.<br />
+    
+    <br /><a href="javascript:history.go(-1)">Click here</a> to get back to the previous page.
+{% endblock %}
--- a/templates/task/publish.html	Sat Feb 27 00:48:50 2010 +0530
+++ b/templates/task/publish.html	Sat Feb 27 01:27:35 2010 +0530
@@ -5,7 +5,8 @@
 {% block content %}
     <b>Disclaimer:</b><br />
     Publishing a task will make the task visible to every one and cannot be edited there after.<br /><br />
-    Only you will have mentoring rights on this task. But you can request other users also to mentor the task. <br /><br />
+    Only you will have mentoring rights on this task. But you can request other users also to mentor the task.
+    <sup><a href="/about/addmentors/">learn more</a></sup><br /><br />
     This action cannot be undone.
     <br />
     Please confirm if you want to publish.
--- a/urls.py	Sat Feb 27 00:48:50 2010 +0530
+++ b/urls.py	Sat Feb 27 01:27:35 2010 +0530
@@ -54,5 +54,7 @@
     (r'^user/notifications/$', userViews.browse_notifications),
     (r'^user/notifications/nid=(\d+)/$', userViews.view_notification),
     (r'^user/notifications/nid=(\d+)/(\w+)/$', userViews.edit_notification),
+
+    (r'^about/(\w+)/$', userViews.learn_more),
     
 )