main
emile 2 years ago
parent 5e13f45c1e
commit 97788c1935

BIN
.DS_Store vendored

Binary file not shown.

BIN
osinaweb/.DS_Store vendored

Binary file not shown.

Binary file not shown.

BIN
osinaweb/node_modules/.DS_Store generated vendored

Binary file not shown.

Binary file not shown.

@ -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':

Binary file not shown.

@ -107,7 +107,9 @@ urlpatterns = [
path('edittag/<int:tag_id>', views.edit_tag, name='edittag'),
path('editstaffposition/', views.edit_staff_position, name='editstaffposition'),
path('mark_point_working_on/<int:point_id>/<str:task_id>/', views.mark_point_working_on, name='mark_point_working_on'),
path('mark_point_working_on_task_page/<int:point_id>/<str:task_id>/', views.mark_point_working_on_task_page, name='mark_point_working_on_task_page'),
path('mark_point_completed/<int:point_id>/<str:task_id>/', views.mark_point_completed, name='mark_point_completed'),
path('mark_point_completed_task_page/<int:point_id>/<str:task_id>/', views.mark_point_completed_task_page, name='mark_point_completed_task_page'),
]

Binary file not shown.

Binary file not shown.

@ -137,21 +137,24 @@
<div>
<p class="text-gray-500 text-xl">Points:</p>
<div class="w-full px-4">
{% for point in points %}
{% if point.status == 'Not Completed' %}
<div class="w-full flex justify-between items-center py-2 border-b border-gray-200">
<div class="w-[380px]">
<p class="text-slate-800">{{point.text}}</p>
</div>
<div class="flex justify-end items-center gap-2">
<form method="post" action="{% url 'mark_point_working_on' point.id %}">
<form method="post" action="{% url 'mark_point_working_on_task_page' point.id task.id %}">
{% csrf_token %}
<button type="submit"
class="w-[120px] px-2 py-1 bg-transparent border border-yellow-500 rounded-md text-yellow-500 hover:bg-yellow-500 hover:text-white">Working
On</button>
</form>
<form method="post" action="{% url 'mark_point_completed' point.id %}">
<form method="post" action="{% url 'mark_point_completed_task_page' point.id task.id %}">
{% csrf_token %}
<button type="submit"
class="w-[120px] px-2 py-1 bg-transparent border border-blue-500 rounded-md text-blue-500 hover:bg-blue-500 hover:text-white">Complete</button>
@ -182,7 +185,7 @@
<button
class="w-[120px] px-2 py-1 border border-yellow-500 rounded-md bg-yellow-500 text-white opacity-40"
disabled>Working On</button>
<form method="post" action="{% url 'mark_point_completed' point.id %}">
<form method="post" action="{% url 'mark_point_completed_task_page' point.id task.id %}">
{% csrf_token %}
<button type="submit"
class="w-[120px] px-2 py-1 bg-transparent border border-blue-500 rounded-md text-blue-500 hover:bg-blue-500 hover:text-white">Complete</button>
@ -191,9 +194,10 @@
</div>
</div>
{% endif %}
{% endfor %}
</div>
<div class="w-full px-4">

Loading…
Cancel
Save