Module: check_mk
Branch: master
Commit: 245e6aa5f972eb7d50e72aa90be2954768c79e00
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=245e6aa5f972eb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 26 17:14:13 2013 +0200
Rename config variable for date format
---
web/htdocs/htmllib.py | 4 ++--
web/htdocs/wato.py | 4 ++--
web/plugins/config/builtin.py | 2 +-
web/plugins/wato/check_mk_configuration.py | 28 ++++++++++++----------------
4 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index a7292f4..4f7cd04 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -887,8 +887,8 @@ class html:
'onclick="this.innerHTML=\'%s\';
document.location.reload();">%s</a></td>' %
(_("Reloading..."), title))
self.write('<td style="min-width:240px" class=right><span
id=headinfo></span>%s ' % login_text)
- if config.display_date_in_dashboard.get("format"):
- self.write(' <b id=headerdate
format="%s"></b>' %
config.display_date_in_dashboard["format"])
+ if config.pagetitle_date_format:
+ self.write(' <b id=headerdate
format="%s"></b>' % config.pagetitle_date_format)
self.write(' <b id=headertime></b>')
self.write("<script language=\"javascript\"
type=\"text/javascript\">updateHeaderTime()</script>")
try:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b2efec8..5e3c477 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5510,7 +5510,7 @@ def mode_edit_configvar(phase):
is_on_default = varname not in current_settings
if phase == "action":
- if html.var("reset"):
+ if html.var("_reset"):
if not isinstance(valuespec, Checkbox):
c = wato_confirm(
_("Resetting configuration variable"),
@@ -5574,7 +5574,7 @@ def mode_edit_configvar(phase):
html.button("save", _("Save"))
if allow_reset and not is_on_default:
curvalue = current_settings[varname]
- html.button("reset", curvalue == defvalue and _("Remove explicit
setting") or _("Reset to default"))
+ html.button("_reset", curvalue == defvalue and _("Remove explicit
setting") or _("Reset to default"))
html.hidden_fields()
html.end_form()
diff --git a/web/plugins/config/builtin.py b/web/plugins/config/builtin.py
index 51b8bb7..c1abc51 100644
--- a/web/plugins/config/builtin.py
+++ b/web/plugins/config/builtin.py
@@ -184,7 +184,7 @@ multisite_draw_ruleicon = False
default_downtime = {}
# Display dashboard date
-display_date_in_dashboard = {}
+pagetitle_date_format = None
# _ _ ____ ____
# | | | |___ ___ _ __| _ \| __ )
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index e68d97d..ec2fd34 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -219,22 +219,18 @@ register_configvar(group,
domain = "multisite")
register_configvar(group,
- "display_date_in_dashboard",
- Dictionary(
- title = _("Display date in dashboard"),
- help = _("When enabled, the dashboard headline also displays "\
- "the date in addition the time "),
- label = _("Draw date"),
- elements = [
- ("format", DropdownChoice(
- title = _("Display date in dashboard"),
- label = _("Date format"),
- choices = [
- ('yyyy-mm-dd', _("YYYY-MM-DD")),
- ('dd.mm.yyyy', _("DD.MM.YYYY")),
- ],
- default_value = 'yyyy-mm-dd'))
- ]),
+ "pagetitle_date_format",
+ DropdownChoice(
+ title = _("Date format for page titles"),
+ help = _("When enabled, the headline of each page also displays "\
+ "the date in addition the time."),
+ choices = [
+ (None, _("Do not display a date")),
+ ('yyyy-mm-dd', _("YYYY-MM-DD")),
+ ('dd.mm.yyyy', _("DD.MM.YYYY")),
+ ],
+ default_value = None
+ ),
domain = "multisite")
register_configvar(group,