Module: check_mk
Branch: master
Commit: 224581bcc17653f21acebdc1bd0c94abb9f0a8e6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=224581bcc17653…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 27 14:04:14 2019 +0100
Moved topic VS to helper function
CMK-1754
Change-Id: I32c36e843654611e4e03e3a8fbd6a1c669e597aa
---
cmk/gui/plugins/sidebar/bookmarks.py | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/cmk/gui/plugins/sidebar/bookmarks.py b/cmk/gui/plugins/sidebar/bookmarks.py
index e79000e..454fa5e 100644
--- a/cmk/gui/plugins/sidebar/bookmarks.py
+++ b/cmk/gui/plugins/sidebar/bookmarks.py
@@ -121,22 +121,7 @@ class BookmarkList(pagetypes.Overridable):
validate=cls.validate_url,
)),
(IconSelector(title=_("Icon"),)),
- (Alternative(
- elements=[
- FixedValue(
- None,
- title=_("Use default topic"),
- totext=_("(default topic)"),
- ),
- TextUnicode(
- title=_("Individual topic"),
- size=30,
- allow_empty=False,
- ),
- ],
- title=_("Topic") +
"<sup>*</sup>",
- style="dropdown",
- )),
+ (cls._vs_topic()),
],
orientation="horizontal",
title=_("Bookmarks"),
@@ -149,6 +134,25 @@ class BookmarkList(pagetypes.Overridable):
return parameters
@classmethod
+ def _vs_topic(cls):
+ return Alternative(
+ elements=[
+ FixedValue(
+ None,
+ title=_("Use default topic"),
+ totext=_("(default topic)"),
+ ),
+ TextUnicode(
+ title=_("Individual topic"),
+ size=30,
+ allow_empty=False,
+ ),
+ ],
+ title=_("Topic") + "<sup>*</sup>",
+ style="dropdown",
+ )
+
+ @classmethod
def validate_url(cls, value, varprefix):
parsed = urlparse.urlparse(value)