From 4ddabde600ec7e56f277822d76ef5193da7d2f4f Mon Sep 17 00:00:00 2001 From: nishanth Date: Sat, 27 Feb 2010 01:27:35 +0530 Subject: created a view for about pages and added about pages for mentor and addmentors. --- taskapp/views/user.py | 16 ++++++++++++++++ templates/about/addmentors.html | 12 ++++++++++++ templates/about/mentor.html | 12 ++++++++++++ templates/task/publish.html | 3 ++- urls.py | 2 ++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 templates/about/addmentors.html create mode 100644 templates/about/mentor.html diff --git a/taskapp/views/user.py b/taskapp/views/user.py index 906616f..91334ad 100644 --- a/taskapp/views/user.py +++ b/taskapp/views/user.py @@ -15,6 +15,11 @@ from pytask.taskapp.forms.user import UserProfileEditForm 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 """ @@ -60,6 +65,17 @@ def homepage(request): 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 """ diff --git a/templates/about/addmentors.html b/templates/about/addmentors.html new file mode 100644 index 0000000..001bd97 --- /dev/null +++ b/templates/about/addmentors.html @@ -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 --git a/templates/about/mentor.html b/templates/about/mentor.html new file mode 100644 index 0000000..46df8f7 --- /dev/null +++ b/templates/about/mentor.html @@ -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 --git a/templates/task/publish.html b/templates/task/publish.html index e4b79e2..88d4aa7 100644 --- a/templates/task/publish.html +++ b/templates/task/publish.html @@ -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 --git a/urls.py b/urls.py index ba2e099..47cec91 100644 --- a/urls.py +++ b/urls.py @@ -54,5 +54,7 @@ urlpatterns = patterns('', (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), ) -- cgit