# HG changeset patch # User nishanth # Date 1267214255 -19800 # Node ID 71888e23f323170cf71d7dfcf9b82e8ed2aea511 # Parent e5377fdaf11094866ea661d6210a6143ba13ec50 created a view for about pages and added about pages for mentor and addmentors. diff -r e5377fdaf110 -r 71888e23f323 taskapp/views/user.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: diff -r e5377fdaf110 -r 71888e23f323 templates/about/addmentors.html --- /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 Mentorlearn more + 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.
+ +
Click here to get back to the previous page. +{% endblock %} diff -r e5377fdaf110 -r 71888e23f323 templates/about/mentor.html --- /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.
+ +
Click here to get back to the previous page. +{% endblock %} diff -r e5377fdaf110 -r 71888e23f323 templates/task/publish.html --- 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 %} Disclaimer:
Publishing a task will make the task visible to every one and cannot be edited there after.

- Only you will have mentoring rights on this task. But you can request other users also to mentor the task.

+ Only you will have mentoring rights on this task. But you can request other users also to mentor the task. + learn more

This action cannot be undone.
Please confirm if you want to publish. diff -r e5377fdaf110 -r 71888e23f323 urls.py --- 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), )