Module: check_mk
Branch: master
Commit: 6d166703e475dba7627ecb48b32d4243dc92b1f3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d166703e475db…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 4 15:02:33 2017 +0200
4935 FIX Foldertree snapin: Fixed broken layout when using localized GUI
Change-Id: I5437effe341955d7451614e01d00efa841151035
---
.werks/4935 | 11 +++++++++++
web/htdocs/sidebar.py | 4 ++--
web/plugins/sidebar/wato.py | 43 +++++++++++++++++++++++++++++--------------
3 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/.werks/4935 b/.werks/4935
new file mode 100644
index 0000000..2139c35
--- /dev/null
+++ b/.werks/4935
@@ -0,0 +1,11 @@
+Title: Foldertree snapin: Fixed broken layout when using localized GUI
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1499173204
+
+
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index bce5777..6b33707 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -402,7 +402,9 @@ def render_snapin(name, state):
refresh_url = url
html.javascript("get_url(\"%s\", updateContents,
\"snapin_%s\")" % (refresh_url, name))
except Exception, e:
+ log_exception()
write_snapin_exception(e)
+ snapin_exception(e)
html.close_div()
html.close_div()
return refresh_url
@@ -466,8 +468,6 @@ def ajax_snapin():
with html.plugged():
try:
- # For testing purposes uncomment:
- # raise Exception("Test")
snapin["render"]()
except Exception, e:
write_snapin_exception(e)
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 9029b09..634d934 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -26,14 +26,15 @@
import config, wato, views, dashboard
-# +----------------------------------------------------------------------+
+# .--WATO----------------------------------------------------------------.
# | __ ___ _____ ___ |
# | \ \ / / \|_ _/ _ \ |
# | \ \ /\ / / _ \ | || | | | |
# | \ V V / ___ \| || |_| | |
# | \_/\_/_/ \_\_| \___/ |
# | |
-# +----------------------------------------------------------------------+
+# '----------------------------------------------------------------------'
+
def render_wato(mini):
if not config.wato_enabled:
html.write_text(_("WATO is disabled."))
@@ -100,15 +101,14 @@ sidebar_snapins["admin_mini"] = {
""",
}
-# .----------------------------------------------------------------------.
+#.
+# .--Foldertree----------------------------------------------------------.
# | _____ _ _ _ |
# | | ___|__ | | __| | ___ _ __| |_ _ __ ___ ___ |
# | | |_ / _ \| |/ _` |/ _ \ '__| __| '__/ _ \/ _ \ |
# | | _| (_) | | (_| | __/ | | |_| | | __/ __/ |
# | |_| \___/|_|\__,_|\___|_| \__|_| \___|\___| |
# | |
-# +----------------------------------------------------------------------+
-# | |
# '----------------------------------------------------------------------'
def compute_foldertree():
@@ -239,8 +239,18 @@ def render_wato_foldertree():
dashboard.load_dashboards()
topic_views = visuals_by_topic(views.permitted_views().items() +
dashboard.permitted_dashboards().items())
topics = [ (t, t) for t, s in topic_views ]
+
+ html.open_table()
+ html.open_tr()
+ html.td(_('Topic:'), class_="label")
+ html.open_td()
html.dropdown("topic", topics, deflt=selected_topic,
onchange='wato_tree_topic_changed(this)')
- html.span(_('Topic:'), class_="left")
+ html.close_td()
+ html.close_tr()
+
+ html.open_tr()
+ html.td(_("View:"), class_="label")
+ html.open_td()
for topic, view_list in topic_views:
targets = []
@@ -261,7 +271,9 @@ def render_wato_foldertree():
html.dropdown("target_%s" % topic, targets, deflt=default,
onchange='wato_tree_target_changed(this)', style=style)
- html.span(_("View:"), class_="left")
+ html.close_td()
+ html.close_tr()
+ html.close_table()
# Now render the whole tree
if user_folders:
@@ -276,18 +288,21 @@ sidebar_snapins['wato_foldertree'] = {
'render' : render_wato_foldertree,
'allowed' : [ 'admin', 'user', 'guest' ],
'styles' : """
+#snapin_wato_foldertree table {
+ width: 100%;
+ border-spacing: 0;
+}
#snapin_wato_foldertree select {
- float: right;
padding: 0;
- width: 190px;
+ width: 100%;
height: 19px;
margin-bottom: 2px;
}
-#snapin_wato_foldertree span {
- margin-top: 1px;
- display: block;
- color: #ffffff;
- height: 20px;
+#snapin_wato_foldertree table td.label {
+ width: 1px;
+}
+#snapin_wato_foldertree table td {
+ vertical-align: baseline;
}
"""
}