From 28ab005007282bc0b1fb9610ed00d2a59cf4ab3e Mon Sep 17 00:00:00 2001 From: Horilla Date: Wed, 7 Feb 2024 12:54:24 +0530 Subject: [PATCH] [FIX] ATTENDANCE: Attendance check-in label show when time runnner enabled --- attendance/views/clock_in_out.py | 42 ++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/attendance/views/clock_in_out.py b/attendance/views/clock_in_out.py index 7de497154..7b8739d84 100644 --- a/attendance/views/clock_in_out.py +++ b/attendance/views/clock_in_out.py @@ -387,21 +387,30 @@ def clock_out(request): clock_out_attendance_and_activity( employee=employee, date_today=date_today, now=now, out_datetime=datetime_now ) - script = """ - - """.format( - at_work_seconds_forecasted=employee.get_forecasted_at_work()[ - "forecasted_at_work_seconds" - ], - ) - mouse_in = """onmouseenter="$(this).find('span').show();$(this).find('.at-work-seconds').hide();""" - mouse_out = """onmouseleave="$(this).find('span').hide();$(this).find('.at-work-seconds').show();" """ + script = "" + hidden_label = "" + time_runner_enabled = timerunner_enabled(request)["enabled_timerunner"] + mouse_in = "" + mouse_out = "" + if time_runner_enabled: + script = """ + + """.format( + at_work_seconds_forecasted=employee.get_forecasted_at_work()[ + "forecasted_at_work_seconds" + ], + ) + hidden_label = """ + style="display:none" + """ + mouse_in = """ onmouseenter="$(this).find('div.at-work-seconds').hide();$(this).find('span').show();" """ + mouse_out = """onmouseleave="$(this).find('div.at-work-seconds').show();$(this).find('span').hide();" """ return HttpResponse( """ {script} """.format( check_in=_("Check-In"), script=script, + hidden_label=hidden_label, mouse_in=mouse_in, mouse_out=mouse_out, )