Module: check_mk
Branch: master
Commit: 5731ee08bffde0ebe6854933c730321a77c22fed
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5731ee08bffde0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Jun 24 11:35:10 2012 +0200
ValueSpec AbsoluteDate: allow label
---
web/htdocs/valuespec.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index b577ff7..be1d031 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1217,6 +1217,7 @@ class AbsoluteDate(ValueSpec):
ValueSpec.__init__(self, **kwargs)
self._default_value = today()
self._show_titles = kwargs.get("show_titles", True)
+ self._label = kwargs.get("label")
def canonical_value(self):
return self._default_value
@@ -1226,6 +1227,9 @@ class AbsoluteDate(ValueSpec):
return lt.tm_year, lt.tm_mon, lt.tm_mday
def render_input(self, varprefix, value):
+ if self._label:
+ html.write("%s " % self._label)
+
html.write('<table class=vs_date>')
if self._show_titles:
html.write('<tr><th>%s</th><th>%s</th><th>%s</th></tr>'
% (