Module: check_mk
Branch: master
Commit: 4f82760a3613e3760729e031df939681a041c3fd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f82760a3613e3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 30 11:55:36 2018 +0200
6375 FIX Fixed sidebar folding when "Show Check_MK edition & version in
sidebar" is disabled
When the global setting "Show Check_MK edition & version in sidebar" is
disabled
the folding of the sidebar was not possible in previous releases. Additionally,
unacknowledged incompatible werks were shown while they should be hidden just
like the version information.
Change-Id: Ie6a19eabf2c53d3f22cae1402d118c19c90e1ea0
---
.werks/6375 | 14 ++++++++++++++
cmk/gui/sidebar.py | 11 ++++++-----
web/htdocs/js/sidebar.js | 8 ++++++--
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/.werks/6375 b/.werks/6375
new file mode 100644
index 0000000..1828810
--- /dev/null
+++ b/.werks/6375
@@ -0,0 +1,14 @@
+Title: Fixed sidebar folding when "Show Check_MK edition & version in
sidebar" is disabled
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1532723132
+
+When the global setting "Show Check_MK edition & version in sidebar" is
disabled
+the folding of the sidebar was not possible in previous releases. Additionally,
+unacknowledged incompatible werks were shown while they should be hidden just
+like the version information.
diff --git a/cmk/gui/sidebar.py b/cmk/gui/sidebar.py
index 7738979..2ea840c 100644
--- a/cmk/gui/sidebar.py
+++ b/cmk/gui/sidebar.py
@@ -232,11 +232,12 @@ def sidebar_head():
html.br()
html.write(cmk.__version__)
- if werks.may_acknowledge():
- num_unacknowledged_werks = werks.num_unacknowledged_incompatible_werks()
- if num_unacknowledged_werks:
- html.span(num_unacknowledged_werks, class_="unack_werks",
- title=_("%d unacknowledged incompatible werks") %
num_unacknowledged_werks)
+ if werks.may_acknowledge():
+ num_unacknowledged_werks = werks.num_unacknowledged_incompatible_werks()
+ if num_unacknowledged_werks:
+ html.span(num_unacknowledged_werks, class_="unack_werks",
+ title=_("%d unacknowledged incompatible werks") %
num_unacknowledged_werks)
+
html.close_a()
html.close_div()
html.close_a()
diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js
index 5882a8c..47b2b00 100644
--- a/web/htdocs/js/sidebar.js
+++ b/web/htdocs/js/sidebar.js
@@ -514,7 +514,9 @@ function fold_sidebar()
document.getElementById('check_mk_sidebar').style.position =
"relative";
document.getElementById('check_mk_sidebar').style.left = "-265px";
document.getElementById('side_footer').style.display = "none";
- document.getElementById('side_version').style.display = "none";
+ var version = document.getElementById('side_version');
+ if (version)
+ version.style.display = "none";
parent.document.body.cols = sidebar_width() + ",*";
get_url('sidebar_fold.py?fold=yes');
}
@@ -526,7 +528,9 @@ function unfold_sidebar()
document.getElementById('check_mk_sidebar').style.position = "";
document.getElementById('check_mk_sidebar').style.left = "0";
document.getElementById('side_footer').style.display = "";
- document.getElementById('side_version').style.display = "";
+ var version = document.getElementById('side_version');
+ if (version)
+ version.style.display = "";
parent.document.body.cols = sidebar_width() + ",*";
get_url('sidebar_fold.py?fold=');
}