Module: check_mk
Branch: master
Commit: 89a7e4676b40a0b0a1a51048b16109d9d2a227df
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89a7e4676b40a0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 6 09:53:37 2015 +0100
Fixed bug in last change
---
web/plugins/views/painters.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 5165a2d..9bc6537 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -335,6 +335,12 @@ def paint_age(timestamp, has_been_checked, bold_if_younger_than,
mode=None, what
(mode == "mixed" and age >= 48 * 3600 or age < -48 * 3600):
return "age", time.strftime(dateformat + " %H:%M:%S",
time.localtime(timestamp))
+ warn_txt = ''
+ if what == 'future' and age > 0:
+ warn_txt = ' <b>%s</b>' % _('in the past!')
+ elif what == 'past' and age < 0:
+ warn_txt = ' <b>%s</b>' % _('in the future!')
+
# Time delta less than two days => make relative time
if age < 0:
age = -age
@@ -346,12 +352,6 @@ def paint_age(timestamp, has_been_checked, bold_if_younger_than,
mode=None, what
else:
age_class = "age"
- warn_txt = ''
- if what == 'future' and age > 0:
- warn_txt = ' <b>%s</b>' % _('in the past!')
- elif what == 'past' and age < 0:
- warn_txt = ' <b>%s</b>' % _('in the future!')
-
return age_class, prefix + html.age_text(age) + warn_txt