Mercurial > getan > getan
comparison getan/templates/zeiterfassung2 @ 566:5ee84c9805f9
improve templates/zeiterfassung2 to sort better
`zeiterfassung2` groups several entries for one workpackage into one
zeiterfassungs.txt entry, adding a sorting by starttime makes the entry
more naturally readable.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Tue, 01 Jun 2021 16:02:55 +0200 |
parents | a499441249af |
children |
comparison
equal
deleted
inserted
replaced
565:2c6ff55be046 | 566:5ee84c9805f9 |
---|---|
2 {%- if proj.entries %} | 2 {%- if proj.entries %} |
3 ## category: {{ proj.key }} ({{ proj.desc }}) | 3 ## category: {{ proj.key }} ({{ proj.desc }}) |
4 {% for grouper, gentries in proj.entries|sort(attribute='startisoday')|groupby('startisoday') %} | 4 {% for grouper, gentries in proj.entries|sort(attribute='startisoday')|groupby('startisoday') %} |
5 {#- grouper will contain the attribute used for groupby() -#} | 5 {#- grouper will contain the attribute used for groupby() -#} |
6 | 6 |
7 {% for ggrouper, ggentries in gentries|groupby('workpackage') %} | 7 {% for ggrouper, ggentries in gentries|sort(attribute='start')|groupby('workpackage') %} |
8 {{ gentries[0].start|date_format }} {{ (ggentries|duration|human_time).rjust(5) }}h a {{ user.ljust(3) }} [{{ ggrouper }}] | 8 {{ gentries[0].start|date_format }} {{ (ggentries|duration|human_time).rjust(5) }}h a {{ user.ljust(3) }} [{{ ggrouper }}] |
9 {%- for entry in ggentries -%} | 9 {%- for entry in ggentries -%} |
10 {%- if loop.index == 1 -%}{{ ' ' }} | 10 {%- if loop.index == 1 -%}{{ ' ' }} |
11 {%- else -%}{{ ';\n ' }} | 11 {%- else -%}{{ ';\n ' }} |
12 {%- endif -%} | 12 {%- endif -%} |