changeset 370:f4dcfbede99b

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.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 03 Mar 2014 15:57:54 +0100
parents c18bd0042eda
children 8b44243b799a
files getan/template.py getan/templates/zeiterfassung
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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):
--- 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 -%}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)