diff --git a/.DS_Store b/.DS_Store index 03287122..18f18875 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/osinaweb/.DS_Store b/osinaweb/.DS_Store index b23e9505..5b4a4802 100644 Binary files a/osinaweb/.DS_Store and b/osinaweb/.DS_Store differ diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 961db373..efe4c37f 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/node_modules/.DS_Store b/osinaweb/node_modules/.DS_Store new file mode 100644 index 00000000..461c75d6 Binary files /dev/null and b/osinaweb/node_modules/.DS_Store differ diff --git a/osinaweb/osinacore/.DS_Store b/osinaweb/osinacore/.DS_Store index 2068222b..4f60abb2 100644 Binary files a/osinaweb/osinacore/.DS_Store and b/osinaweb/osinacore/.DS_Store differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index 2a5ddbe4..623efe6d 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index 54f7168e..02b2eaa3 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -1008,11 +1008,29 @@ def mark_point_working_on(request, point_id, task_id): task_id_str = task.task_id - # Redirect to the task detailed page showpoints_url = reverse('showpoints', args=[task_id_str]) return HttpResponseRedirect(showpoints_url) +@login_required +def mark_point_working_on_task_page(request, point_id, task_id): + task = get_object_or_404(Task, id=task_id) + point = get_object_or_404(Point, id=point_id) + point.status = 'Working On' + current_datetime = datetime.now() + point.date_workingon = current_datetime.date() + point.time_workingon = current_datetime.strftime("%I:%M %p") + + point.save() + + # Create a new Status object + status_text = f'Working On: {point.text}' + status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile) + status.save() + + return redirect('detailed-task', task_id=task.task_id) + + @login_required def mark_point_completed(request, point_id, task_id): task = get_object_or_404(Task, id=task_id) @@ -1033,12 +1051,37 @@ def mark_point_completed(request, point_id, task_id): task_id_str = task.task_id - # Redirect to the task detailed page showpoints_url = reverse('showpoints', args=[task_id_str]) return HttpResponseRedirect(showpoints_url) +@login_required +def mark_point_completed_task_page(request, point_id, task_id): + task = get_object_or_404(Task, id=task_id) + point = get_object_or_404(Point, id=point_id) + point.status = 'Completed' + current_datetime = datetime.now() + point.date_workingon = current_datetime.date() + point.time_workingon = current_datetime.strftime("%I:%M %p") + + point.save() + + # Create a new Status object + status_text = f'{point.text} - Completed' + status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile) + status.save() + + + + task_id_str = task.task_id + + return redirect('detailed-task', task_id=task.task_id) + + + + + @login_required def save_dailyreport(request): if request.method == 'POST': diff --git a/osinaweb/osinaweb/.DS_Store b/osinaweb/osinaweb/.DS_Store index e3aa90fe..2719c49d 100644 Binary files a/osinaweb/osinaweb/.DS_Store and b/osinaweb/osinaweb/.DS_Store differ diff --git a/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc b/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc index 903fb0bf..78e58e37 100644 Binary files a/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc and b/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/osinaweb/urls.py b/osinaweb/osinaweb/urls.py index 914ab53e..91c542e7 100644 --- a/osinaweb/osinaweb/urls.py +++ b/osinaweb/osinaweb/urls.py @@ -107,7 +107,9 @@ urlpatterns = [ path('edittag/', views.edit_tag, name='edittag'), path('editstaffposition/', views.edit_staff_position, name='editstaffposition'), path('mark_point_working_on///', views.mark_point_working_on, name='mark_point_working_on'), + path('mark_point_working_on_task_page///', views.mark_point_working_on_task_page, name='mark_point_working_on_task_page'), path('mark_point_completed///', views.mark_point_completed, name='mark_point_completed'), + path('mark_point_completed_task_page///', views.mark_point_completed_task_page, name='mark_point_completed_task_page'), ] diff --git a/osinaweb/static/.DS_Store b/osinaweb/static/.DS_Store index e3f3bdaf..3b60f32a 100644 Binary files a/osinaweb/static/.DS_Store and b/osinaweb/static/.DS_Store differ diff --git a/osinaweb/templates/.DS_Store b/osinaweb/templates/.DS_Store index 3c58a480..12f47f4d 100644 Binary files a/osinaweb/templates/.DS_Store and b/osinaweb/templates/.DS_Store differ diff --git a/osinaweb/templates/details_pages/task-details.html b/osinaweb/templates/details_pages/task-details.html index 9d7d6f6b..9b534885 100644 --- a/osinaweb/templates/details_pages/task-details.html +++ b/osinaweb/templates/details_pages/task-details.html @@ -137,21 +137,24 @@

Points:

+ + {% for point in points %} + {% if point.status == 'Not Completed' %}

{{point.text}}

-
+ {% csrf_token %}
-
+ {% csrf_token %} @@ -182,7 +185,7 @@ - + {% csrf_token %} @@ -191,9 +194,10 @@
{% endif %} - + {% endfor %} +