[Getan-commits] [PATCH] Move justification of human_time to templates (only for zeiterfassung)

Wald Commits scm-commit at wald.intevation.org
Mon Mar 3 15:58:43 CET 2014


# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Date 1393858674 -3600
# Node ID f4dcfbede99b62650c65a456733ec36b3a521eb1
# Parent  c18bd0042eda210134644daccac938be77063d07
Move justification of human_time to templates (only for zeiterfassung)

The totals are often longer 100h and more, so if justification is desired
here, it would not be to two full hour digits anyway.

diff -r c18bd0042eda -r f4dcfbede99b getan/template.py
--- a/getan/template.py	Mon Mar 03 15:49:22 2014 +0100
+++ b/getan/template.py	Mon Mar 03 15:57:54 2014 +0100
@@ -26,7 +26,7 @@
         if m == 60:
             m = 0
             h += 1
-    return "%2d:%02d" % (h, m)
+    return "%d:%02d" % (h, m)
 
 
 def date_format(d):
diff -r c18bd0042eda -r f4dcfbede99b getan/templates/zeiterfassung
--- a/getan/templates/zeiterfassung	Mon Mar 03 15:49:22 2014 +0100
+++ b/getan/templates/zeiterfassung	Mon Mar 03 15:57:54 2014 +0100
@@ -2,7 +2,7 @@
 {%- if proj.entries %}
 # project: {{ proj.key }} ({{ proj.desc }})
 {% for entry in proj.entries -%}
-{{ entry.start|date_format}} {{ entry.get_duration()|human_time }}h ? {{ user.ljust(3) }} [{{ entry.get_workpackage() }}] {{ entry.get_comment() }}
+{{ entry.start|date_format}} {{ (entry.get_duration()|human_time).rjust(5) }}h ? {{ user.ljust(3) }} [{{ entry.get_workpackage() }}] {{ entry.get_comment() }}
 {% endfor -%}
 # total: {{ proj.get_total_duration()|human_time }}h
 {% endif -%}


More information about the Getan-commits mailing list