Module: check_mk
Branch: master
Commit: 950a9b5751de616bfbc4c69e1c1ff7474bc70d10
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=950a9b5751de61…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Apr 16 16:49:29 2012 +0200
New footer buttons for sidebar
---
ChangeLog | 1 +
web/htdocs/htmllib.py | 9 ++-
web/htdocs/images/button_sidebar_addsnapin_hi.png | Bin 0 -> 1145 bytes
web/htdocs/images/button_sidebar_addsnapin_lo.png | Bin 0 -> 1129 bytes
web/htdocs/images/button_sidebar_logout_hi.png | Bin 0 -> 1582 bytes
web/htdocs/images/button_sidebar_logout_lo.png | Bin 0 -> 1569 bytes
web/htdocs/images/button_sidebar_settings_hi.png | Bin 0 -> 1462 bytes
web/htdocs/images/button_sidebar_settings_lo.png | Bin 0 -> 1464 bytes
web/htdocs/sidebar.css | 66 ++------------------
web/htdocs/sidebar.py | 11 ++-
web/htdocs/wato.py | 7 +-
web/plugins/sidebar/wato.py | 2 +-
12 files changed, 26 insertions(+), 70 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0ea1d0c..5143458 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,7 @@
of the main frameset (%s will be replaced with OMD site name)
* FIX: Fix problem where snapins where invisible
* FIX: Fixed multisite timeout errors when nagios not running
+ * Sidebar: some new layout improvements
BI
* FIX: Fixed filtering of Single-Host Aggregations
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 0044448..e180460 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -359,7 +359,7 @@ class html:
def empty_icon(self):
self.write('<img class=icon src="images/trans.png">')
- def icon_button(self, url, help, icon, id="", onclick="",
style=""):
+ def icon_button(self, url, help, icon, id="", onclick="",
style="", target=""):
if id:
id = "id='%s' " % id
@@ -370,12 +370,15 @@ class html:
if style:
style = 'style="%s" ' % style
- self.write('<a %s%s%sonfocus="if (this.blur) this.blur();"
href="%s">'
+ if target:
+ target = 'target="%s" ' % target
+
+ self.write('<a %s%s%s%sonfocus="if (this.blur) this.blur();"
href="%s">'
'<img align=absmiddle class=iconbutton title="%s"
'
'src="images/button_%s_lo.png" '
'onmouseover=\"hilite_icon(this, 1)\" '
'onmouseout=\"hilite_icon(this, 0)\">'
- '</a>' % (id, onclick, style, url, help, icon))
+ '</a>' % (id, onclick, style, target, url, help, icon))
def empty_icon_button(self):
self.write('<img class="iconbutton trans"
src="images/trans.png">')
diff --git a/web/htdocs/images/button_sidebar_addsnapin_hi.png
b/web/htdocs/images/button_sidebar_addsnapin_hi.png
new file mode 100644
index 0000000..3fc7fd0
Binary files /dev/null and b/web/htdocs/images/button_sidebar_addsnapin_hi.png differ
diff --git a/web/htdocs/images/button_sidebar_addsnapin_lo.png
b/web/htdocs/images/button_sidebar_addsnapin_lo.png
new file mode 100644
index 0000000..21ee712
Binary files /dev/null and b/web/htdocs/images/button_sidebar_addsnapin_lo.png differ
diff --git a/web/htdocs/images/button_sidebar_logout_hi.png
b/web/htdocs/images/button_sidebar_logout_hi.png
new file mode 100644
index 0000000..9c760de
Binary files /dev/null and b/web/htdocs/images/button_sidebar_logout_hi.png differ
diff --git a/web/htdocs/images/button_sidebar_logout_lo.png
b/web/htdocs/images/button_sidebar_logout_lo.png
new file mode 100644
index 0000000..a48cd56
Binary files /dev/null and b/web/htdocs/images/button_sidebar_logout_lo.png differ
diff --git a/web/htdocs/images/button_sidebar_settings_hi.png
b/web/htdocs/images/button_sidebar_settings_hi.png
new file mode 100644
index 0000000..0083b45
Binary files /dev/null and b/web/htdocs/images/button_sidebar_settings_hi.png differ
diff --git a/web/htdocs/images/button_sidebar_settings_lo.png
b/web/htdocs/images/button_sidebar_settings_lo.png
new file mode 100644
index 0000000..716f4da
Binary files /dev/null and b/web/htdocs/images/button_sidebar_settings_lo.png differ
diff --git a/web/htdocs/sidebar.css b/web/htdocs/sidebar.css
index ba42335..1e9f0c8 100644
--- a/web/htdocs/sidebar.css
+++ b/web/htdocs/sidebar.css
@@ -93,77 +93,25 @@ body.side {
position: absolute;
bottom: 0;
left: 0;
- height: 35px;
+ height: 50px;
width: 100%;
z-index: 10;
background-repeat: no-repeat;
background-image: url("images/sidebar_bottom.png");
}
-#side_footer ul.buttons {
- height: 20px;
- z-index: 20;
- position: absolute;
+#side_footer img.iconbutton {
+ position: relative;
top: 10px;
- left: 15px;
- margin: 0;
- padding: 0;
-}
-
-#side_footer ul.buttons li {
- list-style-type: none;
- float: left;
- display: inline;
- margin-left: 0;
-}
-
-#side_footer ul.buttons a {
- width: 75px;
- height: 17px;
- display: block;
- color: #fff;
- text-align: center;
- vertical-align: middle;
- padding-top: 3px;
- text-decoration: none;
- background-repeat: repeat;
- background-image: url("images/sidebar_button_lo.png");
- margin: 0;
-}
-
-#side_footer ul.buttons a:hover {
- background-image: url("images/sidebar_button_hi.png");
-}
-
-#side_footer ul.buttons a.logout {
- width: 20px;
- margin-left: 5px;
- background-image: url("images/sidebar_logout_lo.png");
-}
-
-#side_footer ul.buttons a.logout:hover {
- background-image: url("images/sidebar_logout_hi.png");
-}
-
-#side_footer ul.buttons a.profile {
- width: 20px;
- margin-left: 2px;
- background-image: url("images/sidebar_profile_lo.png");
-}
-
-#side_footer ul.buttons a.profile:hover {
- background-image: url("images/sidebar_profile_hi.png");
-}
-
-#side_footer div.buttons a {
- float: left;
+ left: 10px;
+ margin-right: 3px;
}
#side_footer div.copyright {
color: #fff;
position: relative;
- left: 130px;
- top: 12px;
+ left: 141px;
+ top: -5px;
width: 122px;
text-align: right;
}
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index e9521ac..915efde 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -126,13 +126,16 @@ def sidebar_head():
def sidebar_foot():
html.write('<div id="side_footer">')
- html.write('<ul class=buttons>\n')
if config.may("configure_sidebar"):
- html.write('<li><a target="main"
href="sidebar_add_snapin.py">%s</a></li>' % _('Add
snapin'))
+ html.icon_button("sidebar_add_snapin.py", _("Add snapin to the
sidebar"), "sidebar_addsnapin",
+ target="main")
if config.may("edit_profile") or config.may("change_password"):
- html.write('<li><a class=profile target="main"
href="user_profile.py" title="%s"></a></li>' %
_('Edit user profile'))
+ html.icon_button("user_profile.py", _("Edit your personal
settings, change your password"), "sidebar_settings",
+ target="main")
+ # html.write('<li><a class=profile target="main"
href="user_profile.py" title="%s"></a></li>' %
_('Edit user profile'))
if config.may("logout"):
- html.write('<li><a class=logout target="_top"
href="logout.py" title="%s"></a></li>' %
_('Logout'))
+ html.icon_button("logout.py", _("Log out"),
"sidebar_logout", target="_top")
+ # html.write('<li><a class=logout target="_top"
href="logout.py" title="%s"></a></li>' %
_('Logout'))
html.write('</ul>')
html.write("<div class=copyright>%s</div>\n" %
_("© <a target=\"_blank\"
href=\"http://mathias-kettner.de\">Mathias Kettner</a>"))
html.write('</div>')
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1b3a234..255ff38 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -228,7 +228,7 @@ def page_handler():
if modefunc == None:
html.header(_("Sorry"), stylesheets=wato_styles)
html.begin_context_buttons()
- html.context_button(_("Home"), make_link([("mode",
"main")]), "home")
+ html.context_button(_("Main Menu"), make_link([("mode",
"main")]), "home")
html.end_context_buttons()
html.message(_("This module has not yet been implemented."))
html.footer()
@@ -769,6 +769,7 @@ def mode_folder(phase):
elif phase == "buttons":
global_buttons()
+ # html.write("<br><br><hr>")
if config.may("wato.rulesets") or config.may("wato.seeall"):
html.context_button(_("Rulesets"),
make_link([("mode", "ruleeditor")]), "rulesets")
html.context_button(_("Folder Properties"),
make_link_to([("mode", "editfolder")], g_folder), "edit")
@@ -9921,7 +9922,7 @@ def mode_pattern_editor(phase):
return _("Logfile Patterns of Logfile %s on Host %s") % (item,
hostname)
elif phase == "buttons":
- html.context_button(_("Home"), make_link([("mode",
"main")]), "home")
+ html.context_button(_("Main Menu"), make_link([("mode",
"main")]), "home")
if host:
if item:
title = _("Show Logfile")
@@ -10467,7 +10468,7 @@ def global_buttons():
home_button()
def home_button():
- html.context_button(_("Home"), make_link([("mode",
"main")]), "home")
+ html.context_button(_("Main Menu"), make_link([("mode",
"main")]), "home")
def search_button():
html.context_button(_("Search"), make_link([("mode",
"search")]), "search")
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 7cc162f..26c3c2c 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -41,7 +41,7 @@ def render_wato():
html.write(_("You are not allowed to use Check_MK's web configuration
GUI."))
return False
- iconlink(_("Main menu"), "wato.py", "home")
+ iconlink(_("Main Menu"), "wato.py", "home")
for mode, title, icon, permission, help in wato.modules:
if config.may("wato." + permission) or
config.may("wato.seeall"):
iconlink(title, "wato.py?mode=%s" % mode, icon)