emile 4 months ago
parent e886b874a7
commit 4f6f5ac3e6

Binary file not shown.

@ -541,7 +541,7 @@ def add_daily_report(request):
dailyreport.save()
status_text = f'Added my daily report.'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Daily Report', type_id=dailyreport.id)
status.save()
return redirect('dailyreports')

@ -477,11 +477,11 @@ def mark_point_working_on_task_page(request, point_id, task_id):
if PointActivity.objects.filter(point=point).count() == 1:
status_text = f'Started Working On: {point.text}'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Task', type_id=point.task)
status.save()
else:
status_text = f'Resumed Working On: {point.text}'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Task', type_id=point.task)
status.save()
@ -505,7 +505,7 @@ def mark_point_paused(request, point_id, task_id):
last_activity.save()
status_text = f'{point.text} - Paused'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Task', type_id=point.task)
status.save()
@ -531,7 +531,7 @@ def mark_point_paused_task_page(request, point_id, task_id):
last_activity.save()
status_text = f'{point.text} - Paused'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Task', type_id=point.task)
status.save()
@ -569,7 +569,7 @@ def mark_point_completed(request, point_id, task_id):
if formatted_time:
status_text += f' in {formatted_time}'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Task', type_id=point.task)
status.save()
task_id_str = task.task_id
@ -610,7 +610,7 @@ def mark_point_completed_task_page(request, point_id, task_id):
if formatted_time:
status_text += f' in {formatted_time}'
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Task', type_id=point.task)
status.save()
return redirect('detailed-task', task_id=task.task_id)

@ -0,0 +1,17 @@
# Generated by Django 4.2.5 on 2024-12-26 14:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osinacore', '0108_status_type_status_type_id'),
]
operations = [
migrations.RemoveField(
model_name='status',
name='task',
),
]

@ -431,7 +431,6 @@ class Status(models.Model):
staff = models.ForeignKey(StaffProfile, on_delete=models.CASCADE, null=True,blank=True, related_name='staff')
type = models.CharField(max_length=200, choices=TYPE_CHOICES, null=True, blank=True)
type_id = models.IntegerField(null=True, blank=True)
task = models.ForeignKey(Task, on_delete=models.SET_NULL ,null=True, blank=True, related_name='reference_task')
date_time = models.DateTimeField(null=True, blank=True)
def __str__(self):
return self.text

@ -177,10 +177,14 @@
<div class="w-full">
<p class="text-sm {% if 'Completed' in status.text %} text-green-700 {% else %} text-secondosiblue {% endif %}">{{status.text}}</p>
{% if status.task.project %}
<a href="{% url 'detailed-project' status.task.project.project_id %}">
{% if status.type and status.type_id %}
<a {% if status.type == 'Task' and status.type_id %} href="{% url 'detailed-project' status.task.project.project_id %}" {% elif status.type == 'Daily Report' %} href="{% url 'dailyreports' %}" {% endif %}>
<div class="w-full flex justify-end items-center mt-1 text-gray-400 hover:text-secondosiblue duration-300 cursor-pointer">
{% if status.type == 'Task' %}
<p class="text-xs font-light">{{status.task.project}}</p>
{% elif status.type == 'Daily Report' %}
<p class="text-xs font-light">View Daily Report</p>
{% endif %}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>

@ -168,10 +168,14 @@
<div class="w-full">
<p class="text-sm {% if 'Completed' in status.text %} text-green-700 {% else %} text-secondosiblue {% endif %}">{{status.text}}</p>
{% if status.task.project %}
<a href="{% url 'detailed-project' status.task.project.project_id %}">
{% if status.type and status.type_id %}
<a {% if status.type == 'Task' and status.type_id %} href="{% url 'detailed-project' status.task.project.project_id %}" {% elif status.type == 'Daily Report' %} href="{% url 'dailyreports' %}" {% endif %}>
<div class="w-full flex justify-end items-center mt-1 text-gray-400 hover:text-secondosiblue duration-300 cursor-pointer">
{% if status.type == 'Task' %}
<p class="text-xs font-light">{{status.task.project}}</p>
{% elif status.type == 'Daily Report' %}
<p class="text-xs font-light">View Daily Report</p>
{% endif %}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3 h-3">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>

Loading…
Cancel
Save