From 53e04551e652de1846baeb86f765ae488743f5bb Mon Sep 17 00:00:00 2001 From: ccremer Date: Mon, 16 Jan 2023 14:14:29 +0100 Subject: [PATCH] Align and colorize columns in the employee report --- pkg/web/employeereport/employeereport_view.go | 3 ++ templates/employeereport.html | 44 +++++++++++++------ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/pkg/web/employeereport/employeereport_view.go b/pkg/web/employeereport/employeereport_view.go index 6fdbd86..ab206ed 100644 --- a/pkg/web/employeereport/employeereport_view.go +++ b/pkg/web/employeereport/employeereport_view.go @@ -64,9 +64,12 @@ func (v *reportView) getValuesForReport(report timesheet.Report, previousPayslip "WorkedHours": v.FormatDurationInHours(report.Summary.TotalWorkedTime), "OutOfOfficeHours": v.FormatDurationInHours(report.Summary.TotalOutOfOfficeTime), "OvertimeHours": v.FormatDurationInHours(report.Summary.TotalOvertime), + "OvertimeClassName": v.OvertimeClassname(report.Summary.TotalOvertime), "PreviousBalance": previousBalanceCellText, "NextBalance": nextBalanceCellText, + "NextBalanceClassName": v.OvertimeClassname(nextBalance), "ProposedBalance": proposedBalanceCellText, + "ProposedBalanceClassName": v.OvertimeClassname(proposedBalance), "OvertimeBalanceEditEnabled": nextPayslip != nil, "OvertimeBalanceEditPreviewValue": overtimeBalanceEditPreview, "ValidationError": validationErrorList.Error(), diff --git a/templates/employeereport.html b/templates/employeereport.html index ac40b71..9282648 100644 --- a/templates/employeereport.html +++ b/templates/employeereport.html @@ -50,6 +50,22 @@ top: 0; z-index: 1; } + + .Overtime { + color: #005AB5; + } + + .Undertime { + color: #DC3220; + } + @media (min-width: 2000px) { + .container { + max-width: 2000px; + } + .table { + table-layout: fixed; + } + }

Attendances for {{ .Month }} {{ .Year }}

@@ -73,13 +89,13 @@

Attendances for {{ .Month }} {{ .Year }}

Name Leaves - Excused hours - Worked hours - (Out of office hours, real) - {{ .LastMonth }} Payslip - Overtime delta - Proposed balance - {{ .Month }} Payslip + Excused hours + Worked hours + (Out of office hours, real) + {{ .LastMonth }} Payslip + Overtime delta + Proposed balance + {{ .Month }} Payslip Save in {{ .Month }} Payslip @@ -91,13 +107,13 @@

Attendances for {{ .Month }} {{ .Year }}

{{- with .ValidationError }}
⚠️ {{ . }}{{ end -}} {{ .Leaves }}d - {{ .ExcusedHours }} - {{ .WorkedHours }} - {{ .OutOfOfficeHours }} - {{ .PreviousBalance }} - {{ .OvertimeHours }} - {{ .ProposedBalance }} - {{ .NextBalance }} + {{ .ExcusedHours }} + {{ .WorkedHours }} + {{ .OutOfOfficeHours }} + {{ .PreviousBalance }} + {{ .OvertimeHours }} + {{ .ProposedBalance }} + {{ .NextBalance }} {{- if .OvertimeBalanceEditEnabled }}