Mercurial > getan > getan
view 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 |
line wrap: on
line source
{% for proj in projects %} {%- if proj.entries %} ## category: {{ proj.key }} ({{ proj.desc }}) {% for grouper, gentries in proj.entries|sort(attribute='startisoday')|groupby('startisoday') %} {#- grouper will contain the attribute used for groupby() -#} {% for ggrouper, ggentries in gentries|sort(attribute='start')|groupby('workpackage') %} {{ gentries[0].start|date_format }} {{ (ggentries|duration|human_time).rjust(5) }}h a {{ user.ljust(3) }} [{{ ggrouper }}] {%- for entry in ggentries -%} {%- if loop.index == 1 -%}{{ ' ' }} {%- else -%}{{ ';\n ' }} {%- endif -%} {{ entry.get_comment() }} {%- endfor -%} {%- endfor %} # daily sum: {{ gentries|duration|human_time }}h {% endfor -%} ## total category {{ proj.key }}: {{ proj.get_total_duration()|human_time }}h {% endif -%} {% endfor %} ### total all categories: {{ total_time|human_time }}h