Module: check_mk
Branch: master
Commit: 0a7eb9beadee52df660f86dce9745fcf91d4840d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a7eb9beadee52…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 27 10:26:33 2016 +0100
#2965 FIX Fixed HTML code shown in filter selection of favorite hosts filter
---
.werks/2965 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/views.py | 7 +------
web/htdocs/visuals.py | 20 +++++++++++++-------
web/plugins/visuals/filters.py | 2 +-
5 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/.werks/2965 b/.werks/2965
new file mode 100644
index 0000000..390db86
--- /dev/null
+++ b/.werks/2965
@@ -0,0 +1,9 @@
+Title: Fixed HTML code shown in filter selection of favorite hosts filter
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453886763
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index be46edd..3f059b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -265,6 +265,7 @@
* 2946 FIX: LDAP: User created during login does not trigger full user
synchronisation anymore...
* 2947 FIX: LDAP: Simplified automatic sync logic...
* 2956 FIX: Fixed exception on "Availability of Single-Host Aggregations view
+ * 2965 FIX: Fixed HTML code shown in filter selection of favorite hosts filter
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 5f8a1e3..b4c5f69 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -714,12 +714,7 @@ def show_filter(f):
f.display()
html.write('</div>')
else:
- html.write('<div class="floatfilter %s">' %
(f.double_height() and "double" or "single"))
- html.write('<div class=legend>%s</div>' % f.title)
- html.write('<div class=content>')
- f.display()
- html.write("</div>")
- html.write("</div>")
+ visuals.show_filter(f)
def show_filter_form(is_open, filters):
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index ac9da08..beb9b8a 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -813,6 +813,16 @@ def declare_filter(sort_index, f, comment = None):
f.comment = comment
f.sort_index = sort_index
+
+def show_filter(f):
+ html.write('<div class="floatfilter %s">' %
(f.double_height() and "double" or "single"))
+ html.write('<div class=legend>%s</div>' %
html.attrencode(f.title))
+ html.write('<div class=content>')
+ f.display()
+ html.write("</div>")
+ html.write("</div>")
+
+
# Base class for all filters
# name: The unique id of that filter. This id is e.g. used in the
# persisted view configuration
@@ -1084,7 +1094,8 @@ class VisualFilterList(ListOfMultiple):
self._filters[fname] = fspecs[fname]._filter
# Convert to list and sort them!
- fspecs = sorted(fspecs.items(), key=lambda x: (x[1]._filter.sort_index,
x[1].title()))
+ fspecs = sorted(fspecs.items(),
+ key=lambda x: (x[1]._filter.sort_index, x[1].title()))
kwargs.setdefault('title', _('Filters'))
kwargs.setdefault('add_label', _('Add filter'))
@@ -1118,12 +1129,7 @@ class VisualFilter(ValueSpec):
self._filter.set_value(value)
# A filter can not be used twice on a page, because the varprefix is not used
- html.write('<div class="floatfilter %s">' %
(self._filter.double_height() and "double" or "single"))
- html.write('<div class=legend>%s</div>' %
self._filter.title)
- html.write('<div class=content>')
- self._filter.display()
- html.write("</div>")
- html.write("</div>")
+ show_filter(self._filter)
def value_to_text(self, value):
# FIXME: optimize. Needed?
diff --git a/web/plugins/visuals/filters.py b/web/plugins/visuals/filters.py
index 1a122c1..82e350f 100644
--- a/web/plugins/visuals/filters.py
+++ b/web/plugins/visuals/filters.py
@@ -1058,7 +1058,7 @@ class FilterStarred(FilterTristate):
icon = '<img class="icon inline"
src="images/icon_starred.png"> '
FilterTristate.__init__(self,
name = what + "_favorites",
- title = icon + (what == "host" and _("Favorite Hosts")
or _("Favorite Services")),
+ title = HTML(icon + (what == "host" and _("Favorite
Hosts") or _("Favorite Services"))),
info = what,
column = what + "_favorite", # Column, not used
deflt = -1,