Module: check_mk
Branch: master
Commit: 284fa3948f04637c9200b453c0735ee147052a04
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=284fa3948f0463…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 25 13:47:01 2016 +0200
Cleaned up some hand crafted icons
---
web/htdocs/htmllib.py | 2 +-
web/htdocs/pagetypes.py | 11 +++++++----
web/htdocs/valuespec.py | 3 +--
web/htdocs/wato.py | 12 ++++--------
4 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 7125e4a..a42ffbb 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -461,7 +461,7 @@ class html(GUITester):
return "images/icons/%s.png" % icon_name
def icon(self, help, icon, **kwargs):
- self.write(self.render_icon(icon, help, **kwargs))
+ self.write(self.render_icon(icon, help, **kwargs))
def render_icon(self, icon_name, help="", middle=True, id=None,
cssclass=None):
align = middle and ' align=absmiddle' or ''
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index 2d51615..0b75acb 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -1074,10 +1074,13 @@ class OverridableContainer(Overridable, Container):
@classmethod
def render_addto_popup_entry(self, type_name, name, title):
- html.write('<li><a href="javascript:void(0)" '
- 'onclick="pagetype_add_to_container(\'%s\',
\'%s\'); reload_sidebar();">'
- '<img src="images/icon_%s.png">
%s</a></li>' %
- (type_name, name, type_name, title))
+ html.write("<li>")
+ html.write("<a href=\"javascript:void(0)\" "
+ "onclick=\"pagetype_add_to_container('%s',
'%s');reload_sidebar();\">" %
+ (type_name, name))
+ html.render_icon(type_name)
+ html.write(html.attrencode(title))
+ html.write("</li>")
# Callback for the Javascript function pagetype_add_to_container(). The
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 4ad12dd..22063ed 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1537,8 +1537,7 @@ class RadioChoice(DropdownChoice):
if self._columns != None:
html.write("<td>")
if len(entry) > 2 and entry[2] != None: # icon!
- label = '<img class=icon align=absmiddle
src="images/icon_%s.png" title="%s">' % \
- ( entry[2], entry[1].encode("utf-8"))
+ label = html.render_icon(entry[2], entry[1])
else:
label = entry[1]
html.radiobutton(varprefix, str(n), value == entry[0], label)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 8ce203a..4a76689 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -789,8 +789,7 @@ def show_hosts(folder):
icon = "autherr"
title = html.strip_tags(reason)
- table.cell(_('Auth'), '<img class=icon
src="images/icon_%s.png" title="%s">' % (icon, title),
sortable=False)
-
+ table.cell(_('Auth'), html.render_icon(icon, title), sortable=False)
# Permissions and Contact groups - through complete recursion and inhertance
permitted_groups, host_contact_groups, use_for_services = host.groups()
@@ -4510,14 +4509,11 @@ def mode_changelog(phase):
# State
table.cell("", css="buttons")
if srs.get("need_sync") and not
config.site_is_local(site_id):
- html.write('<img class=icon title="%s"
src="images/icon_need_replicate.png">' %
- _("This site is not update and needs a
replication."))
+ html.icon(_("This site is not update and needs a
replication."), "need_replicate")
if srs.get("need_restart"):
- html.write('<img class=icon title="%s"
src="images/icon_need_restart.png">' %
- _("This site needs a restart for activating the
changes."))
+ html.icon(_("This site needs a restart for activating the
changes."), "need_restart")
if uptodate:
- html.write('<img class=icon title="%s"
src="images/icon_siteuptodate.png">' %
- _("This site is up-to-date."))
+ html.icon(_("This site is up-to-date."),
"siteuptodate")
# Actions
table.cell(_("Activate"), css="buttons")