# HG changeset patch # User Bernhard Reiter # Date 1581688578 -3600 # Node ID 1a179ed1c9d70d2f59e29a80842f47366684547e # Parent a59e318c3f7287b337bdf1c8c62a9bf436f1b0cc Improve getan-report templates * Move zeiterfassung-hierarchy1 to zeiterfassung-hierarchy2 to be more consistent with zeiterfassung and zeiterfassung2. * Add a new template which does not group the comments of entries as zeiterfassung-hierarchy1. diff -r a59e318c3f72 -r 1a179ed1c9d7 getan/templates/zeiterfassung-hierarchy1 --- a/getan/templates/zeiterfassung-hierarchy1 Fri Feb 14 14:35:28 2020 +0100 +++ b/getan/templates/zeiterfassung-hierarchy1 Fri Feb 14 14:56:18 2020 +0100 @@ -1,4 +1,4 @@ -{#- using projects keys as zeiterfassungs workpackages +{#- using project keys as zeiterfassung's workpackages -#} {%- for day, day_entries in entries|sort(attribute='startisoday')|groupby('startisoday') -%} @@ -7,15 +7,15 @@ in day_entries|sort(attribute='project_id')|groupby('project_id') %} {%- if project_id == project.id -%} -{{ project_day_entries[0].start|date_format }} {{ (project_day_entries|duration|human_time).rjust(5) - }}h a {{ user.ljust(3) }} [{{ project.key }}] {%- for entry in project_day_entries -%} - {%- if loop.index == 1 -%}{{ ' ' }} - {%- else -%}{{ ';\n ' }} - {%- endif -%} - {{ entry.get_comment() }} - {%- endfor %}{{'\n'}} + {{ entry.start|date_format }} {{ + (entry.get_duration()|human_time).rjust(5) + }}h a {{ user.ljust(3) }} [{{ project.key }}] {{ + entry.get_comment() + }}{{'\n'}} + {%- endfor -%} {%- endif -%} + {%- endfor -%} {%- endfor -%} {% endfor -%} diff -r a59e318c3f72 -r 1a179ed1c9d7 getan/templates/zeiterfassung-hierarchy2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/getan/templates/zeiterfassung-hierarchy2 Fri Feb 14 14:56:18 2020 +0100 @@ -0,0 +1,21 @@ +{#- using project keys as zeiterfassung's workpackages +-#} +{%- for day, day_entries + in entries|sort(attribute='startisoday')|groupby('startisoday') -%} + {%- for project in projects -%} + {%- for project_id, project_day_entries + in day_entries|sort(attribute='project_id')|groupby('project_id') %} + + {%- if project_id == project.id -%} +{{ project_day_entries[0].start|date_format }} {{ (project_day_entries|duration|human_time).rjust(5) + }}h a {{ user.ljust(3) }} [{{ project.key }}] + {%- for entry in project_day_entries -%} + {%- if loop.index == 1 -%}{{ ' ' }} + {%- else -%}{{ ';\n ' }} + {%- endif -%} + {{ entry.get_comment() }} + {%- endfor %}{{'\n'}} + {%- endif -%} + {%- endfor -%} + {%- endfor -%} +{% endfor -%}