Module: check_mk
Branch: master
Commit: 33920930683f2264f45051c7e1713344bf76d8d3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33920930683f22…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 5 16:26:13 2019 +0200
Same label / tag visualization in edit mode and display mode
Change-Id: Iaf159a9e800b3d67acba038837d3a6e65ed43f94
---
cmk/gui/htmllib.py | 8 +++++---
cmk/gui/view_utils.py | 11 ++++++++---
web/htdocs/themes/classic/scss/_pages.scss | 4 ++++
web/htdocs/themes/facelift/scss/_pages.scss | 4 ++++
4 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/cmk/gui/htmllib.py b/cmk/gui/htmllib.py
index ab54b33..5a85665 100644
--- a/cmk/gui/htmllib.py
+++ b/cmk/gui/htmllib.py
@@ -484,9 +484,11 @@ class HTMLGenerator(OutputFunnel):
"div", "p", "span",
"canvas", "strong", "sub", "tt", "u",
"i", "b", "x", "option"])
# these tags can be called by open_name(), close_name() and render_name(), e.g.
'self.open_html()'
- _tag_names = set(['html', 'head', 'body', 'header',
'footer', 'a', 'b', 'sup',\
- 'script', 'form', 'button',
'p', 'select', 'fieldset',\
- 'table', 'tbody', 'row',
'ul', 'li', 'br', 'nobr', 'input',
'span'])
+ _tag_names = set([
+ 'html', 'head', 'body', 'header',
'footer', 'a', 'b', 'sup', 'script',
'form', 'button',
+ 'p', 'select', 'fieldset', 'table',
'tbody', 'row', 'ul', 'li', 'br', 'nobr',
'input',
+ 'span', 'tags', 'tag'
+ ])
# Of course all shortcut tags can be used as well.
_tag_names.update(_shortcut_tags)
diff --git a/cmk/gui/view_utils.py b/cmk/gui/view_utils.py
index dee6379..9a7da96 100644
--- a/cmk/gui/view_utils.py
+++ b/cmk/gui/view_utils.py
@@ -124,13 +124,18 @@ def check_limit(rows, limit, user):
def render_tag_groups(tag_groups, object_type, with_links):
- return HTML("").join(
+ elements = [
_render_tag_group(tg_id, tag, object_type, with_links)
- for tg_id, tag in sorted(tag_groups.items()))
+ for tg_id, tag in sorted(tag_groups.items())
+ ]
+ return html.render_tags(
+ HTML("").join(elements), class_=["tagify",
"labels", "display"], readonly="true")
def _render_tag_group(tg_id, tag, object_type, with_link):
- span = html.render_span("%s:%s" % (tg_id, tag),
class_="tag_group")
+ span = html.render_tag(
+ html.render_div(html.render_span("%s:%s" % (tg_id, tag),
class_=["tagify__tag-text"])),
+ class_=["tagify--noAnim"])
if not with_link:
return span
diff --git a/web/htdocs/themes/classic/scss/_pages.scss
b/web/htdocs/themes/classic/scss/_pages.scss
index 58b3612..9a9c72f 100644
--- a/web/htdocs/themes/classic/scss/_pages.scss
+++ b/web/htdocs/themes/classic/scss/_pages.scss
@@ -1556,3 +1556,7 @@ span.tag_group {
font-size: 8pt;
}
}
+
+.tagify.display[readonly] tag > div::before {
+ background: #d6d6d6;
+}
diff --git a/web/htdocs/themes/facelift/scss/_pages.scss
b/web/htdocs/themes/facelift/scss/_pages.scss
index 5ccf0a0..7e6d316 100644
--- a/web/htdocs/themes/facelift/scss/_pages.scss
+++ b/web/htdocs/themes/facelift/scss/_pages.scss
@@ -51,3 +51,7 @@ span.tag_group {
font-size: 8pt;
}
}
+
+.tagify.display[readonly] tag > div::before {
+ background: #d6d6d6;
+}