Module: check_mk
Branch: master
Commit: c37c203738f59f2b6bb830afe238107613ad1284
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c37c203738f59f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 27 19:25:12 2015 +0100
Consolidated statusicon rendering
Now using regular icon/icon_button functions. Moved the
status icons to regular icon/button namespaces.
---
web/htdocs/htmllib.py | 26 ++++++++++----------
...us_download_csv.png => button_download_csv.png} | Bin 3106 -> 3106 bytes
.../{status_frameurl.png => button_frameurl.png} | Bin 2658 -> 2658 bytes
.../{status_pageurl.png => button_pageurl.png} | Bin 2403 -> 2403 bytes
.../{status_aggrcomp.png => icon_aggrcomp.png} | Bin 2710 -> 2710 bytes
.../{status_persist.png => icon_persist.png} | Bin 3160 -> 3160 bytes
web/htdocs/images/status_add_dashlet.png | Bin 920 -> 0 bytes
web/htdocs/images/status_ldap.png | Bin 4449 -> 0 bytes
web/htdocs/pages.css | 7 +++---
9 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index ddbda1b..05e5513 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -392,8 +392,8 @@ class html:
else:
return "images/icons/%s.png" % icon_name
- def icon(self, help, icon):
- self.write(self.render_icon(icon, help))
+ def icon(self, help, icon, **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 ''
@@ -1008,16 +1008,17 @@ class html:
self.write(self.render_popup_trigger(content, ident, what, data, url_vars))
def write_status_icons(self):
- self.write('<a target="_top" href="%s"><img
class=statusicon src="images/status_frameurl.png"
title="%s"></a>\n' % \
- (self.makeuri([]), _("URL to this frame")))
- self.write('<a target="_top" href="%s"><img
class=statusicon src="images/status_pageurl.png"
title="%s"></a>\n' % \
- ("index.py?" + self.urlencode_vars([("start_url",
self.makeuri([]))]), _("URL to this page including sidebar")))
+ self.icon_button(self.makeuri([]), _("URL to this frame"),
+ "frameurl", target="_top",
cssclass="statusicon")
+ self.icon_button("index.py?" +
self.urlencode_vars([("start_url", self.makeuri([]))]),
+ _("URL to this page including sidebar"),
+ "pageurl", target="_top",
cssclass="statusicon")
# TODO: Move this away from here. Make a context button. The view should handle
this
if self.myfile == "view" and self.var('mode') !=
'availability':
- self.write('<a target="_top" href="%s">' \
- '<img class=statusicon
src="images/status_download_csv.png" title="%s"></a>\n' %
\
- (self.makeuri([("output_format", "csv_export")]),
_("Export as CSV")))
+ self.icon_button(self.makeuri([("output_format",
"csv_export")]),
+ _("Export as CSV"),
+ "download_csv", target="_top",
cssclass="statusicon")
if self.myfile == "view":
mode_name = self.var('mode') == "availability" and
"availability" or "view"
@@ -1031,16 +1032,15 @@ class html:
encoded_vars[k] = v
self.popup_trigger(
- '<img class=statusicon src="images/icon_menu.png"
title="%s">\n' % _("Add this view to..."),
+ self.render_icon("menu", _("Add this view to..."),
cssclass="statusicon iconbutton"),
'add_visual', 'add_visual', data=[mode_name,
encoded_vars, {'name': self.var('view_name')}])
for img, tooltip in self.status_icons.items():
if type(tooltip) == tuple:
tooltip, url = tooltip
- self.write('<a target="_top"
href="%s"><img class=statusicon src="images/status_%s.png"
title="%s"></a>\n' % \
- (url, img, tooltip))
+ self.icon_button(url, tooltip, img)
else:
- self.write('<img class=statusicon
src="images/status_%s.png" title="%s">\n' % (img, tooltip))
+ self.icon(tooltip, img, cssclass="statusicon")
if self.times:
self.measure_time('body')
diff --git a/web/htdocs/images/status_download_csv.png
b/web/htdocs/images/button_download_csv.png
similarity index 100%
rename from web/htdocs/images/status_download_csv.png
rename to web/htdocs/images/button_download_csv.png
diff --git a/web/htdocs/images/status_frameurl.png
b/web/htdocs/images/button_frameurl.png
similarity index 100%
rename from web/htdocs/images/status_frameurl.png
rename to web/htdocs/images/button_frameurl.png
diff --git a/web/htdocs/images/status_pageurl.png b/web/htdocs/images/button_pageurl.png
similarity index 100%
rename from web/htdocs/images/status_pageurl.png
rename to web/htdocs/images/button_pageurl.png
diff --git a/web/htdocs/images/status_aggrcomp.png b/web/htdocs/images/icon_aggrcomp.png
similarity index 100%
rename from web/htdocs/images/status_aggrcomp.png
rename to web/htdocs/images/icon_aggrcomp.png
diff --git a/web/htdocs/images/status_persist.png b/web/htdocs/images/icon_persist.png
similarity index 100%
rename from web/htdocs/images/status_persist.png
rename to web/htdocs/images/icon_persist.png
diff --git a/web/htdocs/images/status_add_dashlet.png
b/web/htdocs/images/status_add_dashlet.png
deleted file mode 100644
index e7bc181..0000000
Binary files a/web/htdocs/images/status_add_dashlet.png and /dev/null differ
diff --git a/web/htdocs/images/status_ldap.png b/web/htdocs/images/status_ldap.png
deleted file mode 100644
index c46fda3..0000000
Binary files a/web/htdocs/images/status_ldap.png and /dev/null differ
diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css
index 18c92a7..904d975 100644
--- a/web/htdocs/pages.css
+++ b/web/htdocs/pages.css
@@ -172,11 +172,10 @@ body.main table.footer td.middle { text-align: center; }
body.main table.footer td.right { text-align: right; }
body.main table.footer a { color: #246; }
-body.main table.footer img.statusicon {
+body.main table.footer img.statusicon,
+body.main table.footer a.statusicon img {
width: 16px;
- top: 16px;
- position: relative;
- top: -3px;
+ height: 16px;
}
div#foot_refresh, div#foot_refresh_time {