--- a/taskapp/events/request.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/events/request.py Wed Jan 05 22:22:10 2011 +0530
@@ -1,6 +1,6 @@
from datetime import datetime
from pytask.taskapp.models import Profile
-from pytask.taskapp.events.task import addMentor
+from pytask.taskapp.events.task import addReviewer
from pytask.taskapp.events.user import changeRole
from pytask.taskapp.utilities.notification import create_notification
@@ -33,24 +33,24 @@
task = request_obj.task
requested_by = request_obj.sent_by
if reply:
- ## tell the replied user that he is mentor for this task and give him learn more link
+ ## tell the replied user that he is reviewer for this task and give him learn more link
create_notification("NT", request_obj.replied_by, task=task)
## now check if there are such similar requests and mark them as invalid
## they cannot be of type PY and so we can use the replied_by to get requests
pending_requests = replied_by.request_sent_to.filter(is_valid=True, is_replied=False, role="MT",task=task)
for req in pending_requests:
- create_notification("MT", req.sent_by, replied_by, False, task=req.task, remarks = "User has already accepted one such request and is a mentor.", requested_by = req.sent_by)
+ create_notification("MT", req.sent_by, replied_by, False, task=req.task, remarks = "User has already accepted one such request and is a reviewer.", requested_by = req.sent_by)
req.is_valid = False
req.save()
- ## alert all the mentors including who made request and all assigned users
- for a_mentor in task.mentors.all():
- create_notification(request_obj.role, a_mentor, replied_by, True, task, request_obj.remarks, requested_by)
+ ## alert all the reviewers including who made request and all assigned users
+ for a_reviewer in task.reviewers.all():
+ create_notification(request_obj.role, a_reviewer, replied_by, True, task, request_obj.remarks, requested_by)
for a_user in task.assigned_users.all():
create_notification(request_obj.role, a_user, replied_by, True, task, request_obj.remarks, requested_by)
- addMentor(task, request_obj.replied_by)
+ addReviewer(task, request_obj.replied_by)
else:
## tell the requested user that his request was rejected due to these reasons.
create_notification(request_obj.role, requested_by, replied_by, False, task, request_obj.remarks, requested_by)
--- a/taskapp/events/task.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/events/task.py Wed Jan 05 22:22:10 2011 +0530
@@ -5,7 +5,7 @@
from pytask.taskapp.utilities.helper import get_key
from pytask.taskapp.utilities.notification import create_notification
-def publishTask(task, rem_mentors=True, rem_comments=True):
+def publishTask(task, rem_reviewers=True, rem_comments=True):
""" set the task status to open """
# if task.sub_type == 'D':
@@ -19,9 +19,9 @@
else:
task.status = "OP"
- if rem_mentors:
- task.mentors.clear()
- task.mentors.add(task.created_by)
+ if rem_reviewers:
+ task.reviewers.clear()
+ task.reviewers.add(task.created_by)
if rem_comments:
task.comment_set.update(is_deleted=True)
@@ -93,22 +93,22 @@
main_task.save()
-def reqMentor(task, mentor, req_by):
+def reqReviewer(task, reviewer, req_by):
""" create a request object with role as MT.
"""
- create_request(sent_by=req_by, role="MT", sent_to=mentor, task=task)
+ create_request(sent_by=req_by, role="MT", sent_to=reviewer, task=task)
-def addMentor(task,mentor):
- """ add the mentor to mentors list of the task """
+def addReviewer(task,reviewer):
+ """ add the reviewer to reviewers list of the task """
- task.mentors.add(mentor)
+ task.reviewers.add(reviewer)
task.save()
return task
def createTask(title,desc,created_by,credits):
""" creates a bare minimum task with title, description and credits.
- the creator of the task will be assigned as a mentor for the task.
+ the creator of the task will be assigned as a reviewer for the task.
"""
while True:
@@ -147,11 +147,11 @@
req.is_valid = False
req.save()
user_url = '<a href="/user/view/uid=%s">%s</a>'%(user.id, user.username)
- reason = "User has claimed the task and hence cannot be a mentor and this request was made invalid."
+ reason = "User has claimed the task and hence cannot be a reviewer and this request was made invalid."
create_notification("MT", req.sent_by, user, task=task, reply=False, remarks=reason, requested_by=req.sent_by)
- for a_mentor in task.mentors.all():
- create_notification("CL", a_mentor, user, task=task, remarks=message)
+ for a_reviewer in task.reviewers.all():
+ create_notification("CL", a_reviewer, user, task=task, remarks=message)
def assignTask(task, added_user, assigned_by):
""" check for the status of task and assign it to the particular user """
@@ -231,8 +231,8 @@
for a_user in task.claimed_users.all():
create_notification(role="CM", sent_to=a_user, sent_from=marked_by, task=task)
- for a_mentor in task.mentors.all():
- create_notification(role="CM", sent_to=a_mentor, sent_from=marked_by, task=task)
+ for a_reviewer in task.reviewers.all():
+ create_notification(role="CM", sent_to=a_reviewer, sent_from=marked_by, task=task)
def closeTask(task, closed_by, reason=None):
""" set the status of task as CD.
@@ -253,8 +253,8 @@
for a_user in task.claimed_users.all():
create_notification(role="CD", sent_to=a_user, sent_from=closed_by, task=task, remarks=reason)
- for a_mentor in task.mentors.all():
- create_notification(role="CD", sent_to=a_mentor, sent_from=closed_by, task=task, remarks=reason)
+ for a_reviewer in task.reviewers.all():
+ create_notification(role="CD", sent_to=a_reviewer, sent_from=closed_by, task=task, remarks=reason)
def deleteTask(task, deleted_by, reason=None):
""" set the task status as DL
@@ -267,5 +267,5 @@
pending_requests = task.request_task.filter(is_replied=False,is_valid=True)
pending_requests.update(is_valid=False)
- for a_mentor in task.mentors.exclude(id=deleted_by.id):
- create_notification("DL", sent_to=a_mentor, sent_from=deleted_by, task=task, remarks=reason)
+ for a_reviewer in task.reviewers.exclude(id=deleted_by.id):
+ create_notification("DL", sent_to=a_reviewer, sent_from=deleted_by, task=task, remarks=reason)
--- a/taskapp/forms/task.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/forms/task.py Wed Jan 05 22:22:10 2011 +0530
@@ -45,11 +45,11 @@
except Task.DoesNotExist:
return data
-def AddMentorForm(choices,instance=None):
+def AddReviewerForm(choices,instance=None):
""" return a form object with appropriate choices """
class myform(forms.Form):
- mentor = forms.ChoiceField(choices=choices, required=True)
+ reviewer = forms.ChoiceField(choices=choices, required=True)
form = myform(instance) if instance else myform()
return form
--- a/taskapp/management/commands/seed_db.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/management/commands/seed_db.py Wed Jan 05 22:22:10 2011 +0530
@@ -14,9 +14,9 @@
def seed_db():
""" a method to seed the database with random data """
- defaultMentor = userEvents.createSuUser("admin", "admin@example.com", "123456", datetime.now(), "M")
- mentor_profile = defaultMentor.get_profile()
- userEvents.updateProfile(mentor_profile, {'rights':"AD"})
+ defaultReviewer = userEvents.createSuUser("admin", "admin@example.com", "123456", datetime.now(), "M")
+ reviewer_profile = defaultReviewer.get_profile()
+ userEvents.updateProfile(reviewer_profile, {'rights':"AD"})
for i in range(1,21):
@@ -29,11 +29,11 @@
create_notification("NU", user)
if i%4==0:
- create_request(defaultMentor, "MG", user)
+ create_request(defaultReviewer, "MG", user)
elif i%3==0:
- create_request(defaultMentor, "DV", user)
+ create_request(defaultReviewer, "DV", user)
elif i%2==0:
- create_request(defaultMentor, "AD", user)
+ create_request(defaultReviewer, "AD", user)
elif i in [7, 13]:
user.is_active = False
user.save()
@@ -42,12 +42,12 @@
title = "Task "+str(i)
desc = "I am "+title
- created_by = defaultMentor
+ created_by = defaultReviewer
credits = 20
task = taskEvents.createTask(title,desc,created_by,credits)
if task:
- taskEvents.addMentor(task, defaultMentor)
+ taskEvents.addReviewer(task, defaultReviewer)
if i%2==0:taskEvents.publishTask(task)
class Command(NoArgsCommand):
--- a/taskapp/models.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/models.py Wed Jan 05 22:22:10 2011 +0530
@@ -26,7 +26,7 @@
("CM", "Completed"))
NOTIFY_CHOICES = (
- ("MT", "Add Mentor"),
+ ("MT", "Add Reviewer"),
("DV", "Developer"),
("MG", "Manager"),
("AD", "Admin"),
@@ -35,7 +35,7 @@
("CD", "Task closed"),
("DL", "Task deleted"),
("NU", "New User"),
- ("NT", "New Mentor"),
+ ("NT", "New Reviewer"),
("ND", "New Developer"),
("NG", "New Manager"),
("NA", "New Admin"),
@@ -97,7 +97,7 @@
credits = models.PositiveSmallIntegerField(help_text = u"No.of credits a user gets on completing the task")
progress = models.PositiveSmallIntegerField(default = 0)
- mentors = models.ManyToManyField(User, related_name = "%(class)s_mentors")
+ reviewers = models.ManyToManyField(User, related_name = "%(class)s_reviewers")
created_by = models.ForeignKey(User, related_name = "%(class)s_created_by")
claimed_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_claimed_users")
assigned_users = models.ManyToManyField(User, blank = True, related_name = "%(class)s_assigned_users")
--- a/taskapp/utilities/notification.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/utilities/notification.py Wed Jan 05 22:22:10 2011 +0530
@@ -9,12 +9,12 @@
sent_to: a user to which the notification is to be sent
sent_from : a user from which the message has originated
A user who approves/rejects in case of request
- A mentor who closes/complets the task
+ A reviewer who closes/complets the task
reply: A boolean
task: a task if applicable
requested_by: a user makes the request
- A mentor who assigns credits in case of pynts
- A mentor who requests to act as a mentor
+ A reviewer who assigns credits in case of pynts
+ A reviewer who requests to act as a reviewer
remarks: any remarks for rejecting
receiving_user: user receiving pynts
pynts: the obvious
@@ -33,18 +33,18 @@
task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
credits_url = '<a href="/task/assigncredits/tid=%s">%s</a>'%(task.id, "click here")
- mentor_url = '<a href="/user/view/uid=%s">%s</a>'%(requested_by.id, requested_by.username)
+ reviewer_url = '<a href="/user/view/uid=%s">%s</a>'%(requested_by.id, requested_by.username)
admin_url = '<a href="/user/view/uid=%s">%s</a>'%(sent_from.id, sent_from.username)
user_url = '<a href="/user/view/uid=%s">%s</a>'%(receiving_user.id, receiving_user.username)
if reply:
notification.sub = "Approved request for assign of credits for %s"%task.title[:20]
notification.message = """ Request made by %s to assign %s pynts to %s for the task %s has been approved by %s<br />
- %s if you want the view/assign pynts page of the task.<br />"""%(mentor_url, pynts, user_url, task_url, admin_url, credits_url)
+ %s if you want the view/assign pynts page of the task.<br />"""%(reviewer_url, pynts, user_url, task_url, admin_url, credits_url)
else:
notification.sub = "Rejected request for assign of credits for %s"%task.title[:20]
- notification.message = """ Request made by %s to assign %s pynts to %s for the task %s has been rejected by %s.<br /> """%(mentor_url, pynts, user_url, task_url, admin_url)
+ notification.message = """ Request made by %s to assign %s pynts to %s for the task %s has been rejected by %s.<br /> """%(reviewer_url, pynts, user_url, task_url, admin_url)
if remarks:
notification.remarks = remarks
notification.message += "Reason: %s<br />"%remarks
@@ -56,18 +56,18 @@
notification.sent_from = sent_from
task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
- requested_mentor_url = '<a href="/user/view/uid=%s">%s</a>'%(requested_by.id, requested_by.username)
- new_mentor = sent_from
- new_mentor_url = '<a href="/user/view/uid=%s">%s</a>'%(new_mentor.id, new_mentor.username)
+ requested_reviewer_url = '<a href="/user/view/uid=%s">%s</a>'%(requested_by.id, requested_by.username)
+ new_reviewer = sent_from
+ new_reviewer_url = '<a href="/user/view/uid=%s">%s</a>'%(new_reviewer.id, new_reviewer.username)
if reply:
- notification.sub = "New mentor for the task %s"%task.title[:20]
- notification.message = "%s has accepted the request made by %s, asking him act as a mentor for the task %s<br />"%(new_mentor_url, requested_mentor_url, task_url)
- notification.message += "He can be contacted on %s"%new_mentor.email
+ notification.sub = "New reviewer for the task %s"%task.title[:20]
+ notification.message = "%s has accepted the request made by %s, asking him act as a reviewer for the task %s<br />"%(new_reviewer_url, requested_reviewer_url, task_url)
+ notification.message += "He can be contacted on %s"%new_reviewer.email
else:
- notification.sub = "%s rejected request to act as a mentor"%new_mentor.username
- notification.message = "%s has rejected your request asking him to act as a mentor for %s.<br />"%(new_mentor_url, task_url)
+ notification.sub = "%s rejected request to act as a reviewer"%new_reviewer.username
+ notification.message = "%s has rejected your request asking him to act as a reviewer for %s.<br />"%(new_reviewer_url, task_url)
if remarks:
notification.remarks = remarks
notification.message += "Remarks: %s<br />"%remarks
@@ -95,16 +95,16 @@
elif role == "NT":
notification.task = task
- new_mentor = sent_to
- mentor_learn_url = '<sup><a href="/about/mentor/">learn more</a></sup>'
+ new_reviewer = sent_to
+ reviewer_learn_url = '<sup><a href="/about/reviewer/">learn more</a></sup>'
task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
- notification.sub = "You are mentoring the task %s"%task.title[:20]
- notification.message = "You have accepted to act as a mentor%s for the task %s.<br />"%(mentor_learn_url, task_url)
- notification.message += " Here is a list of other mentors and their email addresses.<br /> <ul>"
+ notification.sub = "You are reviewering the task %s"%task.title[:20]
+ notification.message = "You have accepted to act as a reviewer%s for the task %s.<br />"%(reviewer_learn_url, task_url)
+ notification.message += " Here is a list of other reviewers and their email addresses.<br /> <ul>"
- for a_mentor in task.mentors.exclude(id=new_mentor.id):
- notification.message += "<li> %s - %s </li>"%(a_mentor.username, a_mentor.email)
+ for a_reviewer in task.reviewers.exclude(id=new_reviewer.id):
+ notification.message += "<li> %s - %s </li>"%(a_reviewer.username, a_reviewer.email)
notification.message += "</ul>"
working_users = task.assigned_users.all()
@@ -114,7 +114,7 @@
for a_user in working_users:
notification.message += "<li> %s - %s </li>"%(a_user.username, a_user.email)
notification.message += "</ul><br />"
- notification.message += "Happy Mentoring."
+ notification.message += "Happy Reviewering."
elif role == "NU":
@@ -150,17 +150,17 @@
notification.task = task
notification.remarks = remarks
- mentor = sent_from
- mentor_url = '<a href="/user/view/uid=%s">%s</a>'%(mentor.id, mentor.username)
+ reviewer = sent_from
+ reviewer_url = '<a href="/user/view/uid=%s">%s</a>'%(reviewer.id, reviewer.username)
task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
if role == "CM":
notification.sub = "%s has been marked complete"%task.title
- notification.message = "The task %s has been marked complete by %s.<br />"%(task_url, mentor_url)
+ notification.message = "The task %s has been marked complete by %s.<br />"%(task_url, reviewer_url)
elif role == "CD":
notification.sub = "%s has been closed"%task.title
- notification.message = "The task %s has been closed by %s.<br />"%(task_url, mentor_url)
+ notification.message = "The task %s has been closed by %s.<br />"%(task_url, reviewer_url)
if remarks:
notification.remarks = remarks
@@ -171,17 +171,17 @@
notification.task = task
notification.sent_from = sent_from
added_user = sent_to
- mentor = sent_from
- assigned_by_url = '<a href="/user/view/uid=%s">%s</a>'%(mentor.id, mentor.username)
+ reviewer = sent_from
+ assigned_by_url = '<a href="/user/view/uid=%s">%s</a>'%(reviewer.id, reviewer.username)
task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
notification.sub = "Your claim for the task %s accepted."%task.title[:20]
notification.message = "You have been selected to work on the task %s by %s.<br />"%(task_url, assigned_by_url)
- notification.message += "You can now start working on the task and will be credited by the mentors for your work.<br />"
+ notification.message += "You can now start working on the task and will be credited by the reviewers for your work.<br />"
- notification.message += " Here is a list of mentors for the task and their email addresses.<br /> <ul>"
- for a_mentor in task.mentors.all():
- notification.message += "<li> %s - %s </li>"%(a_mentor.username, a_mentor.email)
+ notification.message += " Here is a list of reviewers for the task and their email addresses.<br /> <ul>"
+ for a_reviewer in task.reviewers.all():
+ notification.message += "<li> %s - %s </li>"%(a_reviewer.username, a_reviewer.email)
notification.message += "</ul>"
working_users = task.assigned_users.exclude(id=added_user.id)
@@ -197,8 +197,8 @@
notification.task = task
notification.sent_from = sent_from
removed_user = sent_to
- mentor = sent_from
- removed_by_url = '<a href="/user/view/uid=%s">%s</a>'%(mentor.id, mentor.username)
+ reviewer = sent_from
+ removed_by_url = '<a href="/user/view/uid=%s">%s</a>'%(reviewer.id, reviewer.username)
task_url = '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
claim_url = '<a href="/task/claim/tid=%s">%s</a>'%(task.id, "clicking here")
@@ -233,7 +233,7 @@
task_url = '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
notification.sub = 'New claim for the task "%s"'%(task.title[:20])
- notification.message = '%s has submitted a %s for the task "%s" mentored by you.<br />'%(claimed_by_url, claim_url, task_url)
+ notification.message = '%s has submitted a %s for the task "%s" reviewered by you.<br />'%(claimed_by_url, claim_url, task_url)
notification.message += '<b>Claim proposal:</b> %s'%(remarks)
--- a/taskapp/views/task.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/views/task.py Wed Jan 05 22:22:10 2011 +0530
@@ -5,12 +5,12 @@
from pytask.taskapp.models import User, Task, Comment, Request, Notification
from pytask.taskapp.utilities.task import getTask
-from pytask.taskapp.forms.task import TaskCreateForm, AddMentorForm, AddTaskForm, ChoiceForm, AssignCreditForm, RemoveUserForm, EditTaskForm, ClaimTaskForm
-from pytask.taskapp.events.task import createTask, reqMentor, publishTask, addSubTask, addDep, addClaim, assignTask, updateTask, removeTask, removeUser, assignCredits, completeTask, closeTask, addMentor, deleteTask
+from pytask.taskapp.forms.task import TaskCreateForm, AddReviewerForm, AddTaskForm, ChoiceForm, AssignCreditForm, RemoveUserForm, EditTaskForm, ClaimTaskForm
+from pytask.taskapp.events.task import createTask, reqReviewer, publishTask, addSubTask, addDep, addClaim, assignTask, updateTask, removeTask, removeUser, assignCredits, completeTask, closeTask, addReviewer, deleteTask
from pytask.taskapp.views.user import show_msg
from pytask.taskapp.utilities.user import get_user
-## everywhere if there is no task, django should display 500 message.. but take care of that in sensitive views like add mentor and all
+## everywhere if there is no task, django should display 500 message.. but take care of that in sensitive views like add reviewer and all
## do not create su user thro syncdb
def browse_tasks(request):
@@ -40,7 +40,7 @@
return render_to_response('task/browse.html', context)
def publish_task(request, tid):
- """ check if user is the mentor and also if the task status is UP.
+ """ check if user is the reviewer and also if the task status is UP.
"""
task_url = "/task/view/tid=%s"%tid
@@ -49,7 +49,7 @@
task = getTask(tid)
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in task.mentors.all() else False
+ is_reviewer = True if user in task.reviewers.all() else False
if user == task.created_by:
context = {
@@ -79,41 +79,41 @@
if task.status == "DL":
return show_msg(user, 'This task no longer exists', '/task/browse/','browse the tasks')
comments = task.comment_set.filter(is_deleted=False).order_by('creation_datetime')
- mentors = task.mentors.all()
+ reviewers = task.reviewers.all()
deps, subs = task.deps, task.subs
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in task.mentors.all() else False
+ is_reviewer = True if user in task.reviewers.all() else False
context = {'user':user,
'task':task,
'comments':comments,
- 'mentors':mentors,
+ 'reviewers':reviewers,
'subs':subs,
'deps':deps,
'is_guest':is_guest,
- 'is_mentor':is_mentor,
+ 'is_reviewer':is_reviewer,
}
claimed_users = task.claimed_users.all()
- is_requested_mentor = True if user.is_authenticated() and user.request_sent_to.filter(is_valid=True,is_replied=False,role="MT",task=task) else False
- task_viewable = True if ( task.status != "UP" ) or is_mentor or is_requested_mentor else False
+ is_requested_reviewer = True if user.is_authenticated() and user.request_sent_to.filter(is_valid=True,is_replied=False,role="MT",task=task) else False
+ task_viewable = True if ( task.status != "UP" ) or is_reviewer or is_requested_reviewer else False
if not task_viewable:
return show_msg(user, "You are not authorised to view this task", "/task/browse/", "browse the tasks")
- context['is_requested_mentor'] = is_requested_mentor
+ context['is_requested_reviewer'] = is_requested_reviewer
context['can_publish'] = True if task.status == "UP" and user == task.created_by else False
- context['can_edit'] = True if task.status == "UP" and is_mentor else False
- context['can_close'] = True if task.status not in ["UP", "CD", "CM"] and is_mentor else False
+ context['can_edit'] = True if task.status == "UP" and is_reviewer else False
+ context['can_close'] = True if task.status not in ["UP", "CD", "CM"] and is_reviewer else False
context['can_delete'] = True if task.status == "UP" and user == task.created_by else False
- context['can_mod_mentors'] = True if task.status in ["UP", "OP", "LO", "WR"] and is_mentor else False
- context['can_mod_tasks'] = True if task.status in ["UP", "OP", "LO"] and is_mentor else False
+ context['can_mod_reviewers'] = True if task.status in ["UP", "OP", "LO", "WR"] and is_reviewer else False
+ context['can_mod_tasks'] = True if task.status in ["UP", "OP", "LO"] and is_reviewer else False
- context['can_assign_credits'] = True if task.status in ["OP", "WR"] and is_mentor else False
+ context['can_assign_credits'] = True if task.status in ["OP", "WR"] and is_reviewer else False
context['task_claimable'] = True if task.status in ["OP", "WR"] and not is_guest else False
if task.status == "CD":
@@ -160,7 +160,7 @@
#publish = data['publish'] # just in case if we have to show the option
task = createTask(title,desc,user,credits)
- addMentor(task, user)
+ addReviewer(task, user)
updateTask(task,tags_field=data['tags_field'])
# if publish: publishTask(task)
task_url = '/task/view/tid=%s'%task.id
@@ -175,7 +175,7 @@
else:
return show_msg(user, 'You are not authorised to create a task.', "/", "home page")
-def add_mentor(request, tid):
+def add_reviewer(request, tid):
""" check if the current user has the rights to edit the task and add him.
if user is not authenticated, redirect him to concerned page. """
@@ -187,15 +187,15 @@
is_guest = True if not user.is_authenticated() else False
- if (not is_guest) and user in task.mentors.all():
+ if (not is_guest) and user in task.reviewers.all():
pending_requests = Request.objects.filter(is_replied=False,is_valid=True,role="MT",task=task).order_by('creation_date').reverse()
user_pending_requests = pending_requests.filter(sent_by=user)
## now iam going for a brute force method
user_list = list(User.objects.filter(is_active=True))
- for mentor in task.mentors.all():
- user_list.remove(mentor)
+ for reviewer in task.reviewers.all():
+ user_list.remove(reviewer)
for a_user in task.claimed_users.all():
user_list.remove(a_user)
@@ -206,11 +206,11 @@
for req in user_pending_requests:
user_list.remove(req.sent_to.all()[0])
- non_mentors = ((_.id, _.username) for _ in user_list)
- non_mentor_ids = [ str(a_user.id) for a_user in user_list ]
+ non_reviewers = ((_.id, _.username) for _ in user_list)
+ non_reviewer_ids = [ str(a_user.id) for a_user in user_list ]
## code till must be made elegant and not brute force like above
- form = AddMentorForm(non_mentors)
+ form = AddReviewerForm(non_reviewers)
context = {
'user':user,
@@ -221,18 +221,18 @@
if request.method == "POST":
data = request.POST
- uid = data.get('mentor', None)
- if uid in non_mentor_ids:
- new_mentor = User.objects.get(id=int(uid))
- reqMentor(task, new_mentor, user)
- return redirect('/task/addmentor/tid=%s'%task.id)
+ uid = data.get('reviewer', None)
+ if uid in non_reviewer_ids:
+ new_reviewer = User.objects.get(id=int(uid))
+ reqReviewer(task, new_reviewer, user)
+ return redirect('/task/addreviewer/tid=%s'%task.id)
else:
## bogus post request
raise Http404
else:
- return render_to_response('task/addmentor.html', context)
+ return render_to_response('task/addreviewer.html', context)
else:
- return show_msg(user, 'You are not authorised to add mentors for this task', task_url, 'view the task')
+ return show_msg(user, 'You are not authorised to add reviewers for this task', task_url, 'view the task')
def add_tasks(request, tid):
""" first display tasks which can be subtasks for the task and do the rest.
@@ -257,7 +257,7 @@
is_guest = True if not user.is_authenticated() else False
- if (not is_guest) and user in task.mentors.all():
+ if (not is_guest) and user in task.reviewers.all():
if task.status in ["UP", "OP", "LO"]:
form = AddTaskForm(task_choices, is_plain)
if request.method == "POST":
@@ -304,7 +304,7 @@
task = getTask(tid)
is_guest = True if not user.is_authenticated() else False
- if (not is_guest) and user in task.mentors.all():
+ if (not is_guest) and user in task.reviewers.all():
if task.status in ["UP", "LO", "OP"]:
@@ -362,19 +362,19 @@
# this is what the next line should be when i re sync the db
claims = Notification.objects.filter(task=task, sent_to=task.created_by, role="CL")
- mentors = task.mentors.all()
+ reviewers = task.reviewers.all()
claimed_users = task.claimed_users.all()
assigned_users = task.assigned_users.all()
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in mentors else False
+ is_reviewer = True if user in reviewers else False
task_claimable = True if task.status in ["OP", "WR"] else False
- user_can_claim = True if task_claimable and not ( is_guest or is_mentor ) and ( user not in claimed_users ) and ( user not in assigned_users ) else False
+ user_can_claim = True if task_claimable and not ( is_guest or is_reviewer ) and ( user not in claimed_users ) and ( user not in assigned_users ) else False
task_claimed = True if claimed_users else False
context = {'user':user,
- 'is_mentor':is_mentor,
+ 'is_reviewer':is_reviewer,
'task':task,
'claims':claims,
'user_can_claim':user_can_claim,
@@ -409,9 +409,9 @@
task = getTask(tid)
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in task.mentors.all() else False
+ is_reviewer = True if user in task.reviewers.all() else False
- if (not is_guest) and is_mentor:
+ if (not is_guest) and is_reviewer:
assigned_users = task.assigned_users.all()
choices = [ (_.id,_.username) for _ in assigned_users ]
@@ -457,14 +457,14 @@
task = getTask(tid)
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in task.mentors.all() else False
+ is_reviewer = True if user in task.reviewers.all() else False
claimed_users = task.claimed_users.all()
assigned_users = task.assigned_users.all()
task_claimed = True if claimed_users else False
- if (not is_guest) and is_mentor:
+ if (not is_guest) and is_reviewer:
if task.status in ["OP", "WR"]:
if task_claimed:
user_list = ((user.id,user.username) for user in claimed_users)
@@ -487,10 +487,10 @@
return show_msg(user, 'You are not authorised to perform this action', task_url, 'view the task')
def assign_credits(request, tid):
- """ Check if the user is a mentor and credits can be assigned.
+ """ Check if the user is a reviewer and credits can be assigned.
Then display all the approved credits.
- Then see if mentor can assign credits to users also or only mentors.
- Then put up a form for mentor to assign credits accordingly.
+ Then see if reviewer can assign credits to users also or only reviewers.
+ Then put up a form for reviewer to assign credits accordingly.
"""
task_url = "/task/view/tid=%s"%tid
@@ -499,16 +499,16 @@
task = getTask(tid)
## the moment we see that user had requested credits, it means he had worked and hence we change the status to WR
- ## we have to discuss on this since, credits may also be given to mentor
+ ## we have to discuss on this since, credits may also be given to reviewer
task.status = "WR"
task.save()
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if (not is_guest) and user in task.mentors.all() else False
+ is_reviewer = True if (not is_guest) and user in task.reviewers.all() else False
- if is_mentor:
+ if is_reviewer:
if task.status in ["OP", "WR"]:
- choices = [(_.id,_.username) for _ in task.mentors.all()]
+ choices = [(_.id,_.username) for _ in task.reviewers.all()]
if task.status == "WR":
choices.extend([(_.id, _.username) for _ in task.assigned_users.all() ])
prev_credits = task.request_task.filter(role="PY",is_valid=True,is_replied=True,reply=True).count()
@@ -553,8 +553,8 @@
task_url = "/task/view/tid=%s"%tid
user = get_user(request.user) if request.user.is_authenticated() else request.user
- is_mentor = True if user in task.mentors.all() else False
- can_edit = True if is_mentor and task.status == "UP" else False
+ is_reviewer = True if user in task.reviewers.all() else False
+ can_edit = True if is_reviewer and task.status == "UP" else False
if can_edit:
form = EditTaskForm(instance=task)
@@ -582,7 +582,7 @@
task = getTask(tid)
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in task.mentors.all() else False
+ is_reviewer = True if user in task.reviewers.all() else False
claimed_users = task.claimed_users.all()
assigned_users = task.assigned_users.all()
@@ -591,7 +591,7 @@
task_assigned_credits = task.credit_set.all()
- if is_mentor:
+ if is_reviewer:
if task.status in ["OP", "WR"]:
context = {
@@ -623,9 +623,9 @@
task = getTask(tid)
is_guest = True if not user.is_authenticated() else False
- is_mentor = True if user in task.mentors.all() else False
+ is_reviewer = True if user in task.reviewers.all() else False
- if is_mentor:
+ if is_reviewer:
context = {
'user':user,
@@ -650,7 +650,7 @@
def delete_task(request, tid):
""" mark the task status as DL.
- take a reason from the user and pass on to all the other mentors.
+ take a reason from the user and pass on to all the other reviewers.
"""
task_url = "/task/view/tid=%s"%tid
--- a/taskapp/views/user.py Wed Jan 05 18:52:48 2011 +0530
+++ b/taskapp/views/user.py Wed Jan 05 22:22:10 2011 +0530
@@ -17,8 +17,8 @@
from pytask.taskapp.utilities.user import get_user
about = {
- "addmentors": "about/addmentors.html",
- "mentor": "about/mentor.html",
+ "addreviewers": "about/addreviewers.html",
+ "reviewer": "about/reviewer.html",
"starthere": "about/starthere.html",
"task": "about/task.html",
"tasklife": "about/tasklife.html",
@@ -39,7 +39,7 @@
user = request.user
is_guest = False
- is_mentor = False
+ is_reviewer = False
can_create_task = False
task_list = []
@@ -52,18 +52,18 @@
else:
user = get_user(request.user)
user_profile = user.get_profile()
- is_mentor = True if user.task_mentors.all() else False
+ is_reviewer = True if user.task_reviewers.all() else False
can_create_task = False if user_profile.rights == u"CT" else True
context = {'user':user,
'is_guest':is_guest,
- 'is_mentor':is_mentor,
+ 'is_reviewer':is_reviewer,
'task_list':task_list,
'can_create_task':can_create_task,
}
- context["unpublished_tasks"] = user.task_mentors.filter(status="UP")
- context["mentored_tasks"] = user.task_mentors.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL")
+ context["unpublished_tasks"] = user.task_reviewers.filter(status="UP")
+ context["reviewered_tasks"] = user.task_reviewers.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL")
context["claimed_tasks"] = user.task_claimed_users.exclude(status="UP").exclude(status="CM").exclude(status="CD").exclude(status="DL")
context["working_tasks"] = user.task_assigned_users.filter(status="WR")
--- a/templates/about/addmentors.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/about/addmentors.html Wed Jan 05 22:22:10 2011 +0530
@@ -1,24 +1,24 @@
{% extends 'base.html' %}
{% block title %}
- PyTasks - About - Add Mentors
+ PyTasks - About - Add Reviewers
{% endblock %}
{% block content %}
- A Mentor <sup><a href="/about/mentor/" target="_blank">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. If a user has claimed the task or is working on the task, he cannot be requested to be a mentor.
- If the requested user accepts the request, he will also become the mentor of the task.<br /><br />
+ A Reviewer <sup><a href="/about/reviewer/" target="_blank">learn more</a></sup>
+ of the task can request other users to reviewer the task by clicking the link "Add more reviewers" available on the task page.
+ A request will be sent to the user. If a user has claimed the task or is working on the task, he cannot be requested to be a reviewer.
+ If the requested user accepts the request, he will also become the reviewer of the task.<br /><br />
- Since mentors can view unpublished tasks, mentors can be requested to view, edit and comment upon unpublished tasks.
+ Since reviewers can view unpublished tasks, reviewers can be requested to view, edit and comment upon unpublished tasks.
They can also add or remove subtasks/dependencies in unpublished state. Thereby, the creator of task can fix on the task.
Publishing/Deleting of an unpublished task is available only to the creator of the task.<br /><br />
- Users can also be requested to mentor an published task. If the user accepts the request, he also becomes the mentor of the task.
- In this case, the mentor is equivalent to the creator of the task. He can select/remove users; request pynts; close/complete the task.
+ Users can also be requested to reviewer an published task. If the user accepts the request, he also becomes the reviewer of the task.
+ In this case, the reviewer is equivalent to the creator of the task. He can select/remove users; request pynts; close/complete the task.
He will have complete control over the task.<br /><br />
- If a mentor requests a user to act as a mentor, he cannot make the same request to the same user again untill the previous one is
- rejected. However, another mentor in the task can request the same user to be a mentor, unless there is already a similar request to the user
- from this mentor also.
+ If a reviewer requests a user to act as a reviewer, he cannot make the same request to the same user again untill the previous one is
+ rejected. However, another reviewer in the task can request the same user to be a reviewer, unless there is already a similar request to the user
+ from this reviewer also.
{% endblock %}
--- a/templates/about/mentor.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/about/mentor.html Wed Jan 05 22:22:10 2011 +0530
@@ -1,20 +1,20 @@
{% extends 'base.html' %}
{% block title %}
- PyTasks - About - Mentor
+ PyTasks - About - Reviewer
{% endblock %}
{% block content %}
- Mentoring is a right specific to the task. The user who creates a task will become the mentor for the task. A Mentor can request
- other <sup><a href="/about/addmentors/" target="_blank">learn more</a></sup> users also to mentor the task.
- Mentor is a person who mentors the task. Mentor has all the rights over the task.<br />
+ Reviewering is a right specific to the task. The user who creates a task will become the reviewer for the task. A Reviewer can request
+ other <sup><a href="/about/addreviewers/" target="_blank">learn more</a></sup> users also to reviewer the task.
+ Reviewer is a person who reviewers the task. Reviewer has all the rights over the task.<br />
<ul>
- <li>Mentor can view the task even if it is unpublished.</li>
- <li>Mentor can edit the task when it is in unpublished state.</li>
- <li>Mentor can add/remove subtasks/dependencies to a task.</li>
- <li>Mentor decides whom to assign the task (choose from claimed users).</li>
- <li>Mentor also has the rights to remove a working user from a task.</li>
- <li>Mentor requests assigning of pynts to users/mentors for the task.</li>
- <li>Mentor has the rights to close a task or mark the task as complete.</li>
+ <li>Reviewer can view the task even if it is unpublished.</li>
+ <li>Reviewer can edit the task when it is in unpublished state.</li>
+ <li>Reviewer can add/remove subtasks/dependencies to a task.</li>
+ <li>Reviewer decides whom to assign the task (choose from claimed users).</li>
+ <li>Reviewer also has the rights to remove a working user from a task.</li>
+ <li>Reviewer requests assigning of pynts to users/reviewers for the task.</li>
+ <li>Reviewer has the rights to close a task or mark the task as complete.</li>
<li>Publishing/Deleting an unpublished task is a special right available only to the creator of the task.</li>
</ul>
<a href="/about/tasklife/" target="_blank">click here</a> to know the complete life cycle of a task.
--- a/templates/about/request.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/about/request.html Wed Jan 05 22:22:10 2011 +0530
@@ -10,13 +10,13 @@
Redundant requests are automatically removed.<br /><br />
The following can be redundant requests.
<ul>
- <li>You are requested to act as a mentor and the task is published or deleted or closed or completed</li>
+ <li>You are requested to act as a reviewer and the task is published or deleted or closed or completed</li>
<li>There are requests for assigning pynts to a user for a task and the task is closed or completed</li>
<li>There are requests for assigning pynts to a user and the user is removed from the working users of the task</li>
</ul>
These redundant requests when removed, a notification is sent to the requested user.
<ul>
- <li>You accept a request to act as mentor for a task and there are similar requests </li>
+ <li>You accept a request to act as reviewer for a task and there are similar requests </li>
<li>You accept a request to act as an admin and there are similar or less privileged requests ("Manager", "Developer")</li>
<li>You accept a request to act as a manager and there are similar or less privileged requests ("Developer")</li>
<li>You accept a request to act as a developer and there are similar requests</li>
--- a/templates/about/task.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/about/task.html Wed Jan 05 22:22:10 2011 +0530
@@ -5,11 +5,11 @@
{% block content %}
A task is an entity that people can work on and get pynts for their work. Every task has credits which are given to
users working on the task. A task is created by a privileged user and he becomes a
- mentor <sup><a href="/about/mentor/" target="_blank">learn more</a></sup> for the task.
+ reviewer <sup><a href="/about/reviewer/" target="_blank">learn more</a></sup> for the task.
The task if open, can be claimed by other users if they would like to work on the task.<br /><br />
The task can be claimed by submitting a proposal in the view claims page. The link to view claims page is available on the task page.
- By claiming the task, you are actually proposing that you would like to do the task and hence the mentor of the task will
+ By claiming the task, you are actually proposing that you would like to do the task and hence the reviewer of the task will
be given an option to choose you for the task. A user can only submit one claim per task. But if a user is assigned a task
and for some reason, is removed from the task later on, he can submit a second claim requesting to continue working on the task.<br /><br />
--- a/templates/about/tasklife.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/about/tasklife.html Wed Jan 05 22:22:10 2011 +0530
@@ -16,24 +16,24 @@
cannot be claimed by anyone and exists only to show all of its subtasks in one place.<br /><br />
If a task has dependencies, the task is locked untill all of its dependencies are completed. If all its dependencies are completed,
the task is open for claims and can be claimed by users.
- If a task has neither subtasks nor dependencies, it is open as well and users claim the task. Any of the mentors can select user(s)
+ If a task has neither subtasks nor dependencies, it is open as well and users claim the task. Any of the reviewers can select user(s)
from the claimed users to work on the task . Dependencies can be added/removed only untill a user is selected to work on the task. This is due
to the fact that user had a chance to claim when the task had no dependencies or all its dependencies were satisfied.
Also selecting a user to work on the task implies the task has all its dependencies satisfied.<br /><br />
- During the working stage of task, a mentor can request assign of pynts to users working on task or the mentors. The assign pynts link
- will be available to mentor on the task page. If there are no users working, the mentor can request assign of credits to himself
- or one of the other mentors, who ever has done work on the task. Even if there are no users working on task, if there is a
+ During the working stage of task, a reviewer can request assign of pynts to users working on task or the reviewers. The assign pynts link
+ will be available to reviewer on the task page. If there are no users working, the reviewer can request assign of credits to himself
+ or one of the other reviewers, who ever has done work on the task. Even if there are no users working on task, if there is a
request for assign of credits to the task implies that someone has worked on the task and hence dependencies cannot be
added after that.<br /><br />
The users can be selected to work or removed from working users at any point in time. If a user is removed, he can claim again
to request to continue working on the task. If a user is removed, all the pending requests for assigning pynts to user will be made invalid.
- After a considerable amount of work has been done and all the users and mentors have been assigned pynts properly, any mentor in the
+ After a considerable amount of work has been done and all the users and reviewers have been assigned pynts properly, any reviewer in the
task can mark the task as complete. The link is available on assign pynts page just in case
- the mentor wants to assign more pynts before marking the task as complete.<br/>
- If a mentor feels that the task is invalid or decides to delete the task, he will not be allowed to do it. Instead he can close the task
- by providing a closing message. The link to close task will be available to mentors on the task page itself.<br /><br/>
+ the reviewer wants to assign more pynts before marking the task as complete.<br/>
+ If a reviewer feels that the task is invalid or decides to delete the task, he will not be allowed to do it. Instead he can close the task
+ by providing a closing message. The link to close task will be available to reviewers on the task page itself.<br /><br/>
- Now all this can be done by any of the mentors and hence think twice before you request a user to mentor the task.
+ Now all this can be done by any of the reviewers and hence think twice before you request a user to reviewer the task.
{% endblock %}
--- a/templates/index.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/index.html Wed Jan 05 22:22:10 2011 +0530
@@ -73,9 +73,9 @@
{% endifnotequal %}<br />
{% endif %}
- {% if user.task_mentors.count %}
- <a href="/user/mentor/">Mentoring {{ user.task_mentors.count }}
- {% ifnotequal user.task_mentors.count 1 %}
+ {% if user.task_reviewers.count %}
+ <a href="/user/reviewer/">Reviewering {{ user.task_reviewers.count }}
+ {% ifnotequal user.task_reviewers.count 1 %}
tasks
{% else %}
task
@@ -94,9 +94,9 @@
<br />
{% endif %}
- {% if mentored_tasks %}
- Tasks you are mentoring:<ul>
- {% for a_task in mentored_tasks %}
+ {% if reviewered_tasks %}
+ Tasks you are reviewering:<ul>
+ {% for a_task in reviewered_tasks %}
<li><a href="/task/view/tid={{a_task.id}}">{{a_task.title}}</a></li>
{% endfor %}
</ul>
--- a/templates/task/addmentor.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/task/addmentor.html Wed Jan 05 22:22:10 2011 +0530
@@ -1,11 +1,11 @@
{% extends 'base.html' %}
{% block content %}
<a href="/task/view/tid={{task.id}}">Click here</a> to return to the task.<br /><br />
- Requesting a user to act as a mentor for the task sends him a request. If he accepts the request, he will also be the mentor for this task
+ Requesting a user to act as a reviewer for the task sends him a request. If he accepts the request, he will also be the reviewer for this task
{% ifequal task.status "UP" %}
- and can view/edit<sup><a href="/about/mentor/" target="_blank">learn more</a></sup> the task. But only the creator of a task can publish the task.
+ and can view/edit<sup><a href="/about/reviewer/" target="_blank">learn more</a></sup> the task. But only the creator of a task can publish the task.
{% else %}
- and will have all the rights<sup><a href="/about/mentor/" target="_blank">learn more</a></sup> you posses over the task.
+ and will have all the rights<sup><a href="/about/reviewer/" target="_blank">learn more</a></sup> you posses over the task.
{% endifequal %}
<br />
<br />
@@ -18,7 +18,7 @@
{% for req in pending_requests %}
<a href="/user/view/uid={{req.sent_by.id}}">{{req.sent_by.username}}</a> requested
{% for a_user in req.sent_to.all %}
- <a href="/user/view/uid={{a_user.id}}">{{a_user.username}}</a> to act as a mentor
+ <a href="/user/view/uid={{a_user.id}}">{{a_user.username}}</a> to act as a reviewer
{% endfor %}
on {{req.creation_date|date:"D d M Y"}} at {{req.creation_date|time:"H:i"}}<br />
{% endfor %}
--- a/templates/task/claim.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/task/claim.html Wed Jan 05 22:22:10 2011 +0530
@@ -22,7 +22,7 @@
{% endif %}
<a href="/task/view/tid={{task.id}}">Click here</a> to view the task.<br />
{% endif %}
- {% if task_claimed and is_mentor %}
+ {% if task_claimed and is_reviewer %}
<a href="/task/assign/tid={{task.id}}">Select a user to assign the work.</a><sup><a href="/about/assigntask/" target="_blank">learn more</a></sup>
{% endif %}
{% if user_can_claim %}
--- a/templates/task/publish.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/task/publish.html Wed Jan 05 22:22:10 2011 +0530
@@ -5,8 +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.
- <sup><a href="/about/addmentors/" target="_blank">learn more</a></sup><br /><br />
+ Only you will have reviewering rights on this task. But you can request other users also to reviewer the task.
+ <sup><a href="/about/addreviewers/" target="_blank">learn more</a></sup><br /><br />
This action cannot be undone.
<br />
Please confirm if you want to publish.
--- a/templates/task/view.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/task/view.html Wed Jan 05 22:22:10 2011 +0530
@@ -27,19 +27,19 @@
{% ifequal task.status "UP" %}
Task can be viewed by:
{% else %}
- Mentors:
+ Reviewers:
{% endifequal %}
- {% for mentor in mentors %}
- <a href="/user/view/uid={{mentor.id}}">{{mentor.username}}</a>
+ {% for reviewer in reviewers %}
+ <a href="/user/view/uid={{reviewer.id}}">{{reviewer.username}}</a>
{% endfor %}
- {% if can_mod_mentors %}
- <a href="/task/addmentor/tid={{task.id}}">
+ {% if can_mod_reviewers %}
+ <a href="/task/addreviewer/tid={{task.id}}">
{% ifequal task.status "UP" %}
Request others to view/edit the task
{% else %}
- Add another Mentor to this task
+ Add another Reviewer to this task
{% endifequal %}</a>
{% endif %}
<br />
@@ -117,7 +117,7 @@
{% for user in assigned_users %}
<a href="/user/view/uid={{user.id}}">{{user.username}}</a>
{% endfor %}
- {% if is_mentor %}
+ {% if is_reviewer %}
<a href="/task/remuser/tid={{task.id}}">Remove an existing user</a>
{% endif %}
<br />
@@ -129,7 +129,7 @@
{% if task_claimable %}
<a href="/task/claim/tid={{task.id}}">
- {% if is_mentor %}
+ {% if is_reviewer %}
View claims
{% else %}
Claim the task
@@ -159,7 +159,7 @@
<input type="submit" value="Submit">
</form>
{% else %}
- {% if is_mentor %}
+ {% if is_reviewer %}
Add comment:<br />
<form action="" method="post">
<!-- we might even want to use forms here -->
--- a/templates/user/browse_requests.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/user/browse_requests.html Wed Jan 05 22:22:10 2011 +0530
@@ -13,7 +13,7 @@
{% endifequal %}
{% ifequal req.role "MT" %}
- Request to mentor the task "{{req.task.title|slice:":20"}}"
+ Request to reviewer the task "{{req.task.title|slice:":20"}}"
{% endifequal %}
{% ifequal req.role "DV" %}
--- a/templates/user/view_request.html Wed Jan 05 18:52:48 2011 +0530
+++ b/templates/user/view_request.html Wed Jan 05 22:22:10 2011 +0530
@@ -28,7 +28,7 @@
{% else %}
{% ifequal "MT" req.role %}
- <a href="/user/view/uid={{req.sent_by.id}}">{{req.sent_by.username}}</a> requested you to act as a mentor for the task
+ <a href="/user/view/uid={{req.sent_by.id}}">{{req.sent_by.username}}</a> requested you to act as a reviewer for the task
<a href="/task/view/tid={{req.task.id}}">{{req.task.title}}</a><br />
{% else %}
You have been requested to act as
--- a/urls.py Wed Jan 05 18:52:48 2011 +0530
+++ b/urls.py Wed Jan 05 22:22:10 2011 +0530
@@ -27,7 +27,7 @@
(r'^task/view/tid=(\w+)$', taskViews.view_task),
(r'^task/create/$', taskViews.create_task),
(r'^task/publish/tid=(\w+)/$', taskViews.publish_task),
- (r'^task/addmentor/tid=(\w+)$', taskViews.add_mentor),
+ (r'^task/addreviewer/tid=(\w+)$', taskViews.add_reviewer),
(r'^task/edit/tid=(\w+)$', taskViews.edit_task),
(r'^task/claim/tid=(\w+)$', taskViews.claim_task),
(r'^task/assign/tid=(\w+)$', taskViews.assign_task),
@@ -62,3 +62,67 @@
(r'^textbook/$', taskViews.show_textbooks),
)
+from django.conf.urls.defaults import *
+
+# Uncomment the next two lines to enable the admin:
+from django.contrib import admin
+admin.autodiscover()
+
+from pytask.taskapp.views import user as userViews
+from pytask.taskapp.views import task as taskViews
+
+from pytask.taskapp.forms.user import RegistrationFormCustom
+from registration.views import register
+
+urlpatterns = patterns('',
+ # Example:
+ # (r'^pytask/', include('pytask.foo.urls')),
+
+ # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
+ # to INSTALLED_APPS to enable admin documentation:
+ # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+
+ (r'^images/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': './images/'}),
+
+ (r'^$', userViews.homepage),
+
+ (r'^task/browse/$', taskViews.browse_tasks),
+ (r'^task/view/tid=(\w+)$', taskViews.view_task),
+ (r'^task/create/$', taskViews.create_task),
+ (r'^task/publish/tid=(\w+)/$', taskViews.publish_task),
+ (r'^task/addreviewer/tid=(\w+)$', taskViews.add_reviewer),
+ (r'^task/edit/tid=(\w+)$', taskViews.edit_task),
+ (r'^task/claim/tid=(\w+)$', taskViews.claim_task),
+ (r'^task/assign/tid=(\w+)$', taskViews.assign_task),
+ (r'^task/remuser/tid=(\w+)$', taskViews.rem_user),
+ (r'^task/addtask/tid=(\w+)$', taskViews.add_tasks),
+ (r'^task/remtask/tid=(\w+)$', taskViews.remove_task),
+ (r'^task/assigncredits/tid=(\w+)$', taskViews.assign_credits),
+ (r'^task/complete/tid=(\w+)$', taskViews.complete_task),
+ (r'^task/close/tid=(\w+)$', taskViews.close_task),
+ (r'^task/delete/tid=(\w+)$', taskViews.delete_task),
+
+ (r'^admin/', include(admin.site.urls)),
+
+ url(r'^accounts/register/$',register,{'form_class' : RegistrationFormCustom},name='registration_register'),
+ (r'^accounts/', include('registration.urls')),
+ (r'^accounts/profile/$', userViews.view_my_profile),
+
+ (r'^user/view/uid=(\d+)$', userViews.view_my_profile),
+ (r'^user/edit/?$', userViews.edit_my_profile),
+
+ (r'^user/requests/$', userViews.browse_requests),
+ (r'^user/requests/rid=(\d+)/$', userViews.view_request),
+ (r'^user/requests/rid=(\d+)/(\w+)/$', userViews.process_request),
+
+ (r'^user/notifications/$', userViews.browse_notifications),
+ (r'^user/notifications/nid=(\d+)/$', userViews.view_notification),
+ (r'^user/notifications/nid=(\d+)/(\w+)/$', userViews.edit_notification),
+ (r'^user/make/(\w+)/$', userViews.change_rights),
+
+ (r'^about/(\w+)/$', userViews.learn_more),
+
+ (r'^textbook/$', taskViews.show_textbooks),
+
+)