diff options
-rw-r--r-- | taskapp/events/task.py | 12 | ||||
-rw-r--r-- | taskapp/forms/task.py | 6 | ||||
-rw-r--r-- | taskapp/forms/user.py | 2 | ||||
-rw-r--r-- | taskapp/management/commands/seed_db.py | 4 | ||||
-rw-r--r-- | taskapp/models.py | 6 | ||||
-rw-r--r-- | taskapp/utilities/notification.py | 12 | ||||
-rw-r--r-- | taskapp/views/task.py | 54 | ||||
-rw-r--r-- | templates/about/admin.html | 2 | ||||
-rw-r--r-- | templates/about/task.html | 2 | ||||
-rw-r--r-- | templates/about/tasklife.html | 4 | ||||
-rw-r--r-- | templates/task/assignpynts.html (renamed from templates/task/assigncredits.html) | 8 | ||||
-rw-r--r-- | templates/task/close.html | 4 | ||||
-rw-r--r-- | templates/task/complete.html | 10 | ||||
-rw-r--r-- | templates/task/view.html | 4 | ||||
-rw-r--r-- | templates/user/my_profile.html | 4 | ||||
-rw-r--r-- | urls.py | 4 |
16 files changed, 69 insertions, 69 deletions
diff --git a/taskapp/events/task.py b/taskapp/events/task.py index ef68082..77ad361 100644 --- a/taskapp/events/task.py +++ b/taskapp/events/task.py @@ -106,8 +106,8 @@ def addReviewer(task,reviewer): task.save() return task -def createTask(title,desc,created_by,credits): - """ creates a bare minimum task with title, description and credits. +def createTask(title,desc,created_by,pynts): + """ creates a bare minimum task with title, description and pynts. the creator of the task will be assigned as a reviewer for the task. """ @@ -128,7 +128,7 @@ def createTask(title,desc,created_by,credits): task.id = id task.desc = desc task.created_by = created_by - task.credits = credits + task.pynts = pynts task.creation_datetime = datetime.now() task.published_datetime = datetime.now() task.save() @@ -165,7 +165,7 @@ def assignTask(task, added_user, assigned_by): create_notification("AU", added_user, assigned_by, task=task) -def updateTask(task, title=None, desc=None, credits=None, tags_field=None): +def updateTask(task, title=None, desc=None, pynts=None, tags_field=None): """ update the property accordingly. while updating title, check for uniqueness of title. return None if any error. @@ -178,7 +178,7 @@ def updateTask(task, title=None, desc=None, credits=None, tags_field=None): except Task.IntegrityError: return None if desc:task.desc = desc - if credits:task.credits = credits + if pynts:task.pynts = pynts if tags_field:task.tags_field = tags_field task.save() return task @@ -204,7 +204,7 @@ def removeUser(main_task, rem_user, removed_by, reason=None): create_notification("RU", rem_user, removed_by, task=main_task, remarks=reason) ## TODO : create notification to the victim -def assignCredits(task, given_by, given_to, points): +def assignPynts(task, given_by, given_to, points): """ make a proper request object. """ diff --git a/taskapp/forms/task.py b/taskapp/forms/task.py index 6719f30..f76bfd5 100644 --- a/taskapp/forms/task.py +++ b/taskapp/forms/task.py @@ -4,7 +4,7 @@ from pytask.taskapp.models import Task class TaskCreateForm(forms.ModelForm): class Meta: model = Task - fields = ['title', 'desc', 'tags_field', 'credits'] + fields = ['title', 'desc', 'tags_field', 'pynts'] #publish = forms.BooleanField(required=False) def clean_title(self): @@ -25,7 +25,7 @@ class TaskCreateForm(forms.ModelForm): class EditTaskForm(forms.ModelForm): class Meta: model = Task - fields = ['title', 'desc', 'tags_field', 'credits'] + fields = ['title', 'desc', 'tags_field', 'pynts'] def clean_desc(self): data = self.cleaned_data['desc'].strip() @@ -85,7 +85,7 @@ def AddTaskForm(task_choices, is_plain=False): task = forms.ChoiceField(choices=task_choices) return myForm() -def AssignCreditForm(choices, instance=None): +def AssignPyntForm(choices, instance=None): class myForm(forms.Form): user = forms.ChoiceField(choices=choices, required=True) diff --git a/taskapp/forms/user.py b/taskapp/forms/user.py index 5a8acaa..4cde155 100644 --- a/taskapp/forms/user.py +++ b/taskapp/forms/user.py @@ -16,7 +16,7 @@ class UserProfileEditForm(forms.ModelForm): class Meta: model = Profile - exclude = ('user','rights','dob','credits') + exclude = ('user','rights','dob','pynts') def clean_photo(self): uploaded_photo = self.data.get('photo', None) diff --git a/taskapp/management/commands/seed_db.py b/taskapp/management/commands/seed_db.py index c13abda..97263d5 100644 --- a/taskapp/management/commands/seed_db.py +++ b/taskapp/management/commands/seed_db.py @@ -43,9 +43,9 @@ def seed_db(): title = "Task "+str(i) desc = "I am "+title created_by = defaultReviewer - credits = 20 + pynts = 20 - task = taskEvents.createTask(title,desc,created_by,credits) + task = taskEvents.createTask(title,desc,created_by,pynts) if task: taskEvents.addReviewer(task, defaultReviewer) if i%2==0:taskEvents.publishTask(task) diff --git a/taskapp/models.py b/taskapp/models.py index 8df5dc8..173a5df 100644 --- a/taskapp/models.py +++ b/taskapp/models.py @@ -30,7 +30,7 @@ NOTIFY_CHOICES = ( ("DV", "Developer"), ("MG", "Manager"), ("AD", "Admin"), - ("PY", "Assign credits"), + ("PY", "Assign pynts"), ("CM", "Task completed"), ("CD", "Task closed"), ("DL", "Task deleted"), @@ -70,7 +70,7 @@ class Profile(models.Model): dob = models.DateField(verbose_name = u"Date of Birth", help_text = "YYYY-MM-DD") gender = models.CharField(max_length = 1, choices = GENDER_CHOICES) rights = models.CharField(max_length = 2, choices = RIGHTS_CHOICES, default = u"CT") - credits = models.PositiveSmallIntegerField(default = 0) + pynts = models.PositiveSmallIntegerField(default = 0) aboutme = models.TextField(blank = True) foss_comm = TagField(verbose_name="FOSS Communities") @@ -94,7 +94,7 @@ class Task(models.Model): status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP") tags_field = TagField(verbose_name = u"Tags", help_text = u"Give comma seperated tags") - credits = models.PositiveSmallIntegerField(help_text = u"No.of credits a user gets on completing the task") + pynts = models.PositiveSmallIntegerField(help_text = u"No.of pynts a user gets on completing the task") progress = models.PositiveSmallIntegerField(default = 0) reviewers = models.ManyToManyField(User, related_name = "%(class)s_reviewers") diff --git a/taskapp/utilities/notification.py b/taskapp/utilities/notification.py index da6e6d0..4d67c11 100644 --- a/taskapp/utilities/notification.py +++ b/taskapp/utilities/notification.py @@ -13,7 +13,7 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re reply: A boolean task: a task if applicable requested_by: a user makes the request - A reviewer who assigns credits in case of pynts + A reviewer who assigns pynts in case of pynts A reviewer who requests to act as a reviewer remarks: any remarks for rejecting receiving_user: user receiving pynts @@ -32,18 +32,18 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re notification.pynts = pynts 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") + pynts_url = '<a href="/task/assignpynts/tid=%s">%s</a>'%(task.id, "click here") 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.sub = "Approved request for assign of pynts 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 />"""%(reviewer_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, pynts_url) else: - notification.sub = "Rejected request for assign of credits for %s"%task.title[:20] + notification.sub = "Rejected request for assign of pynts 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 /> """%(reviewer_url, pynts, user_url, task_url, admin_url) if remarks: notification.remarks = remarks @@ -177,7 +177,7 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re 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 reviewers for your work.<br />" + notification.message += "You can now start working on the task and will be pynted by the reviewers for your work.<br />" notification.message += " Here is a list of reviewers for the task and their email addresses.<br /> <ul>" for a_reviewer in task.reviewers.all(): diff --git a/taskapp/views/task.py b/taskapp/views/task.py index 2507b73..396ba5d 100644 --- a/taskapp/views/task.py +++ b/taskapp/views/task.py @@ -5,8 +5,8 @@ from django.shortcuts import render_to_response, redirect from pytask.taskapp.models import User, Task, Comment, Request, Notification from pytask.taskapp.utilities.task import getTask -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.forms.task import TaskCreateForm, AddReviewerForm, AddTaskForm, ChoiceForm, AssignPyntForm, RemoveUserForm, EditTaskForm, ClaimTaskForm +from pytask.taskapp.events.task import createTask, reqReviewer, publishTask, addSubTask, addDep, addClaim, assignTask, updateTask, removeTask, removeUser, assignPynts, completeTask, closeTask, addReviewer, deleteTask from pytask.taskapp.views.user import show_msg from pytask.taskapp.utilities.user import get_user @@ -113,7 +113,7 @@ def view_task(request, tid): 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_reviewer else False + context['can_assign_pynts'] = 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": @@ -156,9 +156,9 @@ def create_task(request): data = form.cleaned_data title = data['title'] desc = data['desc'] - credits = data['credits'] + pynts = data['pynts'] #publish = data['publish'] # just in case if we have to show the option - task = createTask(title,desc,user,credits) + task = createTask(title,desc,user,pynts) addReviewer(task, user) updateTask(task,tags_field=data['tags_field']) @@ -486,11 +486,11 @@ def assign_task(request, tid): else: 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 reviewer and credits can be assigned. - Then display all the approved credits. - Then see if reviewer can assign credits to users also or only reviewers. - Then put up a form for reviewer to assign credits accordingly. +def assign_pynts(request, tid): + """ Check if the user is a reviewer and pynts can be assigned. + Then display all the approved pynts. + Then see if reviewer can assign pynts to users also or only reviewers. + Then put up a form for reviewer to assign pynts accordingly. """ task_url = "/task/view/tid=%s"%tid @@ -498,8 +498,8 @@ def assign_credits(request, tid): user = get_user(request.user) if request.user.is_authenticated() else request.user 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 reviewer + ## the moment we see that user had requested pynts, it means he had worked and hence we change the status to WR + ## we have to discuss on this since, pynts may also be given to reviewer task.status = "WR" task.save() @@ -511,35 +511,35 @@ def assign_credits(request, tid): 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() - credit_requests = task.request_task.filter(role="PY",is_valid=True).order_by('creation_date').reverse() - form = AssignCreditForm(choices) + prev_pynts = task.request_task.filter(role="PY",is_valid=True,is_replied=True,reply=True).count() + pynt_requests = task.request_task.filter(role="PY",is_valid=True).order_by('creation_date').reverse() + form = AssignPyntForm(choices) context = { 'user':user, 'task':task, - 'prev_credits':prev_credits, - 'credit_requests':credit_requests, + 'prev_pynts':prev_pynts, + 'pynt_requests':pynt_requests, 'form':form, } if request.method == "POST": data = request.POST - form = AssignCreditForm(choices, data) + form = AssignPyntForm(choices, data) if form.is_valid(): data = form.cleaned_data uid = data['user'] points = data['pynts'] given_to = User.objects.get(id=uid) - assignCredits(task=task, given_by=user, given_to=given_to, points=points) - return redirect('/task/assigncredits/tid=%s'%task.id) + assignPynts(task=task, given_by=user, given_to=given_to, points=points) + return redirect('/task/assignpynts/tid=%s'%task.id) else: context['form'] = form - return render_to_response('task/assigncredits.html', context) + return render_to_response('task/assignpynts.html', context) else: - return render_to_response('task/assigncredits.html', context) + return render_to_response('task/assignpynts.html', context) else: - return show_msg(user, "Credits cannot be assigned at this stage", task_url, "view the task") + return show_msg(user, "Pynts cannot be assigned at this stage", task_url, "view the task") else: return show_msg(user, "You are not authorised to perform this action", task_url, "view the task") @@ -587,8 +587,8 @@ def complete_task(request, tid): claimed_users = task.claimed_users.all() assigned_users = task.assigned_users.all() - assign_credits_url = '/task/assigncredits/tid=%s'%task.id - task_assigned_credits = task.credit_set.all() + assign_pynts_url = '/task/assignpynts/tid=%s'%task.id + task_assigned_pynts = task.pynt_set.all() if is_reviewer: @@ -599,14 +599,14 @@ def complete_task(request, tid): 'task':task, } - if task_assigned_credits: + if task_assigned_pynts: if request.method=="POST": completeTask(task, user) return redirect(task_url) else: return render_to_response('task/complete.html', context) else: - return show_msg(user, "Nobody has been credited for doing this task.", assign_credits_url, "assign credits") + return show_msg(user, "Nobody has been pynted for doing this task.", assign_pynts_url, "assign pynts") else: return show_msg(user, "The task cannot be marked as completed at this stage", task_url, "view the task") else: diff --git a/templates/about/admin.html b/templates/about/admin.html index e623b8f..e618d3e 100644 --- a/templates/about/admin.html +++ b/templates/about/admin.html @@ -3,6 +3,6 @@ PyTasks - About - Admin {% endblock %} {% block content %} - Admin is the user who has to approve assign of credits to any user for his/her work on the task.<br /> + Admin is the user who has to approve assign of pynts to any user for his/her work on the task.<br /> An Admin also has the right to request normal users to become admins or managers or developers. {% endblock %} diff --git a/templates/about/task.html b/templates/about/task.html index b09f1d0..b744b56 100644 --- a/templates/about/task.html +++ b/templates/about/task.html @@ -3,7 +3,7 @@ PyTasks - About - Task {% endblock %} {% 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 + A task is an entity that people can work on and get pynts for their work. Every task has pynts which are given to users working on the task. A task is created by a privileged user and he becomes a 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 /> diff --git a/templates/about/tasklife.html b/templates/about/tasklife.html index 144b3cb..448b9d9 100644 --- a/templates/about/tasklife.html +++ b/templates/about/tasklife.html @@ -22,9 +22,9 @@ 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 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 + will be available to reviewer on the task page. If there are no users working, the reviewer can request assign of pynts 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 + request for assign of pynts 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 diff --git a/templates/task/assigncredits.html b/templates/task/assignpynts.html index eff23bf..cbd0f84 100644 --- a/templates/task/assigncredits.html +++ b/templates/task/assignpynts.html @@ -9,13 +9,13 @@ {{form.as_p}} <input type="submit" value="Submit"> </form> - {% if prev_credits %} + {% if prev_pynts %} <a href="/task/complete/tid={{task.id}}">Mark task as complete.</a> <hr /> {% endif %} - {% if credit_requests %} - <br/>Previous credits:<br /> - {% for req in credit_requests %} + {% if pynt_requests %} + <br/>Previous pynts:<br /> + {% for req in pynt_requests %} <hr /> <a href="/user/view/uid={{req.sent_by.id}}">{{req.sent_by.username}}</a> requested assigning of {{req.pynts}} pynts to <a href="/user/view/uid={{req.receiving_user.id}}">{{req.receiving_user.username}}</a> diff --git a/templates/task/close.html b/templates/task/close.html index f848edc..ea4cef0 100644 --- a/templates/task/close.html +++ b/templates/task/close.html @@ -5,8 +5,8 @@ {% block content %} <b>Disclaimer:</b><br /> If a task is closed, it implies the task is no more a valid task. The task cannot be edited or added subtasks/dependencies. - Please <a href="/task/assigncredits/tid={{task.id}}">click here</a> to return to assign credits page if you want to request assign of credits. - You cannot request assign of credits and all the pending requests on this task will be made invalid when a task is closed.<br /><br /> + Please <a href="/task/assignpynts/tid={{task.id}}">click here</a> to return to assign pynts page if you want to request assign of pynts. + You cannot request assign of pynts and all the pending requests on this task will be made invalid when a task is closed.<br /><br /> The only difference between marking a task as closed and completed is that the tasks depending on completed tasks will be free to be claimed and worked on. This action cannot be undone. If you have double checked every thing, please provide a reason and close the task.<br /> diff --git a/templates/task/complete.html b/templates/task/complete.html index b6d8747..a8aedd3 100644 --- a/templates/task/complete.html +++ b/templates/task/complete.html @@ -5,13 +5,13 @@ {% block content %} <b>Disclaimer:</b><br /> Marking a task as complete implies the task has been completed successfully. It implies that all the required files - are available as attatchments in comments and all the users worked on this task were credited accordingly.<br /><br /> + are available as attatchments in comments and all the users worked on this task were pynted accordingly.<br /><br /> This action sets the task as completed and frees all the tasks depending on this task. Henceforth, the task <strong>can not</strong> be commented upon or edited by anyone.<br /><br /> - If there are pending requests for assigning credits, they will be deleted and admins will not be able to approve those requests. - Hence you cannot assign credits to anyone for this task anymore. You must wait for the requests to be approved by any of the admins. - If you would like to request for assigning more credits, return to assign credits page by clicking - <a href="/task/assigncredits/tid={{task.id}}">here</a>.<br /><br /> + If there are pending requests for assigning pynts, they will be deleted and admins will not be able to approve those requests. + Hence you cannot assign pynts to anyone for this task anymore. You must wait for the requests to be approved by any of the admins. + If you would like to request for assigning more pynts, return to assign pynts page by clicking + <a href="/task/assignpynts/tid={{task.id}}">here</a>.<br /><br /> If you have double checked everything, confirm this action by clicking the button below. <form action="" method="post"> <input value="Mark as Complete" type="submit"> diff --git a/templates/task/view.html b/templates/task/view.html index 61f2741..a671748 100644 --- a/templates/task/view.html +++ b/templates/task/view.html @@ -123,8 +123,8 @@ <br /> {% endif %} - {% if can_assign_credits %} - <a href="/task/assigncredits/tid={{task.id}}">View/Assign credits</a> + {% if can_assign_pynts %} + <a href="/task/assignpynts/tid={{task.id}}">View/Assign pynts</a> {% endif %} {% if task_claimable %} diff --git a/templates/user/my_profile.html b/templates/user/my_profile.html index cb3db1f..4f7e389 100644 --- a/templates/user/my_profile.html +++ b/templates/user/my_profile.html @@ -30,8 +30,8 @@ {% if profile.dob %} <br><h4>Date of Birth</h4><hr>{{ profile.dob }} {% endif %} - {% if profile.credits %} - <br><h4>Credits</h4><hr>{{ profile.credits }} + {% if profile.pynts %} + <br><h4>Pynts</h4><hr>{{ profile.pynts }} {% endif %} {% if profile.foss_comm %} <br><h4>Foss Community</h4><hr>{{ profile.foss_comm }} @@ -34,7 +34,7 @@ urlpatterns = patterns('', (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/assignpynts/tid=(\w+)$', taskViews.assign_pynts), (r'^task/complete/tid=(\w+)$', taskViews.complete_task), (r'^task/close/tid=(\w+)$', taskViews.close_task), (r'^task/delete/tid=(\w+)$', taskViews.delete_task), @@ -98,7 +98,7 @@ urlpatterns = patterns('', (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/assignpynts/tid=(\w+)$', taskViews.assign_pynts), (r'^task/complete/tid=(\w+)$', taskViews.complete_task), (r'^task/close/tid=(\w+)$', taskViews.close_task), (r'^task/delete/tid=(\w+)$', taskViews.delete_task), |