summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornishanth2010-02-27 01:27:35 +0530
committernishanth2010-02-27 01:27:35 +0530
commit4ddabde600ec7e56f277822d76ef5193da7d2f4f (patch)
tree9e752cb554d8a7fd5d67259c46aa758d395dae46
parent35cac9b34425e63e63a4c4ca5376bdf513550af4 (diff)
downloadpytask-4ddabde600ec7e56f277822d76ef5193da7d2f4f.tar.gz
pytask-4ddabde600ec7e56f277822d76ef5193da7d2f4f.tar.bz2
pytask-4ddabde600ec7e56f277822d76ef5193da7d2f4f.zip
created a view for about pages and added about pages for mentor and addmentors.
-rw-r--r--taskapp/views/user.py16
-rw-r--r--templates/about/addmentors.html12
-rw-r--r--templates/about/mentor.html12
-rw-r--r--templates/task/publish.html3
-rw-r--r--urls.py2
5 files changed, 44 insertions, 1 deletions
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 """
@@ -61,6 +66,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 """
if uid == None:
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 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 %}
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.<br />
+
+ <br /><a href="javascript:history.go(-1)">Click here</a> 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 %}
<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.
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),
)