aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorTeddy Wing2017-03-12 18:47:21 +0100
committerTeddy Wing2017-03-12 18:47:21 +0100
commit4b1de1d7bfb0261d28a192171b73388cb639eae4 (patch)
tree67355f25ee10580fd2b7e797d244a8506d1345e5 /templates
parent72ce73048e3c04982012c7900eef080ca5b1f726 (diff)
downloadtimetasker-4b1de1d7bfb0261d28a192171b73388cb639eae4.tar.bz2
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.
Diffstat (limited to 'templates')
-rw-r--r--templates/timesheet.yml.tmpl11
-rw-r--r--templates/weekly_timesheet.yml.tmpl3
2 files changed, 14 insertions, 0 deletions
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 -}}