From 43e5471fdbf91b0028c496f8e01091b2d1ad8189 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Wed, 27 Nov 2024 18:05:16 +0100 Subject: seperate out overview --- templates/overview.t | 21 +++++++++++++++++++++ templates/report.t | 41 +++++++++++++---------------------------- 2 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 templates/overview.t diff --git a/templates/overview.t b/templates/overview.t new file mode 100644 index 0000000..caff0cb --- /dev/null +++ b/templates/overview.t @@ -0,0 +1,21 @@ +{{ range $id, $wp := .Workpackages -}} +## Workpackage {{ $id }}: {{ $wp.Title }} +{{ range $tid, $task := $wp.Tasks }} + {{$task.ID}}: {{ $task.Title }} + Budget: {{ $task.Budget.AsMonth }} +{{ end }} + +{{ end }} + +| Date | Time | WP's | +|:-----------|---------:|:--------:| +{{- range $d, $e := .Timeline }} +| {{ $d }} | {{ printf "%8s" $e.Total }} | {{ printf "%8s" $e.WPs }} | +{{- end }} +{{- $tl := .Timeline }}{{- $hd := .Holidays }} + +# Days +{{ range .Days 2024 03 }} +{{if or .IsWeekend .IsHoliday }}# {{end}}{{.Date}}{{ if .IsHoliday}} ({{ index $hd .Date}}){{end -}} +{{ with .Planned }} Planned: {{ .Total }}{{ end }}{{ with .Worked }} Worked: {{ .Total }}{{end}} +{{- end }} \ No newline at end of file diff --git a/templates/report.t b/templates/report.t index 08f4f43..d89b921 100644 --- a/templates/report.t +++ b/templates/report.t @@ -2,34 +2,19 @@ Project: {{.Name}} Grant: {{.Grant}} Start: {{.Start}} End: {{.End}} -Beneficiary: {{.Beneficiary}} +Beneficiary: {{.Beneficiary}}{{- $p := .}} - -{{ range $wp, $t := .Totals }} +# Planing +{{range $wp, $t := .Totals }} Total for {{ $wp }}: - - Budgeted: {{ printf "%8s" $t.Budgeted.AsDay }} - - Planned: {{ printf "%8s" $t.Planned.AsDay }}{{with $t.Unaccounted }} Unaccounted: {{.AsDay}}{{end}} - - Actual: {{ printf "%8s" $t.Actual.AsDay }} -{{ end }} - -{{ range $id, $wp := .Workpackages -}} -## Workpackage {{ $id }}: {{ $wp.Title }} -{{ range $tid, $task := $wp.Tasks }} - {{$task.ID}}: {{ $task.Title }} - Budget: {{ $task.Budget.AsMonth }} + - Budgeted: {{ printf "%8s" $t.Budgeted.AsDay }} + - Planned: {{ printf "%8s" $t.Planned.AsDay }}{{with $t.Unaccounted }} !Unaccounted: {{.AsDay}}{{end}} + - Actual: {{ printf "%8s" $t.Actual.AsDay }} + - Per Task: + {{- range $n, $t := (index $p.Workpackages $wp).Tasks }} + - {{ $t.ID }} ({{ $n }}):{{ $tt := $p.TotalWPTask $wp $n }} + - Budgeted: {{ printf "%8s" $tt.Budgeted.AsDay }} + - Planned: {{ printf "%8s" $tt.Planned.AsDay }}{{with $tt.Unaccounted }} !Unaccounted: {{.AsDay}}{{end}} + - Actual: {{ printf "%8s" $tt.Actual.AsDay }} + {{ end }} {{ end }} - -{{ end }} - -| Date | Time | WP's | -|:-----------|---------:|:--------:| -{{- range $d, $e := .Timeline }} -| {{ $d }} | {{ printf "%8s" $e.Total }} | {{ printf "%8s" $e.WPs }} | -{{- end }} -{{- $tl := .Timeline }}{{- $hd := .Holidays }} - -# Days -{{ range .Days 2024 03 }} -{{if or .IsWeekend .IsHoliday }}# {{end}}{{.Date}}{{ if .IsHoliday}} ({{ index $hd .Date}}){{end -}} -{{ with .Planned }} Planned: {{ .Total }}{{ end }}{{ with .Worked }} Worked: {{ .Total }}{{end}} -{{- end }} -- cgit v1.2.3