From 4b1de1d7bfb0261d28a192171b73388cb639eae4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 12 Mar 2017 18:47:21 +0100 Subject: Add GenerateWeeklyTimesheet() A function to generate a weekly time sheet. Add a new `defaults` key to the config.yml file. Looks like this: defaults: client: project: module: task: work_type: time: billable: This will be used to fill in default values when a timesheet is generated. --- templates/timesheet.yml.tmpl | 11 +++++++++++ templates/weekly_timesheet.yml.tmpl | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 templates/timesheet.yml.tmpl create mode 100644 templates/weekly_timesheet.yml.tmpl (limited to 'templates') diff --git a/templates/timesheet.yml.tmpl b/templates/timesheet.yml.tmpl new file mode 100644 index 0000000..1930b09 --- /dev/null +++ b/templates/timesheet.yml.tmpl @@ -0,0 +1,11 @@ +{{- define "timesheet" -}} +- client: {{.Client}} + project: {{.Project}} + module: {{.Module}} + task: {{.Task}} + work_type: {{.WorkType}} + date: {{.Date.Format "02/01/06"}} + time: {{.Time}} + billable: {{.Billable}} + description: {{.Description}} +{{ end -}} diff --git a/templates/weekly_timesheet.yml.tmpl b/templates/weekly_timesheet.yml.tmpl new file mode 100644 index 0000000..0ea6582 --- /dev/null +++ b/templates/weekly_timesheet.yml.tmpl @@ -0,0 +1,3 @@ +{{- range . -}} + {{- template "timesheet" . -}} +{{- end -}} -- cgit v1.2.3