diff --git a/.DS_Store b/.DS_Store index a67d9ec8..d93c0b3e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/osinaweb/.DS_Store b/osinaweb/.DS_Store index c79a6df2..a865cf68 100644 Binary files a/osinaweb/.DS_Store and b/osinaweb/.DS_Store differ diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index a2b7f7c5..9e949f45 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/.DS_Store b/osinaweb/osinacore/.DS_Store index a53abd4d..f8ee0539 100644 Binary files a/osinaweb/osinacore/.DS_Store and b/osinaweb/osinacore/.DS_Store differ diff --git a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc index 30ec5955..def09b25 100644 Binary files a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc index adc921fa..9bd17d34 100644 Binary files a/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/add/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/add/views.py b/osinaweb/osinacore/add/views.py index 1d493c42..39017f9a 100644 --- a/osinaweb/osinacore/add/views.py +++ b/osinaweb/osinacore/add/views.py @@ -522,6 +522,18 @@ def add_daily_report(request): user = request.user today = date.today() statuses = Status.objects.filter(staff=user.staffprofile, date_time__date=today) + # Calculate total time worked for today + total_time = PointActivity.objects.filter( + point__task__assigned_to=user.staffprofile, + start_time__date=today + ).aggregate(Sum('total_time'))['total_time__sum'] or timedelta() + + total_seconds = int(total_time.total_seconds()) + hours = total_seconds // 3600 + minutes = (total_seconds % 3600) // 60 + seconds = total_seconds % 60 + total_time_text = f'Total working hours: {hours}h {minutes}m {seconds}s' + if request.method == 'POST': text = request.POST.get('text') current_datetime = datetime.now() @@ -540,7 +552,7 @@ def add_daily_report(request): ) dailyreport.save() - status_text = f'Added my daily report.' + status_text = f'Added my daily report.
{total_time_text}' status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, type='Daily Report', type_id=dailyreport.id) status.save() diff --git a/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc index 3ce92b3b..cb8b619b 100644 Binary files a/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/edit/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/models.py b/osinaweb/osinacore/models.py index cfdaa7be..25be9240 100644 --- a/osinaweb/osinacore/models.py +++ b/osinaweb/osinacore/models.py @@ -12,12 +12,7 @@ from asgiref.sync import async_to_sync from channels.layers import get_channel_layer from datetime import timedelta - - # Create your models here. - - - class Reference(models.Model): name = models.CharField(max_length=50) date = models.DateField() diff --git a/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html b/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html index 2e962e1a..e5911ee6 100644 --- a/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html +++ b/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html @@ -166,7 +166,8 @@
-

{{status.text}}

+

+ {{status.text|safe}}

{% if status.type and status.type_id %} diff --git a/osinaweb/static/.DS_Store b/osinaweb/static/.DS_Store index 0ec74e15..262ab763 100644 Binary files a/osinaweb/static/.DS_Store and b/osinaweb/static/.DS_Store differ diff --git a/osinaweb/static/js/.DS_Store b/osinaweb/static/js/.DS_Store index 1f787948..1eb08be8 100644 Binary files a/osinaweb/static/js/.DS_Store and b/osinaweb/static/js/.DS_Store differ